Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I would like to know what is the way to switch the role of 2 servers when using warm standby?

I have 2 servers : S_1 and S_2, and at a time T, S_1 is the master server and S_2 is a warm standby with streaming replication.

At a later moment, I would like to switch S_2 become the master server and S_1 the warm standby.

What do I have to do to switch roles ?

share|improve this question
    
a warm standby or a hot standby? In Postgres, "warm standby" is usually used to refer to a second server which is keeping up to date, but not accepting connections. –  Josh Berkus Dec 3 '12 at 23:36
    
Yes, the second server is a warm standby, and I like to know what steps are needed to switch master and warm standby mode. –  iXô Dec 4 '12 at 13:04
add comment

1 Answer

Keep in mind that currently you cannot demote a master to a standby. Doing so will corrupt your database!

The basic documentation for doing this is at: http://www.postgresql.org/docs/9.1/static/warm-standby-failover.html

However the basic thing is you can't switch these other than:

  1. Turn off primary

  2. Promote secondary

  3. Rebuild former primary as new secondary off the new primary.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.