Zookeeper3.5.7集群安装配置

安装zookeeper集群

1. 使用Xshell工具上传apache-zookeeper-3.5.7-bin.tar.gz到/opt/software目录下。

 2.在/opt/software目录下使用tar命令解压apache-zookeeper-3.5.7-bin.tar.gz到/opt/module目录下:

tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/

3.在/opt/module目录下修改文件夹名称:

mv apache-zookeeper-3.5.7-bin/ zookeeper

4.打开环境变量:

vim /etc/profile

在底部添加如下配置:

#zookeeper
export ZOOKEEPER_HOME=/opt/module/zookeeper
export PATH=$PATH:$ZOOKEEPER_HOME/bin

5.将profile文件重新运行:

source /etc/profile

 6.拷贝zoo_sample.cfg另存为zoo.cfg:

cp /opt/module/zookeeper/conf/zoo_sample.cfg /opt/module/zookeeper/conf/zoo.cfg

7.编辑zoo.cfg文件:

vim /opt/module/zookeeper/conf/zoo.cfg

对dataDir进行修改,server三行写入进去:

dataDir=/opt/module/zookeeper/data
server.1=bigdata01:2888:3888
server.2=bigdata02:2888:3888
server.3=bigdata03:2888:3888

8.创建data目录:

mkdir /opt/module/zookeeper/data

9.配置myid文件:

echo "1" > /opt/module/zookeeper/data/myid

10.将文件分发给bigdata02和bigdata03:

scp -r /opt/module/zookeeper @bigdata02:/opt/module
scp -r /opt/module/zookeeper @bigdata03:/opt/module
scp /etc/profile @bigdata02:/etc
scp /etc/profile @bigdata03:/etc

11.修改bigdata02和bigdata03的myid文件:

echo 2 > /opt/module/zookeeper/data/myid
echo 3 > /opt/module/zookeeper/data/myid

12.三个节点重新加载环境变量:

source /etc/profile

13.三个节点启动zookeeper集群:

zkServer.sh start

执行结果如下:

bc881e14962b46d4bbdc4ac5f18acb9c.png

 zookeeper集群安装成功!

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值