解压zookeeper
tar -zxvf apache-zookeeper-3.7.3.tar.gz -C /usr/local
修改配置文件
进入zookeeper的安装目录的conf目录
cd /usr/local/zookeeper/config
cp zoo_sample.cfg zoo.cfg
修改zoo.cfg
The number of milliseconds of each tick
tickTime=2000initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper/zkdata
dataLogDir=/usr/local/zookeeper/zklogs
clientPort=2181
创建数据持久化目录
mkdir /usr/local/zookeeper/zkdata
mkdir /usr/local/zookeeper/zklogs
配置JDK环境
vim /etc/profile
export JAVA_HOME=/usr/local/jdk
export PATH=PATH:JAVA_HOME/bin
生效环境变量
source /etc/profile
启动zookeeper服务
zkServer.sh start
查看Zookeeper运行状态
zkServer.sh status