1.下载zookeeper安装包
https://downloads.apache.org/zookeeper/zookeeper-3.6.3/
2.解压
tar -zxvf apache-zookeeper-3.6.3-bin.tar.gz
3.移动到指定文件夹
mv apache-zookeeper-3.6.3-bin /usr/local/zookeeper-3.6.3
4.创建data和logs文件
mkdir data
mkdir logs
5.修改配置文件
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
编辑zoo.cfg文件:按a键 添加如下配置 esc :wq 保存并退出
#数据文件夹
dataDir=/usr/local/zookeeper-3.6.3/data
#日志文件夹
dataLogDir=/usr/local/zookeeper-3.6.3/logs
然后我们修改系统配置文件:配置环境变量
vim /etc/profile
#zookeeper-3.6.2配置
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.6.3/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
6.运行文件:应用刚才的修改
# source /etc/profile
7.启动zookeeper
cd /usr/local/zookeeper-3.6.3/
cd bin
启动服务端
./zkServer.sh start
zookeeper已经运行了