Possibility of changing IP of a node after failover/switchover

403 Views Asked by At

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

There are 1 best solutions below

2
Laurenz Albe On

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.