mysqlfailovermulti-master-replication

Master Master Replication with keepalived for failover & consistency


I am wanting to setup master-master replication using MySQL for Failover purposes. However, I don't want data being accessed from both masters so I can mitigate the risks of master-master replication. I have a keepalived setup for web server load balancing & failover purposes already. Does it seem reasonable that I could have keepalived always pointing to Master A and only use Master B in the event Master A is down, i.e. Master B is a backup? Does anyone have ideas for a better setup?

I am not concerned with speed as much as zero downtime. Any thoughts on this would be much appreciated.


Solution

  • Your idea is fine, because then all database clients will get consistent results without risks of replication delays. When the main node would go down, all clients will again receive consistent result (in the worst case of big replication delays they will see slightly different data, but still, it will be consistent).