Hadoop集群搭建(九)~Zookeeper安装
本篇记录Zookeeper集群安装,版本为3.4.10
1,解压Zookeeper安装包到/opt/module/目录下
[root@master software]# tar -zxvf zookeeper-3.4.10.tar.gz -C /opt/module/
2,同步/opt/module/zookeeper-3.4.10目录内容到slave1、slave2
[root@master module]# scp -r /opt/module/zookeeper-3.4.10/ root@slave2:/opt/module/
3,在/opt/module/zookeeper-3.4.10,创建zkData目录,并创建一个myid的文件,添加内容为:2(其他节点为3,4)
[root@master zookeeper-3.4.10]# mkdir -p zkData [root@master zkData]# touch myid [root@master zookeeper-3.4.10]# vi myid
4,重命名/opt/module/zookeeper-3.4.10/conf这个目录下的zoo_sample.cfg为zoo.cfg;修改数据存储路径配置;同步zoo.cfg配置文件
dataDir=/opt/module/zookeeper-3.4.10/zkData #######################cluster########################## server.2=master:2888:3888 server.3=slave1:2888:3888 server.4=slave2:2888:3888
5,启动Zookeeper
[root@master zookeeper-3.4.10]# bin/zkServer.sh start [root@master zookeeper-3.4.10]# bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.4.10/bin/../conf/zoo.cfg Mode: leader