2

I'm kind of lost there, I want to setup a common MASTER/SLAVE replication on a MariaDB database. I choose MASTER/SLAVE over MASTER/MASTER to avoid complexifying things. The SLAVE will be used only if the MASTER server is down.

I've setup MariaDB 10.0.x, but when I start reading on how to achieve this replication, they introduce Galera, which, if I understand correctly, replaces MariaDB.

What do you use to tell the SLAVE server to take the relay if the MASTER server is down ? Is it handled automatically via the Galera Cluster ?

If possible, I don't want my application to be aware of the slave server : I just want to configure it with the IP of MariaDB MASTER, and if it can't be reached, to use the SLAVE instead. (But I do not want to specify this fallback in the application level)

Thanks

sf_tristanb
  • 8,725
  • 17
  • 74
  • 118
  • You are talking about two different things. Master / Slave replication is used to spread load over several servers or allow replication of data to a local office for faster reads. The master handles all the updates the slaves are used read only. It sounds like you are looking for a "fail over" solution, which replication doesn't handle well. Galera is a server clustering solution in which all nodes are masters and which handles failures better. You can use replication, but failover needs to be done by manual reconfiguration. – Jaydee Aug 01 '14 at 09:27
  • Yeah it seems i'm mixing up things. Firstly, Galera can't do master/slave replication? And what do you mean by manual reconfiguration ? Do you mean that I have to manually take action when the master is not reachable ? – sf_tristanb Aug 01 '14 at 09:36
  • 1
    Galera updates all the nodes (masters) at the same time, so yes in a sense it does replication, but not master slave replication. With MariaDB / MySQL replication all updates are done on the single master which then pushes updates out to the slaves. If the master fails, you need to manually change one of the slaves to being the master and then point the other slaves at it. Read this http://www.severalnines.com/clustercontrol-mysql-galera-tutorial#differences – Jaydee Aug 01 '14 at 09:43

1 Answers1

1

What you are looking for can be achieved. I just completed a setup of MariaDB 10 using asynchronous replication (not Galera). To ensure maximum uptime I setup master / master replication and used mysql-mmm to monitor the setup. This tool will manage a virtual IP and point it at one of the two masters for writing purposes. This ensures consistent writes against a single master as to avoid corruption of the data. If one master fails the virtual IP will be mapped to the other master. This provides the high availability aspect. The instructions stated below were very clear and easy to follow.

http://mysql-mmm.org/mmm2:guide

Good luck!

mohr_michael_a
  • 204
  • 1
  • 3