Having trouble configuring a Master with multiple standby Servers in PostgreSQL 9.3.3

From: <fburgess(at)radiantblue(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Having trouble configuring a Master with multiple standby Servers in PostgreSQL 9.3.3
Date: 2014-04-16 16:29:39
Message-ID: 20140416092939.5a830134ae84016b0174832fdc1a3173.9f5b1c3d5f.wbe@email11.secureserver.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # minimal, archive, or hot_standby&nbsp; </div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (change requires restart)<br># - Archiving -<br>archive_mode = on&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # allows archiving to be done&nbsp;&nbsp; # (change requires restart)<br>archive_command = 'test ! -f /mnt/server/master_archivedir/%f &amp;&amp; cp %p /mnt/server/master_archivedir/%f' # command to use to archive a logfile segment<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # placeholders: %p = path of file to archive<br>#archive_timeout = 0&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # force a logfile segment switch after this<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # 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&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # max number of walsender processes<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # (change requires restart)<br>_________________________________________________________________________________________________________<br>Postrgresql.conf - Slave1 Server VM<br><br>wal_level = hot_standby&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # minimal, archive, or hot_standby</div><div>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br># - Archiving -<br>archive_mode = on&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # allows archiving to be done<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; # (change requires restart)<br>archive_command = 'test ! -f /mnt/server/slave1_archivedir/%f &amp;&amp; cp %p /mnt/server/slave1_archivedir/%f' # command to use to archive a logfile segment<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # placeholders: %p = path of file to archive<br>#archive_timeout = 0&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # force a logfile segment switch after this<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; # 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&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # max number of walsender processes<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (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=&lt;master database ip address&gt; port=5432 dbname=tumsdb user=replication password=&lt;password&gt; application_name=slave1 sslmode=require'<br>restore_command = 'cp /mnt/server/master_archivedir/%f "%p%"'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>&lt;--- **** 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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # minimal, archive, or hot_standby<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br># - Archiving -<br>archive_mode = on&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # allows archiving to be done<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # (change requires restart)<br>archive_command = 'test ! -f /mnt/server/slave2_archivedir/%f &amp;&amp; cp %p /mnt/server/slave2_archivedir/%f' # command to use to archive a logfile segment<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # placeholders: %p = path of file to archive<br>#archive_timeout = 0&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # force a logfile segment switch after this<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # 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&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # max number of walsender processes<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # (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=&lt;master database ip address&gt; port=5432 dbname=tumsdb user=replication password=&lt;password&gt; application_name=slave2 sslmode=require'<br>restore_command = 'cp /mnt/server/slave2_archivedir/%f "%p%"'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>&lt;--- **** 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>

Attachment Content-Type Size
unknown_filename text/html 7.9 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message greenreaper 2014-04-16 17:19:20 BUG #10051: Documentation should explain use of LOWER(X) text_pattern_ops indexes with LIKE to replace ILIKE
Previous Message Alvaro Herrera 2014-04-16 16:28:09 Re: BUG #9749: ERROR: unexpected classid 3600