Election logic (RBULLY algorithm)

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_43356218/article/details/102766893

Election logic (RBULLY algorithm)

1.连接协调器,获取当前集群的所有状态,包括master选举相关状态
2.判断当前集群的activeMaster是否为空
   如果不为空,选举结束,跳到第五步(老大已经选完)
   如果为空,进入第三步
3.将所有master作为候选人添加到cadidateMaster中
4.判断cadidate是否满足最小master数量
   如果不满足,跳到第一步重新选举
   如果满足,直接从候选人中找id最小的放入activeMaster中
5.选举完成

Guess you like

Origin blog.csdn.net/weixin_43356218/article/details/102766893