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].