简体   繁体   English

动物园管理员如何在新连接的动物园管理员群集中选择其主人?

[英]How zookeepers select its master in freshly connected zookeeper cluster?

Just started to study zookeeper architecture and its communication with the hbase 刚开始研究Zookeeper架构及其与hbase的通信

I have some doubt in leader election of zookeeper cluster 我对动物园管理员集群的领导者选举有疑问

As far as i learned zookeepers will select its master using transaction id but when we freshly connect the zookeeper cluster all zookeeper's transaction id will be zero now how it will select its leader..... 据我了解,动物园管理员将使用交易ID选择其主人,但是当我们新连接动物园管理员集群时,所有动物园管理员的交易ID将为零,现在它将如何选择其领导者.....

Can any one please explain in detail..... 谁能详细解释一下.....

Thanks in advance 提前致谢

There are several metrics zookeeper will take into consideration while in an election, like epoch / zxid / id , which you can verify from the implementation of FastLeaderElection.totalOrderPredicate . 在选举中,zookeeper将考虑多个指标,例如epoch / zxid / id ,您可以从FastLeaderElection.totalOrderPredicate的实现中进行FastLeaderElection.totalOrderPredicate

To answer your question, if all your zk nodes start at the same time in a freshly cluster, the one with the biggest id (which is specified by you in the file myid ) will be elected as the leader. 要回答您的问题,如果所有zk节点同时在一个新群集中启动,则将选择具有最大id(由您在myid文件中myid )的id作为领导者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM