pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rudi <rudolone@gmail.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Streaming replication: rsync to switchover
Date: Wed, 20 Apr 2011 10:57:48 +0200
Message-ID: <4DAEA00C.2040807@gmail.com> (raw)
In-Reply-To: <4DAE98A3.3090002@gmail.com>
References: <4DAC7205.8080203@kemen.it>
	<BANLkTikrqROJjNiVpmkZorkPM7nUYHZUAw@mail.gmail.com>
	<4DAD52D8.1090006@gmail.com>
	<20110419121105.GA17761@cns.vt.edu>
	<4DADAA5C.6040107@gmail.com>
	<4DAE98A3.3090002@gmail.com>

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 previous attempt. I 
tried this procedure and now the former master acts as a hot standby as 
expected:

On the former master:

a) stop
b) cleanup pg_xlog
c) set archive_mode = off and hot_standby = on in postgresql.conf

On the former slave:

a) set archive_mode = on in postgresql.conf
b) psql -c "SELECT pg_start_backup('switchover base backup')"
c) rsync -av $PGDATA --delete --exclude server.crt --exclude server.key 
--exclude recovery.* --exclude postmaster.pid --exclude pg_xlog 
--exclude archive $SLAVE:$PGDATA
d) psql -c "SELECT pg_stop_backup()"

Finally I started the former master.

-- 
rd

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



view thread (8+ messages)

Message-ID: <4DAEA00C.2040807@gmail.com>
Permalink:  ../4DAEA00C.2040807@gmail.com/
Also on:    postgresql.org/message-id/4DAEA00C.2040807@gmail.com

 · 

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: rudolone@gmail.com
  Subject: Re: Streaming replication: rsync to switchover
  In-Reply-To: <4DAEA00C.2040807@gmail.com>

* 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