pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Recover from failover
5+ messages / 4 participants
[nested] [flat]

* Recover from failover
@ 2011-12-05 20:22 Martin S <martins.listz@gmail.com>
  2011-12-05 21:24 ` Re: Recover from failover Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2011-12-06 02:41 ` Re: Recover from failover Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 2 replies; 5+ messages in thread

From: Martin S @ 2011-12-05 20:22 UTC (permalink / raw)
  To: pgsql-admin

Hello list,

May be this information is inside the documentation, but couldn't find it.

I'm doing some tests with postgres 9.1.1 and replication, and I was
wandering if there is some information about how to recover from a
failover.

Suppose I'm doing some kernel upgrades on the master, so in order to
avoid downtime, I promote the slave to become the master, and reboot
the old-master. Once the old-master is up and running again, I want it
to be the master as it was before. The problem are the updates and
inserts made while it was offline. Does it recovers automagically by
streaming or something? Do you have any procedures/recommendations to
do it?


Cheers,

Martin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Recover from failover
  2011-12-05 20:22 Recover from failover Martin S <martins.listz@gmail.com>
@ 2011-12-05 21:24 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  1 sibling, 0 replies; 5+ messages in thread

From: Kevin Grittner @ 2011-12-05 21:24 UTC (permalink / raw)
  To: Martin S <martins.listz@gmail.com>; pgsql-admin

Martin S <martins.listz@gmail.com> wrote:
 
> May be this information is inside the documentation, but couldn't
> find it.
> 
> I'm doing some tests with postgres 9.1.1 and replication, and I
> was wandering if there is some information about how to recover
> from a failover.
 
Does this page provide what you need?:
 
http://www.postgresql.org/docs/9.1/interactive/warm-standby-failover.html
 
-Kevin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Recover from failover
  2011-12-05 20:22 Recover from failover Martin S <martins.listz@gmail.com>
@ 2011-12-06 02:41 ` Jerry Sievers <gsievers19@comcast.net>
  2011-12-06 02:58   ` Re: Recover from failover white.heron white <white.heron@yahoo.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Jerry Sievers @ 2011-12-06 02:41 UTC (permalink / raw)
  To: Martin S <martins.listz@gmail.com>; +Cc: pgsql-admin

Martin S <martins.listz@gmail.com> writes:

> Hello list,
>
> May be this information is inside the documentation, but couldn't find it.
>
> I'm doing some tests with postgres 9.1.1 and replication, and I was
> wandering if there is some information about how to recover from a
> failover.
>
> Suppose I'm doing some kernel upgrades on the master, so in order to
> avoid downtime, I promote the slave to become the master, and reboot
> the old-master. Once the old-master is up and running again, I want it
> to be the master as it was before. The problem are the updates and
> inserts made while it was offline. Does it recovers automagically by
> streaming or something? Do you have any procedures/recommendations to
> do it?

About the only way you can role reverse master and standby is to stop
immediate the master, online the standby and then config the old
master as a standby and point it to the new master. 

Doing a normal stop on the original master before onlining the
standby, then making changes to the old master DB and you'll have to
refresh the old master from a base backup before putting it into
recovery.

Most admins will tell you to refresh the old master in either case to
be on the safe side.  This is the conventional and guaranteed to work
approach.

HTH

> Cheers,
>
> Martin
>
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 305.321.1144



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Recover from failover
  2011-12-05 20:22 Recover from failover Martin S <martins.listz@gmail.com>
  2011-12-06 02:41 ` Re: Recover from failover Jerry Sievers <gsievers19@comcast.net>
@ 2011-12-06 02:58   ` white.heron white <white.heron@yahoo.com>
  2011-12-06 15:38     ` Re: Recover from failover Martin S <martins.listz@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: white.heron white @ 2011-12-06 02:58 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; Martin S <martins.listz@gmail.com>; +Cc: pgsql-admin

Dear All,

As soon as the slave database server had been promoted to master. The old-server master database should be promote to become slave server.
I believe database replication has been done by your vendor. In this case the new master database server will replicate data with new slave database server.
Once replication completed. You may unplug the new slave database server and perform kernel operating system upgrade as standalone.

 
Regards,


MOHAMMAD ADLI BIN MT TAJUDIN


H/p number:  (017) 362 3661
Email: white.heron@yahoo.com


________________________________
 From: Jerry Sievers <gsievers19@comcast.net>
To: Martin S <martins.listz@gmail.com> 
Cc: pgsql-admin@postgresql.org 
Sent: Tuesday, December 6, 2011 10:41 AM
Subject: Re: [ADMIN] Recover from failover
 
Martin S <martins.listz@gmail.com> writes:

> Hello list,
>
> May be this information is inside the documentation, but couldn't find it.
>
> I'm doing some tests with postgres 9.1.1 and replication, and I was
> wandering if there is some information about how to recover from a
> failover.
>
> Suppose I'm doing some kernel upgrades on the master, so in order to
> avoid downtime, I promote the slave to become the master, and reboot
> the old-master. Once the old-master is up and running again, I want it
> to be the master as it was before. The problem are the updates and
> inserts made while it was offline. Does it recovers automagically by
> streaming or something? Do you have any procedures/recommendations to
> do it?

About the only way you can role reverse master and standby is to stop
immediate the master, online the standby and then config the old
master as a standby and point it to the new master. 

Doing a normal stop on the original master before onlining the
standby, then making changes to the old master DB and you'll have to
refresh the old master from a base backup before putting it into
recovery.

Most admins will tell you to refresh the old master in either case to
be on the safe side.  This is the conventional and guaranteed to work
approach.

HTH

> Cheers,
>
> Martin
>
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 305.321.1144

-- 
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: Recover from failover
  2011-12-05 20:22 Recover from failover Martin S <martins.listz@gmail.com>
  2011-12-06 02:41 ` Re: Recover from failover Jerry Sievers <gsievers19@comcast.net>
  2011-12-06 02:58   ` Re: Recover from failover white.heron white <white.heron@yahoo.com>
@ 2011-12-06 15:38     ` Martin S <martins.listz@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Martin S @ 2011-12-06 15:38 UTC (permalink / raw)
  To: white.heron white <white.heron@yahoo.com>; +Cc: pgsql-admin

On Mon, Dec 5, 2011 at 11:58 PM, white.heron white
<white.heron@yahoo.com> wrote:
> Dear All,
>
> As soon as the slave database server had been promoted to master. The
> old-server master database should be promote to become slave server.
> I believe database replication has been done by your vendor. In this case
> the new master database server will replicate data with new slave database
> server.
> Once replication completed. You may unplug the new slave database server and
> perform kernel operating system upgrade as standalone.
>
>
> Regards,
>
> MOHAMMAD ADLI BIN MT TAJUDIN
>
> H/p number:  (017) 362 3661
> Email: white.heron@yahoo.com


Thanks for the replies guys.

I like your approach Jerry. Promoting the slave and configuring the
master to be slave before going down, so when ex-master comes up, it
gets updated.
Problem here seems to be changing configs for maintenance. One error
and you are screwed. Probably creating some script to make it more
automatic or something could be a good idea.


Cheers!

Martin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2011-12-06 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-05 20:22 Recover from failover Martin S <martins.listz@gmail.com>
2011-12-05 21:24 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2011-12-06 02:41 ` Jerry Sievers <gsievers19@comcast.net>
2011-12-06 02:58   ` white.heron white <white.heron@yahoo.com>
2011-12-06 15:38     ` Martin S <martins.listz@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