Configuration and verification of Zookeeper in CentOS7

ZooKeeper is a distributed, open source coordination service for distributed applications. It is a software that provides consistent services for distributed applications. The functions provided include: configuration maintenance, domain name service, distributed synchronization, group service, etc.
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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326646772&siteId=291194637