我已下载,运行zkServer.sh start
,运行ps -ef|grep zoo
以确保其正在运行,然后运行zkCli.sh 127.0.0.1:2181
。该命令退出到shell,具有以下输出(剪切为仅显示结束)。任何想法都赞赏。
2013-01-12 14:11:04,318 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@378f6235
ZooKeeper -server host:port cmd args
connect host:port
get path [watch]
ls path [watch]
set path data [version]
rmr path
delquota [-n|-b] path
quit
printwatches on|off
create [-s] [-e] path data acl
stat path [watch]
close
ls2 path [watch]
history
listquota path
setAcl path acl
getAcl path
sync path
redo cmdno
addauth scheme auth
delete path [version]
setquota -n|-b val path
答案 0 :(得分:2)
zkCli.sh
需要-server
标志:
-server host:port cmd args
加入-server
你应该很好:
zkCli.sh -server 127.0.0.1:2181