I want to set Master - Master replication in MySQL using HAproxy as Load Balancer. Using backup option for Master 2 helps to route traffic to Master 2 only when Master 1 is down, but as soon as Master 1 comes up, traffic is automatically routed to Master 1; it does not wait for the replication to complete. Need help on the configuration.
Found a link as below but not sure on how to set the peers and will it be helpful for MySQL. Looking for a working solution.
https://www.haproxy.com/blog/emulating-activepassing-application-clustering-with-haproxy/