Download ZooKeeper, address http://www.apache.org/dyn/closer.cgi/zookeeper to
decompress ZooKeeper
tar zxvf zookeeper-3.4.8.tar.gz
Create a new zoo.cfg in the conf directory, and configure it as follows according to the zoo_sample.cfg in the directory.
cd zookeeper-3.3.6/conf came zoo.cfg
The zoo.cfg code is as follows (specify the log file directory by yourself: if the directory does not exist, you need to create it yourself):
tickTime=2000 dataDir=/javaee/zookeeper/data dataLogDir=/javaee/zookeeper/log clientPort=2181
In the bin directory, start ZooKeeper:
cd zookeeper-3.3.6/bin ./zkServer.sh start
Make sure that the firewall has been
closed The command to close:
systemctl status firewalld.service #Check the firewall status
systemctl stop firewalld.service #Close the firewall
systemctl disable firewalld.service #Forbid the startup of the firewall
to close SELINUX
vim /etc/selinux/config
#SELINUX=enforcing #Comment
Remove #SELINUXTYPE=targeted #Comment out SELINUX
=disabled #Add
If you build a cluster, you need to comment out 127.0.0.1 in /etc/hosts.