Streaming replication: rsync to switchover

From: rd <rudi(dot)pettazzi(at)kemen(dot)it>
To: pgsql-admin(at)postgresql(dot)org
Subject: Streaming replication: rsync to switchover
Date: 2011-04-18 17:16:53
Message-ID: 4DAC7205.8080203@kemen.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

I've setup streaming replication + file-based log-shipping, with a
hot-standby.

Everything's good, except I don't know which is the correct way to sync
the once-master db with the newly promoted master after a switchover,

1) I shutdown the master and touch the trigger_file on the slave. Now
the slave becomes the master.
2) On the old-master I create recovery.conf + archive directory for
file-based log-shipping.
3) I hope I can setup the old-master with a simple rsync, because the
operation could be really fast, being M and S almost identical, but I'm
not sure about the correct way to rsync them:

a) should I rsync --delete?
b) should I delete the pg_xlog of the old master, before rsyncing? (I'm
wondering what could happen if some of them never made its way to the
slave, that now has become new-master)
c) am I missing something? For example, I've read somewhere that one
should copy pg_control and pg_stat from the old slave to the new slave
but it doesn't make sense to me.

thanks for any hint,

--
rudi pettazzi

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message H S 2011-04-18 18:42:19 "postgres" is needed by initdb but was not found
Previous Message Dan Birken 2011-04-15 20:45:05 Re: streaming AND file-based log-shipping?