1

我下载,运行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
4

1 回答 1

2

zkCli.sh需要一个-server标志,因为消息表明:

-server host:port cmd args

加入-server,你应该很好:

zkCli.sh -server 127.0.0.1:2181
于 2013-01-15T03:15:11.903 回答