pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Phil Monroe <phil@identified.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: pgsql-admin@postgresql.org, Infrastructure <infrastructure@identified.com>
Cc: Vladimir Giverts <vlad@identified.com>
Cc: Tejas <tejas@identified.com>
Cc: Sasha Kipervarg <sasha@identified.com>
Subject: Re: Postgres WAL Recovery Fails... And Then Works...
Date: Tue, 15 Jan 2013 11:54:49 -0800
Message-ID: <50F5B409.9000508@identified.com> (raw)
In-Reply-To: <50F534C6.4000501@vmware.com>
References: <50F0CB3E.4080708@identified.com>
	<50F534C6.4000501@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Sorry, Initial response got blocked since I replied with the logs quoted 
again.

>
>
> Also, which version of postgres are you using?



PostgreSQL 9.2.1 on Ubuntu 12.04

>
>
>
> Except in my case no number of restarts helped. You didn't say, were
> you explicitly copying $PGDATA or using some other mechanism to
> migrate the data elsewhere?




So we have a very large database (~5TB), so we use a script to do 
parallel rsyncs to copy the data directory 
(https://gist.github.com/4477190/#file-pmrcp-rb). The whole copy process 
ended up taking ~3.5 hours. So we did a physical copy of $PGDATA (which 
is located at /var/lib/postgresql/9.2/main/ on both machines.). We 
followed the following process to do this:

1. Master archives WAL files to Backup Host.
2. Execute on Master: psql -c "select pg_start_backup('DATE-slave-restore')"
3. Execute on Master: RCP='rsync -cav --inplace -e rsh' 
EXCLUDE='pg_xlog' pmrcp /var/lib/postgresql/9.2/main/ 
prd-db-01:/var/lib/postgresql/9.2/main/ > /tmp/backup.log
4. Execute on Master: psql -c "select pg_stop_backup()"
5. On Slave, setup recovery.conf to read WAL archive on Backup Host
6. Execute on Slave: pg_ctlcluster 9.2 main start (as described in 
initial email)


Best,
Phil

Heikki Linnakangas wrote:
>
> Sorry, Initial response got blocked since I replied with the logs
> quoted again.
>
>>
>>
>> Also, which version of postgres are you using?
>
>
>
> PostgreSQL 9.2.1 on Ubuntu 12.04
>
>>
>>
>>
>> Except in my case no number of restarts helped. You didn't say, were
>> you explicitly copying $PGDATA or using some other mechanism to
>> migrate the data elsewhere?
>
>
>
>
> So we have a very large database (~5TB), so we use a script to do
> parallel rsyncs to copy the data directory
> (https://gist.github.com/4477190/#file-pmrcp-rb). The whole copy
> process ended up taking ~3.5 hours. So we did a physical copy of
> $PGDATA (which is located at /var/lib/postgresql/9.2/main/ on both
> machines.). We followed the following process to do this:
>
> 1. Master archives WAL files to Backup Host.
> 2. Execute on Master: psql -c "select
> pg_start_backup('DATE-slave-restore')"
> 3. Execute on Master: RCP='rsync -cav --inplace -e rsh'
> EXCLUDE='pg_xlog' pmrcp /var/lib/postgresql/9.2/main/
> prd-db-01:/var/lib/postgresql/9.2/main/ > /tmp/backup.log
> 4. Execute on Master: psql -c "select pg_stop_backup()"
> 5. On Slave, setup recovery.conf to read WAL archive on Backup Host
> 6. Execute on Slave: pg_ctlcluster 9.2 main start (as described in
> initial email)
>
>
> Best,
> Phil

view thread (8+ messages)

Message-ID: <50F5B409.9000508@identified.com>
Permalink:  ../50F5B409.9000508@identified.com/
Also on:    postgresql.org/message-id/50F5B409.9000508@identified.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: phil@identified.com, hlinnakangas@vmware.com, infrastructure@identified.com, vlad@identified.com, tejas@identified.com, sasha@identified.com
  Subject: Re: Postgres WAL Recovery Fails... And Then Works...
  In-Reply-To: <50F5B409.9000508@identified.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