Re: Broken replication in 3 node setup, master halt, standby 1 promoted, standby 2 - replication not working

From: David Steele <david(at)pgmasters(dot)net>
To: Pritam Barhate <pritambarhate(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Broken replication in 3 node setup, master halt, standby 1 promoted, standby 2 - replication not working
Date: 2018-01-10 21:21:10
Message-ID: 851d5773-9911-c2f7-51ba-3dfe0a5108a5@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)pgmasters(dot)net

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2018-01-10 22:00:42 Re: Replication mode
Previous Message Azimuddin Mohammed 2018-01-10 20:24:55 Replication mode