0

I have 2 servers running postgresql database as Master-slave. Application connects to master normally and when the switchover occurs, we need to change IP in application to connect to slave. In one of our use cases, we require that in switchover the IP of slave should be changed to the IP of master node. Is there anything which can help me in this case?

1 Answers1

1

You typically use a virtual IP address for that; the details depend on your operating system.

PostgreSQL always listens on the virtual IP address, and on failover you move the address to the other machine.

Laurenz Albe
  • 129,316
  • 15
  • 96
  • 132