Re: Point in time recovery + replication - Mailing list pgsql-admin

From German Becker
Subject Re: Point in time recovery + replication
Date
Msg-id CALyjCLvC+yYoCqytfLtN=_GHGjZ5G+5Hq2FO=MJwusHh_49nHA@mail.gmail.com
Whole thread Raw
In response to Re: Point in time recovery + replication  (Viktor <viktor@okservers.eu>)
List pgsql-admin
Hi Viktor,
Yes that is the usual procdure I use. The question was, since the primary is starting from a backup and then "diverting" to a new timeline, if there was a way to make the secondary start from the same backup and then follow the primary. I'm gessing the answer is no....


On Fri, May 10, 2013 at 4:25 AM, Viktor <viktor@okservers.eu> wrote:
Hei,

I think, that it can be done just via RSYNC with stopped both of databases:

http://www.debian-administration.org/article/How_to_setup_Postgresql_9.1_Streaming_Replication_Debian_Squeeze

Just like in the "Getting it working" part.



On 5/9/2013 6:45 PM, German Becker wrote:
Hello Everyone,

I have a primary  / hot standby scenario with streaming replication. Postgres version is 9.1.8. 

A full backup is made nightly on the primary and copied to the secondary, just for backup purposes, the replication is never stopped /restarted.

Supose that for a reason I need to restore the primary to a point in time, let's say just after the last backup. I've done this by:

1) stoping de databese
2)restoring the backup
3) creatng a recovery.conf where I specified a recovery_target accordingly
4) start the database

This works fine on the primary. The quesion is how do I restart the replication on the secondary, on the new timeline?

I tried to restore the same backup on the secondary and starting the continuous recovery, but it starts on the previous timeline.
I also tried to set the recovery_target_timeline in the secondary to the new timeline, but I get an error. Do I need to get a new copy of the primary to continue the replication?


pgsql-admin by date:

Previous
From: Viktor
Date:
Subject: Re: Point in time recovery + replication
Next
From: Craig James
Date:
Subject: Re: Sr. Postgres DBA