Re: Streaming replication: rsync to switchover

From: rudi <rudolone(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Streaming replication: rsync to switchover
Date: 2011-04-19 15:29:32
Message-ID: 4DADAA5C.6040107@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 04/19/2011 02:11 PM, Ray Stell wrote:
> On Tue, Apr 19, 2011 at 11:16:08AM +0200, rudi wrote:
>> On 04/19/2011 10:09 AM, Gerhard Hintermayer wrote:
>> So you keep the old pg_xlog
>
> the admin book says to exclude old pg_xlog
>

Which book is this?

So I guess something like this (from new master to former master) should
be safe:

$ psql -c "SELECT pg_start_backup('switchover base backup')"
$ rsync -av /var/lib/postgresql/9.0/main/ --delete --exclude server.crt
--exclude server.key --exclude recovery.* --exclude postmaster.pid
--exclude archive $FORMER_MASTER_ADDRESS:/var/lib/postgresql/9.0/main/
$ psql -c "SELECT pg_stop_backup()"

What about the archiving directory of the former slave (now master)?
It should be cleaned guess, in case it will be slave again. If I look at
that directory, after a failover it is not empty.
This looks strange to me because pg_cleanup_archive should have already
cleaned it.

BTW, is there any documentation about the logic behind pg_xlog
filenames? It is really obscure and this makes really hard understanding
what's going on. I'm sure that most recent mtime gives me the active
WAL, and I can match somehow this:

Latest checkpoint location: 7/F70021A0
Prior checkpoint location: 7/F7002110
Latest checkpoint's REDO location: 7/F7002168
Latest checkpoint's TimeLineID: 2

with this filename: 0000000200000007000000F7

and that's all.

thanks,

--
rd

Peel your own image from the mirror.
Sit. Feast on your life.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bob Lunney 2011-04-19 19:51:45 Re: PKs without indexes
Previous Message Jerry Sievers 2011-04-19 15:19:33 Re: PKs without indexes