zookeeper_zkCli.sh 男娘i 2022-05-25 06:05 102阅读 0赞 在zookeeper的bin目录下有一个客户端连接工具:zkCli.sh 在安装zookeeper的机器上,可直接执行此命令文件: 如:zkCli.sh 或者指定连接某服务器及端口: zkCli.sh -server 127.0.0.1:2181 进入命令行界面后可执行如下命令进行相应操作: <table> <tbody> <tr> <td><p>命令</p></td> <td><p>说明</p></td> </tr> <tr> <td><p>h</p></td> <td><p>帮助命令,列出所有可用的命令</p></td> </tr> <tr> <td><p>ls</p></td> <td><p>列出某个节点下所有子节点信息,如:<span style="font-family:Calibri;">ls /</span></p></td> </tr> <tr> <td><p>stat</p></td> <td><p>查询某个节点的状态信息</p></td> </tr> <tr> <td><p>get </p></td> <td><p>获取当前节点存储的数据内容</p></td> </tr> <tr> <td><p>ls2</p></td> <td><p>列出当前节点所有子节点同时输出节点状态信息</p></td> </tr> <tr> <td><p>create </p></td> <td><p>-s<span style="font-family:'宋体';">顺序节点 </span><span style="font-family:Calibri;">-e</span><span style="font-family:'宋体';">临时节点 </span><span style="font-family:Calibri;">acl</span><span style="font-family:'宋体';">权限,临时节点客户端会话结束后会自动删除</span></p></td> </tr> <tr> <td><p>set version</p></td> <td><p>set version<span style="font-family:'宋体';">设置版本号</span><span style="font-family:Calibri;">,</span><span style="font-family:'宋体';">可看作乐观锁</span></p></td> </tr> <tr> <td><p>delete </p></td> <td><p>只能删除没有子节点的节点</p></td> </tr> <tr> <td><p>rmr</p></td> <td><p>循环删除有子节点的节点</p></td> </tr> <tr> <td><p>setquota </p></td> <td><p>setquota <span style="font-family:'宋体';">设置配额,</span><span style="font-family:Calibri;">-n</span><span style="font-family:'宋体';">限制子节点个数,</span><span style="font-family:Calibri;">-b</span><span style="font-family:'宋体';">限制数据值长度</span></p><p>zookeeper<span style="font-family:'宋体';">发现配额超过限制仅仅在日志记录警告信息。</span><span style="font-family:Calibri;"> </span><br>日志在<span style="font-family:Calibri;">/bin</span><span style="font-family:'宋体';">目录下</span><span style="font-family:Calibri;">zookeeper.out</span><span style="font-family:'宋体';">中查看</span><span style="font-family:Calibri;"> tail zookeeper.out</span></p></td> </tr> <tr> <td><p>listquota </p></td> <td><p>listquota <span style="font-family:'宋体';">用于查看配额,</span><span style="font-family:Calibri;">stat</span><span style="font-family:'宋体';">包含了自己和子节点的状态</span></p></td> </tr> <tr> <td><p>delquota </p></td> <td><p>delquota <span style="font-family:'宋体';">删除配额</span></p></td> </tr> <tr> <td><p>connect </p></td> <td><p>connect <span style="font-family:'宋体';">连接其他服务器</span></p></td> </tr> <tr> <td><p>close </p></td> <td><p>close <span style="font-family:'宋体';">关闭与其他服务器连接</span></p></td> </tr> <tr> <td><p>history </p></td> <td><p>history <span style="font-family:'宋体';">查看执行指令的历史</span></p></td> </tr> <tr> <td><p>redo </p></td> <td><p>redo <span style="font-family:'宋体';">重新执行</span><span style="font-family:Calibri;">history</span><span style="font-family:'宋体';">列出的指令列表中的指令</span></p></td> </tr> </tbody> </table> 参考资料: [https://blog.csdn.net/qq\_15370821/article/details/73550206][https_blog.csdn.net_qq_15370821_article_details_73550206] [https_blog.csdn.net_qq_15370821_article_details_73550206]: https://blog.csdn.net/qq_15370821/article/details/73550206
还没有评论,来说两句吧...