Install
- Mirror site download: http://mirror.bit.edu.cn/apache/zookeeper/
- Configure environment variables (I am user level here)
- Enter the conf directory and copy zoo_sample.cfg to zoo.cfg (must be this file)
- Modify the dataDir directory of zoo.cfg to an existing directory
vim ~/.bash_profile
export ZK_HOME=/root/zookeeper-3.3.6
export PATH=$PATH:$ZK_HOME/bin
source ~/.bash_profile
echo $ZK_HOME
View help
Official website help documentation: http://zookeeper.apache.org/doc/current/zookeeperStarted.html
zkServer.sh
zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
Start ZooKeeper
./zkServer.sh start
Check ZooKeeper running status
./zkServer.sh status
Close ZooKeeper
./zkServer.sh stop
Connect to ZooKeeper
zkCli.sh -server 127.0.0.1:2181
Reference blog
[1]https://blog.csdn.net/zknxx/article/details/52601554
[2]http://www.cnblogs.com/wuxl360/category/874409.html