工具篇:zookeeper

zookeeper入門(zk介紹,並使用本地多個配置文件啓動僞集羣):https://www.jianshu.com/p/1f4c70d7ef40

#啓動server(如果配置文件是/path/to/zk/conf/zoo.cfg,那麼可以省略該參數)
/path/to/zk/bin/zkServer.sh start /path/to/zk/conf/zoo.cfg

#查看服務狀態
/path/to/zkServer.sh status /path/to/zk/conf/zoo.cfg

#停止server
/path/to/zk/bin/zkServer.sh stop /path/to/zk/conf/zoo.cfg

#啓動client
/path/to/zk/bin/zkCli.sh -server localhost:2181

#退出client
quit

#啓動server僞集羣,3個配置文件的端口必須互不相同
/path/to/zk/bin/zkServer.sh start /path/to/zk/conf/zoo1.cfg
/path/to/zk/bin/zkServer.sh start /path/to/zk/conf/zoo2.cfg
/path/to/zk/bin/zkServer.sh start /path/to/zk/conf/zoo3.cfg

#啓動client連接集羣
/path/to/zk/bin/zkCli.sh -server localhost:2181,localhost:2182,localhost:2183

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章