Re: multiple hot standby streaming replication scenario with "rotating" the primary server

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Gerhard Hintermayer" <gerhard(dot)hintermayer(at)gmail(dot)com>, "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: multiple hot standby streaming replication scenario with "rotating" the primary server
Date: 2011-04-07 13:48:55
Message-ID: 4D9D7A77020000250003C4C8@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Gerhard Hintermayer <gerhard(dot)hintermayer(at)gmail(dot)com> wrote:

> I'm trying to set up at least 3 servers using hot standby
> streaming replication. I'd like to have one primary and 2
> secondary (on 2 different locations in case of a desaster in the
> server room).
> A primary
> B secondary 1
> C secondary 2 (on a different location that A and B)
>
> Are the following actions in case of recovering to any of the
> standby servers (B or C) correct ?
>
> 1. primary A crashes/maintenance or whatever
> 2. creating the trigger file on B brings this server to life.
> 3. stop server on C
> 4. make base backup on B and install it on C and A (if already
> available)
> 5. change primary_conninfo in recovery.conf on A,C to reflect new
> primary B
> 6. start server on A,C
>
> These actions should all be automated, since I have no redundancy
> between step 1 and 6, so in case something happens to the just
> switched over new primary, I have no up to date server to bring up
> from standby. Making base backup takes ~10 mins, installing
> probably also about 10 mins, so I have 20 minutes, where nothing
> should happen to B :-(
>
> But maybe I'm also missing something.

The main thing I would look at is how you do step 4. Proper use of
rsync (using a daemon) directly from B to C and A (over the top of
what they have from before the crash) should be optimal. We saw two
orders of magnitude improvement in backup time over a slow WAN doing
this. YMMV

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2011-04-07 14:25:54 Re: Out Of Memory 8.1
Previous Message French, Martin 2011-04-07 11:36:01 Re: Out Of Memory 8.1