主机环境与依赖
操作系统:centos7
CPU架构:x86_64
软件依赖:jdk1.8
安装包下载与解压
mkdir /data && cd /data
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz
tar zxvf apache-zookeeper-3.6.3-bin.tar.gz
ln -s apache-zookeeper-3.6.3-bin zookeeper
配置文件修改
cd zookeeper/conf
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
# 修改dataDir配置项为
dataDir=/data/zookeeper/data
# 新建文件夹
mkdir /data/zookeeper/data
zookeeper启动
cd /data/zookeeper && bin/zkServer.sh start
zookeeper停止
cd /data/zookeeper && bin/zkServer.sh stop