pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPoint in time recovery + replication
5+ messages / 4 participants
[nested] [flat]
* Point in time recovery + replication
@ 2013-05-09 15:45 German Becker <german.becker@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: German Becker @ 2013-05-09 15:45 UTC (permalink / raw)
To: pgsql-admin
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?
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Point in time recovery + replication
@ 2013-05-10 07:25 Viktor <viktor@okservers.eu>
parent: German Becker <german.becker@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Viktor @ 2013-05-10 07:25 UTC (permalink / raw)
To: pgsql-admin
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_Debia...
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?
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Point in time recovery + replication
@ 2013-05-10 12:39 German Becker <german.becker@gmail.com>
parent: Viktor <viktor@okservers.eu>
0 siblings, 0 replies; 5+ messages in thread
From: German Becker @ 2013-05-10 12:39 UTC (permalink / raw)
To: Viktor <viktor@okservers.eu>; +Cc: 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_Debia...
>
> 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?
>
>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Point in time recovery + replication
@ 2013-05-13 14:05 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
parent: German Becker <german.becker@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Gabriele Bartolini @ 2013-05-13 14:05 UTC (permalink / raw)
To: German Becker <german.becker@gmail.com>; +Cc: pgsql-admin
Hi German,
Il 09/05/13 17:45, German Becker ha scritto:
> Do I need to get a new copy of the primary to continue the replication?
Yes. At that point, it is a completely different server with its own new
life. :)
Ciao,
Gabriele
--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Point in time recovery + replication
@ 2013-05-14 04:47 prakhar jauhari <prak840@gmail.com>
parent: Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
0 siblings, 0 replies; 5+ messages in thread
From: prakhar jauhari @ 2013-05-14 04:47 UTC (permalink / raw)
To: Gabriele Bartolini <gabriele.bartolini@2ndquadrant.it>; +Cc: German Becker <german.becker@gmail.com>; pgsql-admin
Hi all,
I have been trying to setup Postgres 9.2 in HA using streaming replication
and base backup.
There is no problem in switching from:
Standby -> Master using the trigger file mechanism provided by postgres.
The problem comes when switching from:
Master -> Stanbdy : I try to set up Streaming replication from the new
standby to the new Master,
but replication doesn't start, rather i find the following error in
postgres logs
"FATAL: timeline 2 of the primary does not match recovery target timeline
1".
Is there any way the timeline can be bumped up to the correct number on the
new standby, without taking
base backup. And is it safe to use the method described in
http://michael.otacoo.com/postgresql-2/postgres-9-3-feature-highlight-timeline-switch-of-slave-node-...
to bump up the timeline.
regards,
Prakhar
On Mon, May 13, 2013 at 7:35 PM, Gabriele Bartolini <
gabriele.bartolini@2ndquadrant.it> wrote:
> Hi German,
>
> Il 09/05/13 17:45, German Becker ha scritto:
> > Do I need to get a new copy of the primary to continue the replication?
> Yes. At that point, it is a completely different server with its own new
> life. :)
>
> Ciao,
> Gabriele
>
> --
> Gabriele Bartolini - 2ndQuadrant Italia
> PostgreSQL Training, Services and Support
> gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it
>
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2013-05-14 04:47 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-05-09 15:45 Point in time recovery + replication German Becker <german.becker@gmail.com>
2013-05-10 07:25 ` Viktor <viktor@okservers.eu>
2013-05-10 12:39 ` German Becker <german.becker@gmail.com>
2013-05-13 14:05 ` Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
2013-05-14 04:47 ` prakhar jauhari <prak840@gmail.com>
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