Preface
ZooKeeper is a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase. It is a software that provides consistent services for distributed applications. The functions provided include: configuration maintenance, domain name services, distributed synchronization, group services, etc.
installation steps
1. Download the source code
http://www.apache.org/dyn/closer.cgi/zookeeper/
Link: https://pan.baidu.com/s/1Fm6n25zuM1_6paR6l_Dk3A Password: ut1r
Download and upload to the server root directory /opt
2. Unzip the source code
tar -zxvf zookeeper-linux-3.4.10.tar.gz
3. Modify the configuration file
cd zookeeper-3.4.10/conf/
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
In English input state, press i to enter insert mode, modify the following configuration, and others remain unchanged
dataDir=/opt/zookeeper-3.4.10/data
dataLogDir=/opt/zookeeper-3.4.10/logs
Press esc to enter : wq save and exit
4. Set environment variables
vi /etc/profile
Press i in English input state to enter insert mode, add the following configuration
export ZOOKEEPER_HOME=/opt/zookeeper-3.4.10/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
Press esc to enter : wq to save and exit, compile /etc/profile to make the configuration effective
source /etc/profile
5. Start
zkServer.sh start
6. View status/stop/restart
zkServer.sh status
zkServer.sh stop
zkServer.sh restart