Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-20 Thread rudi
On 04/20/2011 10:26 AM, rudi wrote: Database cluster state: in archive recovery and doesn't accept connections: 2011-04-20 10:17:00 CEST:[local]:u@postgres:[13099] FATAL: the database system is starting up even if is a hot standby. My fault: it seems I forgot to stop the backup in my previou

Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-20 Thread rudi
On 04/19/2011 05:29 PM, rudi wrote: $ 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/

Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-19 Thread rudi
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 fo

Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-19 Thread Ray Stell
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 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.

Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-19 Thread Gerhard Hintermayer
I also streaming replication _and_ ship WALs them to the slaves, something like: restore_command='rsync -pog master::postgresql-wals/%f %p', so normally the slaves are up to date (via streaming replication) and the WALs are also on the slaves to be able to recover (maybe to some PIT) from them in c

Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-19 Thread rudi
On 04/19/2011 10:09 AM, Gerhard Hintermayer wrote: assuming you have configured rsyncd on the server as: [postgresql-data] uid = postgres path = /var/lib/postgresql/9.0/data comment = PostgreSQL 9.0 data dir exclude = postmaster.log pg_xlog/* postmaster.pid postgresql.conf

Re: [ADMIN] Streaming replication: rsync to switchover

2011-04-19 Thread Gerhard Hintermayer
Hi, I do rsync -a --delete new_primary_server::postgresql-data/ /var/lib/postgresql/9.0/data/ Take care to use -a, I had -r and wondered, why the rsync took so long, despite the data was nearly the same. assuming you have configured rsyncd on the server as: [postgresql-data] uid = postgres

[ADMIN] Streaming replication: rsync to switchover

2011-04-19 Thread rd
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.