Promotion of standby to master
I understand that it's possible to promote a "hot standby" pg server
simply by creating the failover file. In a scenario where there are
multiple standby servers, is it possible to point the other standby
servers to the new master without creating a new base backup?
When I tried to do this, I ran into the "timeline 2 of the primary
does not match recovery target timeline 1". I'm just trying to figure
out if that's because the procedure I followed to promote the standby
was wrong or because it's just not possible.
Thanks,
Andy
--
Andy Chambers
Software Engineer
(e) achambers@mcna.net
(t) 954-682-0573
CONFIDENTIALITY NOTICE: This electronic mail may contain information
that is privileged, confidential, and/or otherwise protected from
disclosure to anyone other than its intended recipient(s). Any
dissemination or use of this electronic mail or its contents by
persons other than the intended recipient(s) is strictly prohibited.
If you have received this communication in error, please notify the
sender immediately by reply e-mail so that we may correct our internal
records. Please then delete the original message. Thank you.
On Jun 29, 2012, at 12:16 PM, Andy Chambers wrote:
I understand that it's possible to promote a "hot standby" pg server
simply by creating the failover file. In a scenario where there are
multiple standby servers, is it possible to point the other standby
servers to the new master without creating a new base backup?When I tried to do this, I ran into the "timeline 2 of the primary
does not match recovery target timeline 1". I'm just trying to figure
out if that's because the procedure I followed to promote the standby
was wrong or because it's just not possible.
On your slaves, you need to have the line:
recovery_target_timeline=latest
This allows the slaves to notice that a new timeline has started and move to it. The one gotcha is that you have to make sure to promote a slave which is most ahead in terms of replication; otherwise, if you promote a slave which is further behind than another slave, and that could cause you grief when the lagging slave tries to replicate from the new master.