说明:
- 操作系统:Centos7.x
- 虚拟机:VirtualBox
- 工具:FinalShell
步骤:
- wget 安装
# /home/bigdata/cluster
wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
- 解压 tgz 文件,并进行重命名
tar -xf zookeeper-3.4.10.tar.gz
mv zookeeper-3.4.10/ zookeeper
cd zookeeper
- 创建 data ,记录一下data的路径
mkdir data
# pwd
# 显示data的路径
/home/bigdata/cluster/zookeeper/data
- 进入 conf ,拷贝zoo_sample.cfg另命名zoo.cfg,再进入zoo.cfg修改配置
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
# 修改dataDir
# 地址设置为第3步中data的路径
启动Zookeeper服务:
bin/zkServer.sh start
# 查看状态
bin/zkServer.sh status
停止Zookeeper服务:
bin/zkServer.sh stop