How to elect a master node among the nodes running in a cluster?
问题 I'm writing a managed cloud stack (on top of hardware-level cloud providers like EC2), and a problem I will face soon is: How do several identical nodes decide which one of them becomes a master? (I.e. think of 5 servers running on EC2. One of them has to become a master, and other ones have to become slaves.) I read a description of the algorithm used by MongoDB, and it seems pretty complicated, and also depends on a concept of votes — i.e. two nodes left alone won't be able to decide