1、ruok - The server will respond with imok if it is running. Otherwise it will not respond at all.
2、kill - When issued from the local machine, the server will shut down.
3、dump - Lists the outstanding sessions and ephemeral nodes. This only works on the leader.
4、stat - Lists statistics about performance and connected clients.
ZooKeeper命令行工具类似于Linux的shell环境,不过功能肯定不及shell啦,但是使用它我们可以简单的对ZooKeeper进行访问,数据创建,数据修改等操作。
当启动 ZooKeeper 服务成功之后,输入下述命令,连接到 ZooKeeper 服务:
zkCli.sh –server 202.115.36.251:2181
连接成功后,系统会输出 ZooKeeper 的相关环境以及配置信息,并在屏幕输出“ Welcome to ZooKeeper ”等信息。
命令行工具的一些简单操作如下:
1 )使用 ls 命令来查看当前 ZooKeeper 中所包含的内容:
[zk: 202.115.36.251:2181(CONNECTED) 1] ls /