Question

default my domain fetch data from slave server but when it is down it automatically starts fetching database from master server.

I have configured mysql master-slave replication in centos 7, and I want to use this in such a way that by default my domain fetch data from slave server but when it is down it automatically starts fetching database from master server.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

You would need either load balancer or logic built into your application in order to load balance the connections to the different replicas.

If you decide to use a load balancer, you could have a look at one of the following:

  • ProxySQL

  • MariaDB MaxScale

  • HAProxy

  • DigitalOcean managed load balancer

Hope that this helps! Regards, Bobby