gpt4 book ai didi

apache-zookeeper - 如何验证Zookeeper仲裁

转载 作者:行者123 更新时间:2023-12-03 15:30:17 25 4
gpt4 key购买 nike

如何验证Zookeeper中的所有节点均是仲裁的一部分并且状态良好? Manual谈论“ruok”,但是仍然没有说出zookeeper节点是否是仲裁的一部分,并且是否与其余节点保持同步。

最佳答案

您可以使用The Four Letter Words中记录的srvr命令来获取有关集合中每个ZooKeeper服务器的更详细的状态信息。请参阅下面的3节点群集的示例输出,这些群集的主机名为ubuntu1,ubuntu2和ubuntu3。

模式字段将告诉您该特定服务器是领导者还是跟随者。 Zxid字段是指ZooKeeper群集的内部事务ID,用于跟踪对znodes树的状态更改。在健康的群集中,您将看到一个领导者,多个关注者,并且所有节点的zxid值通常彼此接近。

> for x in ubuntu1 ubuntu2 ubuntu3; do echo $x; echo srvr|nc $x 2181; echo; done
ubuntu1
Zookeeper version: 3.4.7-1713338, built on 11/09/2015 04:32 GMT
Latency min/avg/max: 3/9/21
Received: 9
Sent: 8
Connections: 1
Outstanding: 0
Zxid: 0x100000004
Mode: follower
Node count: 6

ubuntu2
Zookeeper version: 3.4.7-1713338, built on 11/09/2015 04:32 GMT
Latency min/avg/max: 0/0/0
Received: 2
Sent: 1
Connections: 1
Outstanding: 0
Zxid: 0x100000004
Mode: leader
Node count: 6

ubuntu3
Zookeeper version: 3.4.7-1713338, built on 11/09/2015 04:32 GMT
Latency min/avg/max: 0/0/0
Received: 2
Sent: 1
Connections: 1
Outstanding: 0
Zxid: 0x100000004
Mode: follower
Node count: 6

关于apache-zookeeper - 如何验证Zookeeper仲裁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34537530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com