Re: [SQL] Postgres Streaming replication (version:9.4)

From: Jayadevan M <maymala(dot)jayadevan(at)gmail(dot)com>
To: "Mallela, Anil" <anil(dot)mallela(at)emc(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Mike Sofen <msofen(at)runbox(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: [SQL] Postgres Streaming replication (version:9.4)
Date: 2016-04-07 03:24:31
Message-ID: CAFS1N4jvwaBy1ysmKWHvgA+akQA3MCs7kckQtL2PCUQ0t9fnfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc pgsql-sql

On Wed, Apr 6, 2016 at 5:23 PM, Mallela, Anil <anil(dot)mallela(at)emc(dot)com> wrote:

> Hi,
>
> PostgreSQL master/slave Streaming replication is working fine
> .I also changed slave as master using trigger file.
>
> I need some clarification on the below 2 scenarios:
>
> 1. once slave become master whatever the tables are created in new master
> it’s not replicated to old master, how to replicate the same from new
> master to old master
>

The tables created in the new database won't be replicated to the old
master unless you set up replication from the new master to the old master.

> 2. How to make old master as slave (which should accept read only
> transactions)
>
>
>
> Can you please help me regarding this and also tell me is the above
> approach is valid or not.
>
> I have tried 3 nodes(master/slave)—master(bring down master)/make it
> slave as master/and created new slave and it is working fine.
>
There is nothing wrong in using the old master as a slave and the new one
as master from now on, if the machine on which new master is as good as the
one on which the old master was running (memory,processor, disk speed etc).
The process to be followed is the same as what you followed when you set up
the earlier master-slave environment. It sounds as though you have the new
set up working fine.
If you want to automate the process, you could take a look at a tool like
pgpool-II. It does add some overhead and you have to learn a new tool. Look
under the section Pgpool Failback here
http://manojadinesh.blogspot.in/2013/12/pgpool-configuration-failback.html
<http://manojadinesh.blogspot.in/2013/12/pgpool-configuration-failback.html>

Regards,
Jayadevan

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Inoue, Hiroshi 2016-04-07 10:13:32 Re: [PATCH] Regression test failures on big endian
Previous Message Christoph Berg 2016-04-06 21:07:22 Re: [PATCH] Regression test failures on big endian

Browse pgsql-sql by date

  From Date Subject
Next Message 李嘉 2016-04-07 04:37:13 postgresql cpu question
Previous Message Lee Hachadoorian 2016-04-06 20:39:43 Re: Geometry vs Geography (what to use)