概述
相应操作如下:
[root@localhost zookeeper-3.4.14]# bin/zkCli.sh // 命令
Connecting to localhost:2181
2020-04-07 05:09:01,516 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
2020-04-07 05:09:01,520 [myid:] - INFO [main:Environment@100] - Client environment:host.name=localhost
2020-04-07 05:09:01,520 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_221
2020-04-07 05:09:01,522 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2020-04-07 05:09:01,522 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/local/java/jdk1.8.0_221/jre
2020-04-07 05:09:01,522 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/opt/zookeeper/zookeeper-3.4.14/bin/../zookeeper-server/target/classes:/opt/zookeeper/zookeeper-3.4.14/bin/../build/classes:/opt/zookeeper/zookeeper-3.4.14/bin/../zookeeper-server/target/lib/*.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../build/lib/*.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../lib/slf4j-log4j12-1.7.25.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../lib/slf4j-api-1.7.25.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../lib/netty-3.10.6.Final.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../lib/log4j-1.2.17.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../lib/jline-0.9.94.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../lib/audience-annotations-0.5.0.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../zookeeper-3.4.14.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../zookeeper-server/src/main/resources/lib/*.jar:/opt/zookeeper/zookeeper-3.4.14/bin/../conf:/usr/local/java/jdk1.8.0_221/jre/lib/ext:/usr/local/java/jdk1.8.0_221/lib/tools.jar
2020-04-07 05:09:01,522 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2020-04-07 05:09:01,522 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2020-04-07 05:09:01,522 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler=<NA>
2020-04-07 05:09:01,523 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux
2020-04-07 05:09:01,523 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64
2020-04-07 05:09:01,523 [myid:] - INFO [main:Environment@100] - Client environment:os.version=3.10.0-327.el7.x86_64
2020-04-07 05:09:01,523 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root
2020-04-07 05:09:01,523 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root
2020-04-07 05:09:01,523 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/opt/zookeeper/zookeeper-3.4.14
2020-04-07 05:09:01,524 [myid:] - INFO [main:ZooKeeper@442] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@25f38edc
2020-04-07 05:09:01,558 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1025] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
Welcome to ZooKeeper!
JLine support is enabled
2020-04-07 05:09:01,702 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@879] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2020-04-07 05:09:01,716 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x100001831230004, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls / // 命令
[cluster, controller_epoch, controller, brokers, zookeeper, admin, isr_change_notification, consumers, log_dir_event_notification, latest_producer_id_block, config]
[zk: localhost:2181(CONNECTED) 1] ls /brokers
[ids, topics, seqid]
[zk: localhost:2181(CONNECTED) 2] ls /brokers
[ids, topics, seqid]
[zk: localhost:2181(CONNECTED) 3] ls /brokers/ids
[0]
[zk: localhost:2181(CONNECTED) 4] ls /brokers/ids/0
[]
[zk: localhost:2181(CONNECTED) 5] get /brokers/ids/0 // 获取数据
{"listener_security_protocol_map":{"PLAINTEXT":"PLAINTEXT"},"endpoints":["PLAINTEXT://192.168.131.132:9092"],"jmx_port":-1,"host":"192.168.131.132","timestamp":"1586261803214","port":9092,"version":4}
cZxid = 0xaa7
ctime = Tue Apr 07 05:16:43 PDT 2020
mZxid = 0xaa7
mtime = Tue Apr 07 05:16:43 PDT 2020
pZxid = 0xaa7
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x100001831230005
dataLength = 200
numChildren = 0
[zk: localhost:2181(CONNECTED) 6]
最后
以上就是慈祥便当为你收集整理的zk 查看相应的数据的全部内容,希望文章能够帮你解决zk 查看相应的数据所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复