查看zookeeper的版本号
zkServer.sh version
docker容器的zookeeper版本号查看:
docker exec -it $(docker ps | grep zookeeper|awk '{print $1}') zkServer.sh version
查看zookeeper的状态信息(查看zookeeper的领导节点)
zkServer.sh status
docker容器的zookeeper状态信息
docker exec -it $(docker ps | grep zookeeper|awk '{print $1}') zkServer.sh status
返回结果ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: leader
Mode说明:
值为leader 代表当前节点为zookeeper的领导节点