Re: Postgres replication

From: Samed YILDIRIM <samed(at)reddoc(dot)net>
To: "Gone, Sajan" <sgone(at)lb(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgres replication
Date: 2017-04-17 14:12:33
Message-ID: 865651492438353@web26m.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<div>Hi Sajan,</div><div> </div><div>What is meaning of Active/Active setup for you? Postgres provides 1 master (read/write) server and multiple synchronous/asynchronous (read-only) slave server with streaming replication build-in. If you want multiple master (read/write) PostgreSQL server, you should use an additional tool like BDR (Bi-Directional Replication), EDB Replication Server etc. Also Postgres-XC may be taken your interest.</div><div> </div><div><a href="https://www.2ndquadrant.com/en/resources/bdr/">https://www.2ndquadrant.com/en/resources/bdr/</a></div><div><a href="https://www.enterprisedb.com/products-services-training/products-overview/xdb-replication-server-multi-master">https://www.enterprisedb.com/products-services-training/products-overview/xdb-replication-server-multi-master</a></div><div> </div><div>Best regards.</div><div>Samed YILDIRIM</div><div> </div><div> </div><div> </div><div>17.04.2017, 15:52, "Gone, Sajan" &lt;sgone(at)lb(dot)com&gt;:</div><blockquote type="cite"><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;"><div><span style="font-size:16px;">Thanks Samed. That sure works.</span></div><div> </div><div><span style="font-size:16px;">I have followed the documentation that you have provided at <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.digitalocean.com_community_tutorials_how-2Dto-2Dset-2Dup-2Dmaster-2Dslave-2Dreplication-2Don-2Dpostgresql-2Don-2Dan-2Dubuntu-2D12-2D04-2Dvps&amp;d=DwMGaQ&amp;c=spYp1tZ3AQD6dfuI6rqaeg&amp;r=7n1bLwXDzepgjKSNziw-ng&amp;m=fHbva-Ii918KntE6AvrhZBUaeKjC9nKfhVNdqTAkYU8&amp;s=GAJTCqC_l4UPTLi3vPPGwcbfSz80O79T1x6GJGA_JTU&amp;e=">https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-vps</a> and the replication works perfectly fine. I am assuming this works perfectly fine for an Active/Passive setup, however I am wondering on how to setup Active/Active kind of an replication setup.</span></div><div> </div><div><span style="font-size:16px;"> Is Active/Active possible with postgres database, if so is there any documentation that I can follow to setup Active/Active replication ?</span></div><div> </div><div><span style="font-size:16px;">Thank You.</span></div><div> </div><div><div><span style="font-size:16px;">Thank You,</span></div><div><span style="font-size:16px;">Sajan Gone</span></div><div style="font-size:14px;"> </div></div><div style="font-size:14px;"> </div><div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt;"><span style="font-size:14px;"><strong style="font-weight:bold;">From: </strong>Samed YILDIRIM &lt;<a href="mailto:samed(at)reddoc(dot)net">samed(at)reddoc(dot)net</a>&gt;<br /><strong style="font-weight:bold;">Date: </strong>Friday, April 14, 2017 at 10:34 AM<br /><strong style="font-weight:bold;">To: </strong>Sajan Gone &lt;<a href="mailto:sgone(at)lb(dot)com">sgone(at)lb(dot)com</a>&gt;, "<a href="mailto:pgsql-admin(at)postgresql(dot)org">pgsql-admin(at)postgresql(dot)org</a>" &lt;<a href="mailto:pgsql-admin(at)postgresql(dot)org">pgsql-admin(at)postgresql(dot)org</a>&gt;<br /><strong style="font-weight:bold;">Subject: </strong>Re: [ADMIN] Postgres replication</span></div><div> </div><div><div><div><span style="font-size:14px;">Hi Sajan,</span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;">You can use following query.</span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;">select * from pg_stat_replication;</span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;">Best regards.</span></div><div><span style="font-size:14px;">Samed YILDIRIM</span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;">14.04.2017, 17:20, "Gone, Sajan" &lt;<a href="mailto:sgone(at)lb(dot)com">sgone(at)lb(dot)com</a>&gt;:</span></div><blockquote type="cite"><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;"><div><span style="font-size:14px;"><span style="font-size:16px;">Hi Samed,</span></span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;"><span style="font-size:16px;">  Thanks for sending out the weblink. I was able to successfully set the replication up (Master/Slave, Hot stand by).</span></span></div><div><span style="font-size:14px;"> </span></div><div><span style="font-size:14px;"><span style="font-size:16px;">I really appreciate your help on this.</span></span></div><div><span style="font-size:14px;"><span style="font-size:16px;"> </span></span></div><div><span style="font-size:14px;"><span style="font-size:16px;">My background is mostly on MySQL so my next question would be on how to look at the replication status. Like MySQL  “Show slave status \G” command is there any command on postgres to look at the slave current status(or replication status).</span></span></div><div><span style="font-size:14px;"> </span></div><div><div><span style="font-size:14px;"><span style="font-size:16px;">Thank You,</span></span></div><div><span style="font-size:14px;"><span style="font-size:16px;">Sajan Gone.</span></span></div></div><div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt;"><span style="font-size:14px;"><span style="font-size:14px;"><strong style="font-weight:bold;">From: </strong>Samed YILDIRIM &lt;<a href="mailto:samed(at)reddoc(dot)net">samed(at)reddoc(dot)net</a>&gt;<br /><strong style="font-weight:bold;">Date: </strong>Thursday, April 13, 2017 at 4:27 PM<br /><strong style="font-weight:bold;">To: </strong>Sajan Gone &lt;<a href="mailto:sgone(at)lb(dot)com">sgone(at)lb(dot)com</a>&gt;, "<a href="mailto:pgsql-admin(at)postgresql(dot)org">pgsql-admin(at)postgresql(dot)org</a>" &lt;<a href="mailto:pgsql-admin(at)postgresql(dot)org">pgsql-admin(at)postgresql(dot)org</a>&gt;<br /><strong style="font-weight:bold;">Subject: </strong>Re: [ADMIN] Postgres replication</span></span></div><div><span style="font-size:14px;"> </span></div><div><div><span style="font-size:14px;"><span style="font-size:14px;">Hi Sajan, </span> </span><div><span style="font-size:14px;"> </span></div><span style="font-size:14px;"> </span><div><span style="font-size:14px;"><span style="font-size:14px;">You can take a look following document. <span style="font-family:sans-serif;">It is good for a start point.</span></span></span></div><span style="font-size:14px;"> </span><div><span style="font-size:14px;"> </span></div><span style="font-size:14px;"> </span><div><span style="font-size:14px;"><span style="font-size:14px;"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.digitalocean.com_community_tutorials_how-2Dto-2Dset-2Dup-2Dmaster-2Dslave-2Dreplication-2Don-2Dpostgresql-2Don-2Dan-2Dubuntu-2D12-2D04-2Dvps&amp;d=DwMGaQ&amp;c=spYp1tZ3AQD6dfuI6rqaeg&amp;r=7n1bLwXDzepgjKSNziw-ng&amp;m=fHbva-Ii918KntE6AvrhZBUaeKjC9nKfhVNdqTAkYU8&amp;s=GAJTCqC_l4UPTLi3vPPGwcbfSz80O79T1x6GJGA_JTU&amp;e=">https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-vps</a></span></span></div><span style="font-size:14px;"> </span><div><span style="font-size:14px;"> </span></div><span style="font-size:14px;"> </span><div><span style="font-size:14px;"><span style="font-size:14px;">Best regards.</span></span></div><span style="font-size:14px;"> </span><div><br /><span style="font-size:14px;"><span style="font-size:14px;">22:25, 13 Nisan 2017, "Gone, Sajan" &lt;<a href="mailto:sgone(at)lb(dot)com">sgone(at)lb(dot)com</a>&gt;:</span><br /><br /><br /><br />  </span><blockquote><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;"><span style="font-size:14px;">  </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">Hello,</span></span></span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;"> </span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">Good afternoon everyone. </span></span></span></div><span style="font-size:14px;">   </span><div><br /><span style="font-size:14px;"> </span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">  This is Sajan Gone, I am trying to setup a Standard Master/Salve replication between two postgres instances. I am pretty much new to postgres and not exactly sure how replication works and what is an architecture behind<br />it.  As of now I am following the standard postgres documentation @ <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.postgresql.org_docs_current_static_warm-2Dstandby.html-23PREPARING-2DMASTER-2DFOR-2DSTANDBY&amp;d=DwMGaQ&amp;c=spYp1tZ3AQD6dfuI6rqaeg&amp;r=7n1bLwXDzepgjKSNziw-ng&amp;m=Vi2JxqEOxr992ibCDezMAd_sbdja65aRxMh4oM6WYpo&amp;s=Qb_JJynxAr1X-KEpv8g-FVJ4Ac4wuqLr6fR3IfEVNpo&amp;e=">https://www.postgresql.org/docs/current/static/warm-standby.html#PREPARING-MASTER-FOR-STANDBY</a>,<br />however it is slightly difficult for me to understand.</span></span></span></div><span style="font-size:14px;">   </span><div><br /><span style="font-size:14px;"> </span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">It would be very helpful if any one could guide me in a proper way on setting up Master/Slave replication on postgres. Any recommendations on good documentation<br />or study materials on postgres replication would be highly appreciated.</span></span></span></div><span style="font-size:14px;">   </span><div><br /><span style="font-size:14px;"> </span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">Many Thanks in advance.</span></span></span></div><span style="font-size:14px;">   </span><div><br /><span style="font-size:14px;"> </span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;">  </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">Thank You,</span></span></span></div><span style="font-size:14px;">   </span><div><span style="font-size:14px;"><span style="font-size:14px;"><span style="font-size:16px;">Sajan Gone</span></span></span></div><span style="font-size:14px;">   </span><div><br /><span style="font-size:14px;"> </span></div><span style="font-size:14px;"> </span></div><br /><br /><span style="font-size:14px;">  </span><hr /><br /><br /><br /><span style="font-size:14px;"><span style="font-size:14px;"><font color="Gray" size="1" face="Arial">Notice: This communication may contain privileged and/or confidential information. If you are not the intended recipient, please notify the sender by email, and immediately delete the message and any attachments without copying or disclosing them. LB may, for<br />any reason, intercept, access, use, and disclose any information that is communicated by or through, or which is stored on, its networks, applications, services, and devices.</font></span><br /><br /> </span></div><br /><span style="font-size:14px;"> </span></blockquote><span style="font-size:14px;"> </span></div><span style="font-size:14px;"> </span></div></div><span style="font-size:14px;">  </span><hr /><br /><span style="font-size:14px;"><font color="Gray" size="1" face="Arial">Notice: This communication may contain privileged and/or confidential information. If you are not the intended recipient, please notify the sender by email, and immediately delete the message and any attachments without copying or disclosing them. LB may, for any reason, intercept, access, use, and disclose any information that is communicated by or through, or which is stored on, its networks, applications, services, and devices.</font></span></div></blockquote></div></div> <hr /><br /><font color="Gray" size="1" face="Arial">Notice: This communication may contain privileged and/or confidential information. If you are not the intended recipient, please notify the sender by email, and immediately delete the message and any attachments without copying or disclosing them. LB may, for any reason, intercept, access, use, and disclose any information that is communicated by or through, or which is stored on, its networks, applications, services, and devices.</font></div></blockquote>

Attachment Content-Type Size
unknown_filename text/html 12.6 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gone, Sajan 2017-04-17 14:24:43 Re: Postgres replication
Previous Message Gone, Sajan 2017-04-17 12:52:39 Re: Postgres replication