① Zookeeper requires a java environment to run, so JDK must be installed first
https://jingyan.baidu.com/article/2c8c281d810c830008252a06.html Install OPENJDK
② Download and unzip
#wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.7/zookeeper-3.4.7.tar.gz
#tar -zxvf zookeeper-3.4.12.tar.gz
③ Choose the installation directory by yourself, then enter conf, copy zoo_sample.cfg and rename it to zoo.cfg
cp zoo_sample.cfg zoo.cfg
④ Edit zoo.cfg, add 2 directories in the root directory
⑤ Enter the zookeeper directory to create the data and logs directory
#mkdir data
#mkdir logs
⑥ Enter the bin directory to enter the following content to start the program or enter sh / bin zkServer.sh start in the root directory to start
# zkServer.sh start
# zkServer.sh status View status
# zkServer.sh stop stop / close
But because the openJDK is installed, an error will be reported, how to solve cuowu
⑦. If you want to enter the command without entering the bin directory, you need to add the environment variables in the / etc / profile configuration file as follows
⑦Method to solve the error report
Solve the problem of Zookeeper cluster restart Error contacting service. It is probably not running
Enter the bin / directory to view the cause of zookeeper.out analysis
Solution
Just create a soft link.
Then execute
Performed correctly