makhshif afiniti
makhshif afiniti

Reputation: 55

Possibility of changing IP of a node after failover/switchover

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?

Upvotes: 0

Views: 573

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247625

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.

Upvotes: 1

Related Questions