Description:
Consider a system with master node of mySQL (node 1 - IP1) and another node with slave mySQL (node 2 and IP2). There is also a 3rd system with slave (node3 and IP3). Both the node 2 and node 3 have slave copies and connected to same master - node 1.
The system is so confgured that the node3 would always be the slave node and node 1 and node2 can interchange the roles of master and standby. For this the requirement is that the node3 should be trasparent of the change in master node. So the solution we thought is to have the master always binding on floating IP (IP4). This IP is either attached to node 1 or node 2 depending on which is the master node.
So the node 3 always interfaces with IP4 irrespective of whether node1 is master or node 2is master.
Now for this solution, we require that the node 1 first binds on IP4 (rather than IP1) so that node3 is able to connect to this. Since the IP4 is attached to node1, node 2 mySQL needs to attach to IP2 to interface with node1 (with destination IP as IP4).
As soon as node1 goes down, node 2 takes over the master role. It also attaches and activates IP4 on this system. Since we would like node3 to be transparent of this change, we would like node 2 mySQL to bind to IP4 now (earlier it was bound to IP2).
We would like to get a solution for the above so that node 2 which is originally bound to IP2, should shift to IP4 without restarting the mySQL daemon.
For this we were looking for any one of the following options through mySQL.
a) At runtime change the IP address in my.cfg file and trigger through some API (we wanted to know which could be appropritate API for the same) trigger mySQL to re-bind to the new IP address without restarting the database (in-memory data base is being used).
b) At init time itself, request mySQL to bind to both the IP1/IP2 and IP4. (Note that there are other IPs also on system, which we donot want mySQL to use).
Please let us know a solution for the above.
Regards,
Renuka
How to repeat:
Please let us know a solution for the above.