From: David Steele <david@pgmasters.net>
To: Pritam Barhate <pritambarhate@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Broken replication in 3 node setup, master halt, standby 1 promoted, standby 2 - replication not working
Date: Wed, 10 Jan 2018 16:21:10 -0500
Message-ID: <851d5773-9911-c2f7-51ba-3dfe0a5108a5@pgmasters.net> (raw)
In-Reply-To: <CALpo98VPj7oFhxUgiXBj+MGpq-M8nt0btHnu2P7R=UsL6zZZaA@mail.gmail.com>
References: <CALpo98VPj7oFhxUgiXBj+MGpq-M8nt0btHnu2P7R=UsL6zZZaA@mail.gmail.com>
Hi Pritam,
On 1/10/18 2:06 PM, Pritam Barhate wrote:
<...>
>
> It reports both the standbys working correctly.
>
> Halt pg1.
>
> On pg2:
>
> sudo -u postgres pg_ctlcluster 9.6 main promote
>
> On pg3:
>
> sudo service postgresql stop
>
> sudo -u postgres vim /var/lib/postgresql/9.6/main/recovery.conf
>
> modify it's contents are as follows:
>
> ```
> primary_conninfo = 'host=pg2 port=5432 user=replicator'
> standby_mode = 'on'
> restore_command = '/usr/bin/pgbackrest --stanza=main archive-get %f "%p"'
> ```
This all looks fine.
I'm not sure why (without testing the configuration), but the switch to
timeline 2 switch is not happening.
Try setting:
recovery_target_timeline=latest
in recovery.conf on pg3.
It's possible that pg3 played past the time when timeline 2 diverged on
pg2 (i.e. pg3 was more up to date), in which case you will need to
restore pg3 from a backup and set the recovery_target_timeline as above.
--
-David
david@pgmasters.net
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: david@pgmasters.net, pritambarhate@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Broken replication in 3 node setup, master halt, standby 1 promoted, standby 2 - replication not working
In-Reply-To: <851d5773-9911-c2f7-51ba-3dfe0a5108a5@pgmasters.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox