1

I have set up a hot standby in PostgreSQL 9.0 on Windows.

I want that, at the time of fail-over, the slave should take over the role of master and start performing operations (both read and write) automatically.

How can I do that?

Mat
  • 10,079
  • 4
  • 42
  • 40
Sunil Kumar
  • 151
  • 1
  • 3
  • These are some prior and somewhat related questions from the same user: http://dba.stackexchange.com/q/27868/7788 and http://dba.stackexchange.com/q/27121/7788 . Answers to the 2nd have a fair bit of detail, so that'll save some repetition. – Craig Ringer Nov 01 '12 at 08:41

1 Answers1

1

I would start looking at repmgr from 2ndQuadrant. It is an open source replication management framework for PostgreSQL and takes care of things like failovers.

Otherwise you need to make sure the other node is dead (shoot the other node in the head), then remove the recovery.conf and restart. Note that at this point you will have irrevocably failed over and you cannot fail back until you set up the former master as a slave to the new master and then fail over again.

Chris Travers
  • 13,042
  • 50
  • 95