Elasticsearch elections


 A, bully algorithm
  through the following steps
    1. Start node ping coordinator, to get the current state of the cluster (node information, the cluster name, etc.), if the coordinator does not start up until the ping
    2. Whether can ping will get Master active objects activeMaster
    3. activeMaster determination of the number, 0 indicates no current Master cluster, cluster 1 represents the current election has completed.
    4. If the end of 1, the current node starts Bully logic algorithm; if it is 0, go to step 5 (total will stop here)
    5. found no active master startup, the master node of the cluster into all of the candidate in the candidate list. shortlist master less than the minimum number, smaller than the minimum number of master.
    6. the master If the candidate is greater than equal to minimum number, wherein the election from a minimum value of the node id into the activeMaster, tentatively master, master back to the first step is less than the minimum.
 two, downtime master logic
    in the cluster, the change in any node, will cause all who recorded candidate / activeMaster change
    ○ activeMaster change (1-0), the master node goes down
    re-election
    ○ candidate changes now Normal labor master, there are other alternatives down phenomenon;
  minimum number of re-determination of the cluster (activeMaster + candidate number> = minimum master)

Guess you like

Origin www.cnblogs.com/hi-zhixian/p/11569674.html