Re: Configuring Standby Server in PostgreSQL 9.3.3

From: <fburgess(at)radiantblue(dot)com>
To: "Jeff Frost" <jeff(at)pgexperts(dot)com>, "Heikki Linnakangas" <hlinnakangas(at)vmware(dot)com>
Cc: "Michele" <michele(dot)mariani(at)databtech(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Configuring Standby Server in PostgreSQL 9.3.3
Date: 2014-04-08 22:17:44
Message-ID: 20140408151744.5a830134ae84016b0174832fdc1a3173.b3023be483.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>

Management requires that we implement a master server with two standby database servers. Is it recommended we keep the archives logs in separate directories in each VM, or that we have one directory on a shared drive that each of the three VM's can access? We would like to leverage the archive_cleanup_command = ‘pg_archivecleanup /sharedata/postgres_archive_master %r’ in our recovery.conf configuration on both standby servers.<br><br>-------- Original Message --------</div><blockquote id="replyBlockquote" webmail="1" style="border-left: 2px solid blue; margin-left: 8px; padding-left: 8px; font-size:10pt; color:black; font-family:verdana;"><div id="wmQuoteWrapper">
Subject: Re: [BUGS] Configuring Standby Server in PostgreSQL 9.3.3<br>
From: &lt;<a href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</a>&gt;<br>
Date: Tue, April 08, 2014 12:34 pm<br>
To: "Jeff Frost" &lt;<a href="mailto:jeff(at)pgexperts(dot)com">jeff(at)pgexperts(dot)com</a>&gt;, "Heikki Linnakangas"<br>
&lt;<a href="mailto:hlinnakangas(at)vmware(dot)com">hlinnakangas(at)vmware(dot)com</a>&gt;<br>
Cc: "Michele" &lt;<a href="mailto:michele(dot)mariani(at)databtech(dot)com">michele(dot)mariani(at)databtech(dot)com</a>&gt;, <a href="mailto:pgsql-bugs(at)postgresql(dot)org">pgsql-bugs(at)postgresql(dot)org</a><br>
<br>
<span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>Our standby server sits on a separate VM,. Should archive_mode = on be set only on the master and not the slave? My colleague is convinced that the archive log directory should sit on a shared drive that is accessible to both VM's (master and Slave)</div><div><br></div> <blockquote id="replyBlockquote" webmail="1" style="border-left: 2px solid blue; margin-left: 8px; padding-left: 8px; font-size:10pt; color:black; font-family:verdana;"> <div id="wmQuoteWrapper"> -------- Original Message --------<br> Subject: Re: [BUGS] Configuring Standby Server in PostgreSQL 9.3.3<br> From: Jeff Frost &lt;<a target="_blank" href="mailto:jeff(at)pgexperts(dot)com">jeff(at)pgexperts(dot)com</a>&gt;<br> Date: Tue, April 08, 2014 9:39 am<br> To: Heikki Linnakangas &lt;<a target="_blank" href="mailto:hlinnakangas(at)vmware(dot)com">hlinnakangas(at)vmware(dot)com</a>&gt;<br> Cc: <a target="_blank" href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</a>, Michele &lt;<a target="_blank" href="mailto:michele(dot)mariani(at)databtech(dot)com">michele(dot)mariani(at)databtech(dot)com</a>&gt;,<br> <a target="_blank" href="mailto:pgsql-bugs(at)postgresql(dot)org">pgsql-bugs(at)postgresql(dot)org</a><br> <br> <br> On Apr 8, 2014, at 3:16 AM, Heikki Linnakangas &lt;<a target="_blank" href="mailto:hlinnakangas(at)vmware(dot)com">hlinnakangas(at)vmware(dot)com</a>&gt; wrote:<br> <br> &gt; On 04/08/2014 01:25 AM, <a target="_blank" href="mailto:fburgess(at)radiantblue(dot)com">fburgess(at)radiantblue(dot)com</a> wrote:<br> &gt;&gt; Did you guys benchmark the basebackup utility? The master database will have to<br> &gt;&gt; remain online during this backup/restore process, since it is receiving real<br> &gt;&gt; time data feeds. Not sure which technique is better for our 7TB db.<br> &gt;&gt; <br> &gt;&gt; 1.) Running from the slave. 1.2.3.4 is the ip of master database.<br> &gt;&gt; <br> &gt;&gt; basebackup -D /u01/fiber/postgreSQL_data -F p -x stream -c fast -P -v -h 1.2.3.4<br> &gt;&gt; -p 5432 -U replication<br> &gt;&gt; <br> &gt;&gt; 2.) compared to ...<br> &gt;&gt; <br> &gt;&gt; psql -c "select pg_start_backup('initial_backup');"<br> &gt;&gt; rsync -cva --inplace --exclude=*pg_xlog* /u01/fiber/postgreSQL_data/<br> &gt;&gt; postgres(at)1(dot)2(dot)3(dot)4:/u01/fiber/postgreSQL_data/<br> &gt;&gt; psql -c " select pg_stop_backup () ;"<br> &gt;&gt; <br> &gt;&gt; 3.) or this ...<br> &gt;&gt; <br> &gt;&gt; psql –c “select pg_start_backup(‘hot backup’)”<br> &gt;&gt; cp –pr /u01/fiber/postgreSQL_data 1.2.3.4:/u01/fiber/postgreSQL_data<br> &gt;&gt; psql –c “select pg_stop_backup(‘hot backup’)”<br> &gt; <br> &gt; I bet the rsync or cp method is faster. Dunno how much, though, that depends on what the bottleneck is; the network, or the disk, or something else. You'll have to measure it yourself, to know how it is in your environment.<br> &gt; - Heikki<br> <br> FWIW, I benchmarked a few methods here:<br> <br> <a target="_blank" href="http://frosty-postgres.blogspot.com/2011/12/postgresql-base-backup-benchmark.html">http://frosty-postgres.blogspot.com/2011/12/postgresql-base-backup-benchmark.html</a><br> <br> admittedly, the base backup was much smaller, but I suspect you would see similar performance with a larger base backup.<br> <br> You might also try running the rsync once, before issuing pg_start_backup() and then doing a normal base backup so that rsync can take advantage of partial file copy.<br> <br> If you use rsync over ssh, make sure to use the arcfour cipher for best performance.<br> <br> </div> </blockquote></span>
</div>
</blockquote></span></body></html>

Attachment Content-Type Size
unknown_filename text/html 4.8 KB

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2014-04-09 01:05:09 Re: BUG #9843: interval data type storage size (8.1 later)
Previous Message fburgess 2014-04-08 19:34:52 Re: Configuring Standby Server in PostgreSQL 9.3.3