一、下载
官方连接 https://archive.apache.org/dist/zookeeper/
yum install wget -y
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.6.0/apache-zookeeper-3.6.0-bin.tar.gz
验证
[root@hostdare ~]# sha512sum apache-zookeeper-3.6.0-bin.tar.gz
862c96572bc085fd6ac5ad55f07b77b2ec78f7eb510b6c190c60a35cb13d15a7de9274fd48f96ae52d559e93691a57b5bc6e4cd43a4d66154983757623401dc7 apache-zookeeper-3.6.0-bin.tar.gz
解压
tar zxvf apache-zookeeper-3.6.0-bin.tar.gz && cd apache-zookeeper-3.6.0-bin
配置
cp conf/zoo_sample.cfg conf/zoo.cfg
vi conf/zoo.cfg
dataDir=/tmp/zookeeper #tmp为临时存储目录
dataDir=/var/lib/zookeeper #修改为 <---
启动
[root@hostdare apache-zookeeper-3.6.0-bin]$ ./bin/zkServer.sh start
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /root/apache-zookeeper-3.6.0-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
停止
[root@hostdare apache-zookeeper-3.6.0-bin]$ ./bin/zkServer.sh stop