I am trying to replicate a master to slave, without shutting down my master.
In the tutorial here: http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial, they recommend these steps:
- pg_start_backup()
- rsync -av --exclude pg_xlog --exclude postgresql.conf --exclude postgresql.pid \ data/* :/var/lib/postgresql/data/
- pg_stop_backup()
- rsync -av data/pg_xlog :/var/lib/postgresql/data/
Steps 1-3 are straightforward. However, If I setup archiving in the master and archiving in my slave, do I need to execute step 4? Will it mess things up? Should I NOT setup archiving until everything is rsync'd and my slave is running?
My master's config file looks like this:
wal_level = hot_standby
archive_mode = on
archive_command = 'rsync -a %p <INSERT SLAVE IP>:/var/lib/pgsql/data/archive/%f'
Likewise, my slave has a recovery.conf with a restore_command.