This 6-step guide, and all of the examples in this tutorial, assume that you have a master server at 192.168.65.5 and a standby server at 192.168.65.3 and that your database and its configuration files are installed at /var/lib/postgresql/data. Replace those with whatever your actual server addresses and directories are.
1. Edit postgresql.conf on the master to turn on streaming replication. Change these settings:
listen_address = '*'
wal_level = hot_standby
max_wal_senders = 3
2. Edit pg_hba.conf on the master in order to let the standby connect.
host replication all 192.168.0.2/32 trust
3. Edit recovery.conf and postgresql.conf on the standby to start up replication and hot standby. First, in postgresql.conf, change this line:
hot_standby = on
Then create a file in the standby's data directory (which is often the same directory as postgresql.conf and pg_hba.conf, except on some Linux distributions such as Debian and Ubuntu), called recovery.conf, with the following lines:
standby_mode = 'on'
primary_conninfo = 'host=192.168.0.1'
4. Shutdown the master and copy the files. You want to copy most but not all files between the two servers, excluding the configuration files and the pg_xlog directory. An example rsync script would be:
rsync -av --exclude pg_xlog --exclude postgresql.conf data/* 192.168.0.2:/var/lib/postgresql/data/
5. Start the standby first, so that they can't get out of sync.
6. Start the master.
Is taking down the master for long enough to copy the files too long? Then you need the 10-minute version.
Starting Replication with only a Quick Master Restart
while doing step 4 mannually,all files are getting copied from master server to standby server including .conf files.
And if i am doing step 5, standby server is not starting.
Please guide me in replication process.