Discussion:
[ADMIN] Failover of a Hot standby setup with multiple standbys
(too old to reply)
Deepesh D
2012-02-28 12:05:27 UTC
Permalink
Hello,

I have setup PostgreSQL (9.1.2) in Hot standby mode on 4 linux servers (1
master - M and 3 standby - S1, S2, S3). I have a few doubts regarding how
the failover will be done in this setup.

Suppose if the master server fails and I make one of the standby (S1) the
master, how do I switch the other two standbys to the new master S1?

Is it enough if I just change the 'primary_conninfo' and 'restore_command'
in both the slaves (S2,S3) to point to the new master S1?

Please help.


Thanks
Sergey Konoplev
2012-02-29 05:37:02 UTC
Permalink
Is it enough if I just change theĀ  'primary_conninfo' and 'restore_command'
in both the slaves (S2,S3) to point to the new master S1?
Once I had such experience on 9.0.x and here is the note I made for myself:

To switch a replica to read from the new master after switching it
over add the following instruction in the recovery.conf on the
replica.

recovery_target_timeline = 'latest'

Then stop the service, resync the pg_xlog directory on the replica and
start it. Note that the old master must be stopped before switching
the new one over. It will prevent replicas from timeline divergence.

ps. I tried to adjust the x..xx.history file to avoid re-syncing
pg_xlog but without any success.

pps. BTW I still wonder if it is possible to avoid the re-syncing. May
be it could be done by setting restore_command?
--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com
LinkedIn: http://ru.linkedin.com/in/grayhemp
JID/GTalk: ***@gmail.com Skype: gray-hemp
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Loading...