是否可以直接运行zsCli.sh命令,如ls /或get / from bash而不进入zookeeper
shell?我使用的是Zookeeper版本3.4.6-1569965.
例如,像这样:
$./zkCli.sh get /
我只能在连接到zookeeper shell然后运行get / from之后才能这样做,如下所示:
$./zkCli.sh Connecting to localhost:2181 Welcome to ZooKeeper! WATCHER:: WatchedEvent state:AuthFailed type:None path:null JLine support is enabled WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0] get / []
zkCli.sh在3.4.7之后一直是支持进程命令.
https://issues.apache.org/jira/browse/ZOOKEEPER-1897
https://issues.apache.org/jira/browse/ZOOKEEPER-1897
如:
./zkCli.sh -server xxxxx:2181 get /test
zkcli,动物园管理员的golang cli,https://github.com/go-zkcli/zkcli,也是一个简单的解决方案.
zkcli --servers srv-1,srv-2,srv-3 create /demo_only some_value