zookeeper中的命令是什么使zookeeper的领导者自愿成为集群中的跟随者?

2024-05-14 08:52:55 发布

您现在位置:Python中文网/ 问答频道 /正文

关于动物园管理员我有四个问题。请在这方面提出你的意见。在

  1. 动物园管理员的命令是什么让一个领导者自愿变成一个 簇内的跟随者,这反过来又会产生另一个跟随者 集群中的机器接管一个领导者?

  2. zookeeper在组团内进行选举以形成一个领导者的程序是什么?

  3. 在zookeeper中检查集群状态的命令是什么,反过来我可以说,zookeeper中是否有命令表明zookeeper的集群状态是健康的,并且zookeeper的集群成功形成了?


Tags: 命令程序机器状态管理员集群zookeeper意见
1条回答
网友
1楼 · 发布于 2024-05-14 08:52:55

问题1)动物园管理员领导下台-好问题,除了关闭领队然后把它带回来,我不确定有什么命令可以这样做。在

问题2)领导人选举:在此讨论:

Leader Activation Leader activation includes leader election. We currently have two leader election algorithms in ZooKeeper: LeaderElection and FastLeaderElection (AuthFastLeaderElection is a variant of FastLeaderElection that uses UDP and allows servers to perform a simple form of authentication to avoid IP spoofing). ZooKeeper messaging doesn't care about the exact method of electing a leader has long as the following holds:

The leader has seen the highest zxid of all the followers. A quorum of servers have committed to following the leader. Of these two requirements only the first, the highest zxid amoung the followers needs to hold for correct operation. The second requirement, a quorum of followers, just needs to hold with high probability. We are going to recheck the second requirement, so if a failure happens during or after the leader election and quorum is lost, we will recover by abandoning leader activation and running another election.

After leader election a single server will be designated as a leader and start waiting for followers to connect. The rest of the servers will try to connect to the leader. The leader will sync up with followers by sending any proposals they are missing, or if a follower is missing too many proposals, it will send a full snapshot of the state to the follower.

http://zookeeper.apache.org/doc/r3.3.2/zookeeperInternals.html#sc_leaderElection

问题3)检查群集状态-您可以尝试在客户端端口发出4个字母的命令之一,如下所示:

echo ruok | nc 127.0.0.1 5111

如果一切顺利的话,它会回应伊莫克。在

命令的完整列表:https://zookeeper.apache.org/doc/r3.4.8/zookeeperAdmin.html#sc_zkCommands

或者运行JMX:http://zookeeper.apache.org/doc/r3.3.1/zookeeperJMX.html

相关问题 更多 >

    热门问题