Re: Warm Standby Setup Documentation

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Bryan Murphy <bmurphy1976(at)gmail(dot)com>
Cc: Ogden <lists(at)darkstatic(dot)com>, PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Warm Standby Setup Documentation
Date: 2010-03-29 05:11:30
Message-ID: 4BB03682.7040805@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bryan Murphy wrote:
> On Fri, Mar 26, 2010 at 1:32 PM, Greg Smith <greg(at)2ndquadrant(dot)com
> <mailto:greg(at)2ndquadrant(dot)com>> wrote:
>
> If there's another server around, you can have your
> archive_command on the master ship to two systems, then use the
> second one as a way to jump-start this whole process. After
> fail-over, just start shipping from the new primary to that 3rd
> server, now the replacement standby, and sync any files it doesn't
> have. Then switch it into recovery. Much faster than doing a new
> base backup from the standby on larger systems.
>
>
> Every time I've tried to do this it's failed because the third server
> was looking for log files starting with 00000006... but the secondary
> server (new master) is now shipping files starting with 00000007...
> How do I get the third server to switch over to the higher numbered
> files? That's the part I was never able to overcome.

One thing it's easy to miss is that you have to save every incoming WAL
archive file on the standby, and sync them all over to the 3rd system
before you trigger the standby to be active. The archive_command has to
be active and shipping to the 3rd system before the server is triggered too.

You can think of any given standby server as a base backup and some
number of WAL segments applied to it. So long as you never let a WAL
file get applied to or generated by the standby who becomes the master
without making its way to the additional system, it should always be
possible to bring up that additional server up to date without something
being missing. The exact order of operations to ensure that in all case
is certainly not obvious though.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2010-03-29 05:14:59 Re: Simultaneous write requests
Previous Message Greg Smith 2010-03-29 04:57:05 Re: Warm Standby Setup Documentation