Report this

What is the reason for this report?

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

Posted on August 22, 2019

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.



This textbox defaults to using Markdown to format your 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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.