In my case I have two MySQL servers. One is master and second one is slave.
When slave is not available, my application can read and write from/to master.
When master is not available, assume there is a tool mysqlfailover
which successfully nominates a new master (from slave).
It sounds good, but application has master hostname inside the configuration. So it fails to find it.
What are available options to solve this problem? How application can be switched to a new master?
I know that I can switch hostname to point to the new IP, use Kubernetes (StatefulSet) + DB in a container, but anything else as free option on bare metal?
If speaking broadly, how this problem is solved using HA/failover tools?
Thank you