<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>Trying to configure a master with two standby server vm's<br><br>Postrgresql.conf - Master Server VM<br><br>wal_level = hot_standby # minimal, archive, or hot_standby </div><div> # (change requires restart)<br># - Archiving -<br>archive_mode = on # allows archiving to be done # (change requires restart)<br>archive_command = 'test ! -f /mnt/server/master_archivedir/%f && cp %p /mnt/server/master_archivedir/%f' # command to use to archive a logfile segment<br> # placeholders: %p = path of file to archive<br>#archive_timeout = 0 # force a logfile segment switch after this<br> # number of seconds; 0 disables<br>#------------------------------------------------------------------------------<br># REPLICATION<br>#------------------------------------------------------------------------------<br># - Sending Server(s) -<br># Set these on the master and on any standby that will send replication data.<br>max_wal_senders = 3 # max number of walsender processes<br> # (change requires restart)<br>_________________________________________________________________________________________________________<br>Postrgresql.conf - Slave1 Server VM<br><br>wal_level = hot_standby # minimal, archive, or hot_standby</div><div> # (change requires restart)<br># - Archiving -<br>archive_mode = on # allows archiving to be done<br> # (change requires restart)<br>archive_command = 'test ! -f /mnt/server/slave1_archivedir/%f && cp %p /mnt/server/slave1_archivedir/%f' # command to use to archive a logfile segment<br> # placeholders: %p = path of file to archive<br>#archive_timeout = 0 # force a logfile segment switch after this<br> # number of seconds; 0 disables<br>#------------------------------------------------------------------------------<br># REPLICATION<br>#------------------------------------------------------------------------------<br># - Sending Server(s) -<br># Set these on the master and on any standby that will send replication data.<br>max_wal_senders = 3 # max number of walsender processes<br> # (change requires restart)<br># - Standby Servers -<br># These settings are ignored on a master server.<br>hot_standby = on<br><br>*** Completed this step, with 1.2.3.4 being the IP of slave1<br><br>psql -c "select pg_start_backup('initial_backup');"<br>rsync -cvar --inplace --exclude=*pg_xlog* /u01/fiber/postgreSQL_data/postgres(at)1(dot)2(dot)3(dot)4:/u01/fiber/postgreSQL_data/<br>psql -c " select pg_stop_backup ();"<br><br><b>Now the issue is with the recovery.conf file on slave1, should the restore_command point to the archivelogs on the master? <br>Do I run the archive_cleanup_command when I recover slave1 or do I wait until I have finished backup/copy from the slave2</b><br><br>standby_mode = 'on'<br>primary_conninfo = 'host=<master database ip address> port=5432 dbname=tumsdb user=replication password=<password> application_name=slave1 sslmode=require'<br>restore_command = 'cp /mnt/server/master_archivedir/%f "%p%"' <b><--- **** Is this correct! **** The master remains on-line and is producing archive logs. </b><br>archive_cleanup_command = 'pg_archivecleanup /mnt/server/master_archivedir/ %r'<br>trigger_file= '/opt/PostgreSQL/9.3/data/pgsql.trigger.file'<br>______________________________________________________________________________________________________<br>Postrgresql.conf - Slave2 Server VM<br><br>wal_level = hot_standby # minimal, archive, or hot_standby<br> # (change requires restart)<br># - Archiving -<br>archive_mode = on # allows archiving to be done<br> # (change requires restart)<br>archive_command = 'test ! -f /mnt/server/slave2_archivedir/%f && cp %p /mnt/server/slave2_archivedir/%f' # command to use to archive a logfile segment<br> # placeholders: %p = path of file to archive<br>#archive_timeout = 0 # force a logfile segment switch after this<br> # number of seconds; 0 disables<br>#------------------------------------------------------------------------------<br># REPLICATION<br>#------------------------------------------------------------------------------<br># - Sending Server(s) -<br># Set these on the master and on any standby that will send replication data.<br>max_wal_senders = 3 # max number of walsender processes<br> # (change requires restart)<br># - Standby Servers -<br># These settings are ignored on a master server.<br>hot_standby = on<br><br>*** I HAVE NOT COMPLETED this step yet from the master, with 1.2.3.5 being the IP of slave2. This takes about 3 days to finish the rsync copy<br><br>psql -c "select pg_start_backup('initial_backup');"<br>rsync -cvar --inplace --exclude=*pg_xlog* /u01/fiber/postgreSQL_data/postgres(at)1(dot)2(dot)3(dot)5:/u01/fiber/postgreSQL_data/<br>psql -c " select pg_stop_backup ();"<br></div><div><br></div><div>Recovery.conf file slave2<br></div><div><br>standby_mode = 'on'<br>primary_conninfo = 'host=<master database ip address> port=5432 dbname=tumsdb user=replication password=<password> application_name=slave2 sslmode=require'<br>restore_command = 'cp /mnt/server/slave2_archivedir/%f "%p%"' <b><--- **** Is this correct! **** The master remains on-line and is producing archive logs. </b><br>archive_cleanup_command = 'pg_archivecleanup /mnt/server/slave2_archivedir/ %r'<br>trigger_file= '/opt/PostgreSQL/9.3/data/pgsql.trigger.file'<br><br>These directories reside on a share accessible to all three VM's<br><br>/mnt/server/master_archivedir<br>/mnt/server/slave1_archivedir<br>/mnt/server/slave2_archivedir</div><div><br></div><div>Thanks for any assistance. <br><br><br mce_bogus="1"></div></span></body></html>