zkCli.sh用法

栏目: java

zkCli.sh -server ip:端口

例如 zkCli.sh -server 192.169.7.119:4281

另外参数: -timeout 表示超时设置

-r 表示zk几圈即使崩溃了一般也提供该命令的读服务

进入之后 ls / 可以查看目录结构

h 显示帮助信息

[root@node2 bin]# ./zkCli.sh -server 192.168.7.119:4281 Connecting to 192.168.7.119:4281 2017-10-24 10:03:48,520 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT 2017-10-24 10:03:48,524 [myid:] - INFO [main:Environment@100] - Client environment:host.name=static.kezesong.com 2017-10-24 10:03:48,524 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_111 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/local/jdk1.8.0_111/jre 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/usr/local/zookeeper/bin/../build/classes:/usr/local/zookeeper/bin/../build/lib/*.jar:/usr/local/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/bin/../lib/netty-3.10.5.Final.jar:/usr/local/zookeeper/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/bin/../zookeeper-3.4.9.jar:/usr/local/zookeeper/bin/../src/java/lib/*.jar:/usr/local/zookeeper/bin/../conf:.:/usr/local/jdk1.8.0_111/jre/lib/rt.jar:/usr/local/jdk1.8.0_111/lib/dt.jar:/usr/local/jdk1.8.0_111/lib/tools.jar 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=:/usr/local/native/lib:/usr/local/native/lib:/usr/local/Ice-3.5.1/lib:/usr/local/Ice-3.5.1/lib64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler= 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64 2017-10-24 10:03:48,527 [myid:] - INFO [main:Environment@100] - Client environment:os.version=3.10.0-327.el7.x86_64 2017-10-24 10:03:48,528 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root 2017-10-24 10:03:48,528 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root 2017-10-24 10:03:48,528 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/usr/local/zookeeper/bin 2017-10-24 10:03:48,529 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=192.168.7.119:4281 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@1de0aca6 Welcome to ZooKeeper! 2017-10-24 10:03:48,556 [myid:] - INFO [main-SendThread(192.168.7.119:4281):ClientCnxn$SendThread@1032] - Opening socket connection to server 192.168.7.119/192.168.7.119:4281. Will not attempt to authenticate using SASL (unknown error) JLine support is enabled 2017-10-24 10:03:48,627 [myid:] - INFO [main-SendThread(192.168.7.119:4281):ClientCnxn$SendThread@876] - Socket connection established to 192.168.7.119/192.168.7.119:4281, initiating session 2017-10-24 10:03:48,664 [myid:] - INFO [main-SendThread(192.168.7.119:4281):ClientCnxn$SendThread@1299] - Session establishment complete on server 192.168.7.119/192.168.7.119:4281, sessionid = 0x15e5ae247b9009c, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: 192.168.7.119:4281(CONNECTED) 0] ls / [dubbo, myname, zookeeper] [zk: 192.168.7.119:4281(CONNECTED) 1] h ZooKeeper -server host:port cmd args stat path [watch] set path data [version] ls path [watch] delquota [-n|-b] path ls2 path [watch] setAcl path acl setquota -n|-b val path history redo cmdno printwatches on|off delete path [version] sync path listquota path rmr path get path [watch] create [-s] [-e] path data acl addauth scheme auth quit getAcl path close connect host:port [zk: 192.168.7.119:4281(CONNECTED) 2] ^C您在 /var/spool/mail/root 中有邮件 [root@node2 bin]# ^C [root@node2 bin]# ^C [root@node2 bin]# ^C [root@node2 bin]# ./zkCli.sh h Connecting to localhost:2181 clipboard1.png





曾梦想仗剑走天涯 看一看世界的繁华 年少的心总有些轻狂 如今你四海为家 曾让你心疼的姑娘 如今已悄然无踪影 爱情总让你渴望又感到烦恼 曾让你遍体鳞伤 Dilililidilililidenda Dilililidilililidada Dilililidilililidada 走在勇往直前的路上 Dilililidilililidenda Dilililidilililidada Dilililidilililidada 有难过也有精彩 每一次难过的时候 就独自看一看大海 总想起身边走在路上的朋友 有多少正在疗伤 Dilililidilililidenda Dilililidilililidada Dilililidilililidada 不知多少孤独的夜晚 Dilililidilililidenda Dilililidilililidada Dilililidilililidada 从昨夜酒醉醒来 每一次难过的时候 就独自看一看大海 总想起身边走在路上的朋友 有多少正在醒来 让我们干了这杯酒 好男儿胸怀像大海 经历了人生百态世间的冷暖 这笑容温暖纯真 每一次难过的时候 就独自看一看大海 总想起身边走在路上的朋友 有多少正在醒来 让我们干了这杯酒 好男儿胸怀像大海 经历了人生百态世间的冷暖 这笑容温暖纯真

关键字

最近访客