1.下载zookeeper-3.4.9.tar.gz,上传到/usr/local目录
2.解压缩,tar -xvf zookeeper-3.4.9.tar.gz,得到zookeeper-3.4.9目录
3.进入/usr/local/zookeeper-3.4.9/conf,执行命令:cp zoo_sample.cfg zoo.cfg
4.编辑配置文件,vi zoo.cfg,将dataDir的值改为如下:
dataDir=/usr/local/zookeeper-3.4.9/data
5.vi /etc/profile,将zookeeper加入环境变量加入到文件尾:
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.9/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
6.刷新profile
source /etc/profile
7.启动zookeeper,输入命令:zkServer.sh start
8.查看运行状态,输入命令:zkServer.sh status