Question

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

Posted August 22, 2019 470 views
CentOSMySQLDatabases

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.

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.

×
1 answer

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

Submit an Answer