gpt4 book ai didi

apache-zookeeper - Zookeeper - 在哪里可以找到正在运行的 Zookeeper 实例的 "real"版本?

转载 作者:行者123 更新时间:2023-12-03 22:50:15 27 4
gpt4 key购买 nike

我最近安装了一个带有 Exhibitor 的新 ZK 节点,它开始正常。当我执行 telnet localhost 2181 然后运行 ​​stats 以查看版本时,即使我安装了 3.4.11,我仍然在输出中看到 3.4.5 版本。我试图找到 ZooKeeper 在哪里读取版本号,但它只是一个 .jar 和一些 lib 文件。你知道我在哪里可以得到我应该运行的“真实”版本吗?谢谢!

这是我在执行 telnet 时看到的:

myserver:/tmp/zookeeper # telnet localhost 2181
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stats
Zookeeper version: 3.4.5-1392090, built on 09/30/2012 17:52 GMT
Clients:
/127.0.0.1:53133[0](queued=0,recved=1,sent=0)

Latency min/avg/max: 0/0/0
Received: 41
Sent: 40
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: standalone
Node count: 4
Connection closed by foreign host.

运行过程( ps aux | grep zookeeper )显示:
myuser    19002  0.9  1.2 2618596 49596 ?       Sl   14:02   0:00 /usr/pkgs/java/1.8.0.92/bin/java -Dzookeeper.log.dir=/var/run/zookeeper/log -Dzookeeper.root.logger=WARN,ROLLINGFILE -cp /opt/zookeeper-server/default/bin/../build/classes:/opt/zookeeper-server/default/bin/../build/lib/*.jar:/opt/zookeeper-server/default/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/zookeeper-server/default/bin/../lib/slf4j-api-1.6.1.jar:/opt/zookeeper-server/default/bin/../lib/netty-3.10.5.Final.jar:/opt/zookeeper-server/default/bin/../lib/log4j-1.2.16.jar:/opt/zookeeper-server/default/bin/../lib/jline-0.9.94.jar:/opt/zookeeper-server/default/bin/../lib/exhibitor-1.6.0.jar:/opt/zookeeper-server/default/bin/../lib/audience-annotations-0.5.0.jar:/opt/zookeeper-server/default/bin/../zookeeper-3.4.11.jar:/opt/zookeeper-server/default/bin/../src/java/lib/*.jar:/var/run/zookeeper/conf: -server -Xmx1g -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /var/run/zookeeper/conf/zoo.cfg

最佳答案

ZooKeeper 支持四个字母的命令,假设您在 localhost 上运行 ZooKeeper:

$ echo "status" | nc  localhost 2181 | head -n 1
Zookeeper version: 3.4.9-3--1, built on Fri, 24 May 2019 08:57:53 +0100

使用一些 bash 魔法,您可以过滤掉主版本:
$ echo "status" | nc  localhost 2181 | head -n 1 | awk '{ print $3}' | cut -d "-" -f 1

关于apache-zookeeper - Zookeeper - 在哪里可以找到正在运行的 Zookeeper 实例的 "real"版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48122834/

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