RE: Master slave replication - Mailing list pgsql-admin

From Ahmed, Nawaz
Subject RE: Master slave replication
Date
Msg-id BAAE097528E6CB4FB2BE65AEFA6EEE04939D2E46@SYD1217
Whole thread Raw
In response to Re: Master slave replication  (arvind chikne <arvind.chikne@gmail.com>)
List pgsql-admin

Hi Arvind,

 

The log shipping method of standby you are referring to is a warm standby, please have a look at the manuals,  and follow it until the section as highlighted below. The URL points to the 9.6 manuals, please change it to 10 for the configuration on PostgreSQL 10.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

26.2.4. Setting Up a Standby Server

 

To set up the standby server, restore the base backup taken from primary server (see Section 25.3.4). Create a recovery command file recovery.conf in the standby's cluster data directory, and turn on standby_mode. Set restore_command to a simple command to copy files from the WAL archive. If you plan to have multiple standby servers for high availability purposes, set recovery_target_timeline to latest, to make the standby server follow the timeline change that occurs at failover to another standby.

 

    Note: Do not use pg_standby or similar tools with the built-in standby mode described here. restore_command should return immediately if the file does not exist; the server will retry the command again if necessary. See Section 26.4 for using tools like pg_standby.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

 

 

Best Regards,

 

Nawaz Ahmed
Software Development Engineer

Fujitsu Australia Software Technology Pty Ltd

14 Rodborough Road, Frenchs Forest NSW 2086, Australia
T +61 2 9452 9027
Nawaz@fast.au.fujitsu.com
fastware.com.au


 

From: arvind chikne [mailto:arvind.chikne@gmail.com]
Sent: Tuesday, 15 May 2018 4:51 AM
To: Johannes Truschnigg <johannes@truschnigg.info>
Cc: pgsql-admin@postgresql.org
Subject: Re: Master slave replication

 

Thanks  Johannes,

 

It would be really great if you can share any log shipping method for master slave replication, step by step guide is much appreciated.

  

 

On Tue, May 15, 2018 at 12:11 AM, Johannes Truschnigg <johannes@truschnigg.info> wrote:

On Mon, May 14, 2018 at 11:29:22PM +0530, arvind chikne wrote:
> HI All,
>
> From the past few years I am working on standalone postgres database, but
> now want to setup the master slave (Active-passive) and master master
> (Active-Active) replication of the postgres database, can any one suggest
> me how can I archive the same, any good document is much appreciate.

For creating a streaming replication slave from scratch, check out the
`pg_basebackup` tool. Exercised right, it will even create a suitable
recovery.conf for running a slave instance from the backup it creates. You
should also check out Zalando's patroni[0], which is a popular solution for
providing automatic failover capabilities for postgres master/slave-pairs.


Postgres doesn't support multi-master replication; if you're interested in
exploring this anyway, take a look at the BDR project[1].


[0]: https://github.com/zalando/patroni
[1]: https://www.2ndquadrant.com/en/resources/postgres-bdr-2ndquadrant/

--
with best regards:
- Johannes Truschnigg ( johannes@truschnigg.info )

www:   https://johannes.truschnigg.info/
phone: +43 650 2 133337
xmpp:  johannes@truschnigg.info

Please do not bother me with HTML-email or attachments. Thank you.



 

--

Thanks & Regards
Arvind rao chikne

9818979986

Think Green!!! Please consider your environmental responsibility before printing this e-mail

 

Disclaimer

The information in this e-mail is confidential and may contain content that is subject to copyright and/or is commercial-in-confidence and is intended only for the use of the above named addressee. If you are not the intended recipient, you are hereby notified that dissemination, copying or use of the information is strictly prohibited. If you have received this e-mail in error, please telephone Fujitsu Australia Software Technology Pty Ltd on + 61 2 9452 9000 or by reply e-mail to the sender and delete the document and all copies thereof.

Whereas Fujitsu Australia Software Technology Pty Ltd would not knowingly transmit a virus within an email communication, it is the receiver’s responsibility to scan all communication and any files attached for computer viruses and other defects. Fujitsu Australia Software Technology Pty Ltd does not accept liability for any loss or damage (whether direct, indirect, consequential or economic) however caused, and whether by negligence or otherwise, which may result directly or indirectly from this communication or any files attached.

If you do not wish to receive commercial and/or marketing email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.au.fujitsu.com

pgsql-admin by date:

Previous
From: Don Seiler
Date:
Subject: Re: Streaming Replication Networking Best Practices?
Next
From: "Ahmed, Nawaz"
Date:
Subject: RE: Can I synchronize two master DB clusters except BDR ?