Zookeeper installation
The installation of zookeeper is divided into three modes: stand-alone mode, cluster mode and pseudo cluster mode.
1. Download
Enter the directory for the version you want to download, select the. tar.gz File Download
Download Link: http://archive.apache.org/dist/zookeeper/
Environment: CENTOS7, JDK1.8
2. Installation
Use tar to extract the directory you want to install, take the 3.5 version as an example
[Root@localhost conf]# tar-zxf zookeeper-3.5.0-alpha.tar.gz
3. Configure
Create data and logs in the home directory for two directories for storing the information and logs:
[Root@localhost zookeeper]# mkdir data
[Root@localhost zookeeper]# mkdir logs
Create a new Zoo.cfg file in the Conf directory,
[Root@localhost conf]# MV Zoo_sample.cfg zoo.cfg
[Root@localhost conf]# VI zoo.cfg
ticktime=2000
initlimit=10
synclimit=5
datadir=/home/svr/application/zookeeper/data
DataLogDir =/home/svr/application/zookeeper/logs
clientport=2181
4. Start and stop
Go to the Bin directory, start, stop, restart, and view the current node state (including what role is in the cluster) do not:
[Root@localhost bin]#./zkserver.sh start
[Root@localhost bin]#./zkserver.sh stop
[Root@localhost bin]#./zkserver.sh restart
[Root@localhost bin]#./zkserver.sh status
5. Client Connection:
[Root@localhost bin]#./zkcli.sh-server 192.168.24.250:2181