ZooKeeper needs to be configured in the background for the use of a middleware of the company, so ZooKeeper needs to be installed on the computer first. However, during the installation process, some strange problems appear, so record the process.

1. Zookeeper download

Zookeeper.apache.org/releases.ht…

Download it and decompress it

2. Change the configuration file

The configuration file is stored in the conf folder under the decompressed folder. The default name is zoo_sample. CFG. Then modify the data path inside zoo. CFG. It is recommended to change it to the data folder under the current folder (create it by yourself).

Ps. Zookeeper downloaded via Homebrew does not have a conf folder, which is strange.

3, startup error

Startup error:

1) No Java environment: ZooKeeper can be regarded as a Springboot program, and its startup log shows that its structure is very similar to Springboot boot.

2) port occupation: As Zookeeper is a Springboot program, its startup has a listening port and a running port, namely the default 8080. Therefore, add a line admin.serverPort=8888 at the bottom of the zoo. CFG configuration file.

4, start,

Sh file in the bin folder. You can start ZooKeeper by calling./ zkserver. sh start

zhongjunjie03@zhongjunjie03deMacBook-Pro bin % ./zkServer.sh start /usr/bin/java ZooKeeper JMX enabled by default Using Config: / Users/zhongjunjie03 / Documents/middleFunc/apache - they are - 3.6.3 - bin/bin /.. /conf/zoo.cfg Starting zookeeper ... STARTEDCopy the code

If the last sentence is displayed, the system may not start successfully. You need to view the log file or the ZooKeeper status

zhongjunjie03@zhongjunjie03deMacBook-Pro bin % ./zkServer.sh status /usr/bin/java ZooKeeper JMX enabled by default Using Config: / Users/zhongjunjie03 / Documents/middleFunc/apache - they are - 3.6.3 - bin/bin /.. /conf/zoo.cfg Client port found: 2181. Client address: localhost. Client SSL: false. Mode: standaloneCopy the code

If the preceding information is displayed or no error message is displayed in the log file, the startup is successful. If the startup is in singleton mode, you need to change the configuration file to start the system.