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

August 22, 2019 136 views
Databases CentOS MySQL

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.

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

Have another answer? Share your knowledge.