From: | "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
---|---|
To: | "Ken Brush *EXTERN*" <kbrush(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Multiple Slave Failover with PITR |
Date: | 2012-03-28 07:35:11 |
Message-ID: | D960CB61B694CF459DCFB4B0128514C207AA8DC4@exadv11.host.magwien.gv.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
Ken Brush wrote:
> I notice that the documentation at:
> http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial
>
> Doesn't contain steps in a Multiple Slave setup for re-establishing
> them after a slave has become the new master.
>
> Based on the documentation, here are the most fail-proof steps I came
up with:
>
> 1. Master dies :(
> 2. Touch the trigger file on the most caught up slave.
> 3. Slave is now the new master :)
> 4. use pg_basebackup or other binary replication trick (rsync, tar
> over ssh, etc...) to bring the other slaves up to speed with the new
> master.
> 5. start the other slaves pointing to the new master.
>
> But, that can take time (about 1-2 hours) with my medium sized DB
> (580GB currently).
>
> After testing a few different ideas that I gleaned from posts on the
> mail list, I came up with this alternative method:
>
> 1. Master dies :(
> 2. Touch the trigger file on the most caught up slave
> 3. Slave is now the new master.
> 4. On the other slaves do the following:
> 5. Shutdown postgres on the slave
> 6. Delete every file in /data/pgsql/data/pg_xlog
> 7. Modify the recovery.conf file to point to the new master and
> include the line "recovery_target_timeline='latest'"
> 8. Copy the history file from the new master to the slave (it's the
> most recent #.history file in the xlog directory)
> 9. Startup postgres on the slave and watch it sync up to the new
> master (about 1-5 minutes usually)
>
> My question is this. Is the alternative method adequate? I tested it a
> bit and couldn't find any problems with data loss or inconsistency.
That sounds like it should work fine.
Yours,
Laurenz Albe
From | Date | Subject | |
---|---|---|---|
Next Message | Albert | 2012-03-28 11:40:42 | user get notification when postgresql database updated |
Previous Message | Toby Corkindale | 2012-03-28 07:14:18 | How to tell if server is in backup mode? |
From | Date | Subject | |
---|---|---|---|
Next Message | Thom Brown | 2012-03-28 07:39:18 | Re: pgsql_fdw, FDW for PostgreSQL server |
Previous Message | Albe Laurenz | 2012-03-28 07:18:36 | Re: pgsql_fdw, FDW for PostgreSQL server |