0

I have a Master-Master MySQL Setup (5.6) with an additional Slave attached to Master 1:

Master 1 (alive) <---> Master 2 (alive)
   |
Slave 1

Now when Master 1 dies, i want the Slave to automatically switch to the other Master and receive updates from there:

Master 1 (DEAD) <---> Master 2 (alive)
                         |
                      Slave 1

Is there any tool that handles this for me?

I believe this HA Failover scenario is not very uncommon, but unfortunately I could not find any tool to automate this.

Kaii
  • 755
  • 1
  • 6
  • 17

1 Answers1

1

HAproxy does a great job with this kind of stuff. I'd suggest moving to Percona though, if that's an option, and using a Xtradb cluster. Percona uses mysql. http://www.haproxy.org/ http://www.percona.com/

HAProxy is very easy to set up and use, also gives visibility as to which node is answering, primary, etc, based on what it sees and your config.

Craig
  • 585
  • 2
  • 13
  • HAProxy is a loadbalancer and yes, it would move the TCP connections to the other master. But it is totally unaware of the MySQL binary log - so i would expect this to fail. any other suggestions? – Kaii Nov 25 '14 at 16:22
  • note: i don't want a client to connect to another node. i wan't a *mysql slave* to connect to another master, which requires more logic and involves correctly handling binary log positions. – Kaii Nov 25 '14 at 16:23
  • Again, I suggest moving to Xtradb cluster, I used multiple slaves for some time and it can be problematic. I never found a way other than manually failing it over, not that was reliable anyway. – Craig Nov 25 '14 at 16:24