ZooKeeper study notes

Install

  1. Mirror site download: http://mirror.bit.edu.cn/apache/zookeeper/
  2. Configure environment variables (I am user level here)
  3. Enter the conf directory and copy zoo_sample.cfg to zoo.cfg (must be this file)
  4. 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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325387588&siteId=291194637