How to elect a master node among the nodes running in a cluster?

Leader election algorithms typically consider the split brain as a fault case to support. If you assume that it’s not the nodes that fail but the networking, you may run into the case where all nodes are up, but fail to talk to each other. Then, you may end up with two masters.

If you can exclude “split brain” from your fault model (i.e. if you consider only node failures), your algorithm (leader is the one with the smallest address) is fine.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)