pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rd <rudi.pettazzi@kemen.it>
To: pgsql-admin@postgresql.org
Subject: Streaming replication: rsync to switchover
Date: Mon, 18 Apr 2011 19:16:53 +0200
Message-ID: <4DAC7205.8080203@kemen.it> (raw)

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



view thread (8+ messages)  latest in thread

Message-ID: <4DAC7205.8080203@kemen.it>
Permalink:  ../4DAC7205.8080203@kemen.it/
Also on:    postgresql.org/message-id/4DAC7205.8080203@kemen.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: rudi.pettazzi@kemen.it
  Subject: Re: Streaming replication: rsync to switchover
  In-Reply-To: <4DAC7205.8080203@kemen.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox