Search code examples
mysqlmariadbgalera

Can I have a HA MySQL/MariaDB Slave?


Weird question I know. I have a master MySQL database which I'm not allowed to touch and need to build a slave for. I would like the slave to be as real time (as possible) of a replica of the master and would like the slave to be HA.

Does MySQL (or MariaDB) replication work when run on a cluster, say, can I make a Galera cluster and make it replicate from a master out of the box or must I use binlog-esque tools?

For the curious; this new slave cluster will be on a different network and will have many large, important queries made against it regularly - the aim of the game is to reduce load on the master and reduce network traffic.


Solution

  • If you are not planning on doing modifications to the downstream slave server, then you can just set up multiple slave servers. This way if one of the slaves goes down you can use another one. This will place a small load on the master for each added slave but whether this added load is even measurable depends on your setup.

    Galera could work but I believe you would have to reconfigure one of the nodes to act as the slave if the current one goes down. This would place a minimal load on the master but it would require a manual intervention whenever the current "slave" node goes down.

    Parallel replication should also help speed up replication for MariaDB servers.