zookeeper环境搭建
`[root@hadoop102 software]# tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/` `[root@hadoop102 conf]# mv apache-zookeeper-3.5.7-bin/ zookeeper-3.5.7` [root@hadoop102 conf]# mv zoo_sample.cfg zoo.cfg [root@hadoop102 conf]# vim zoo.cfg
#修改数据存储路径配置
dataDir=/opt/module/zookeeper-3.5.7/zkData
#增加如下配置
#######################cluster########################## server.2=hadoop102:2888:3888 server.3=hadoop103:2888:3888 server.4=hadoop104:2888:3888
在/opt/module/zookeeper-3.5.7/这个目录下创建 zkData
[root@hadoop102 zookeeper-3.5.7]# mkdir zkData
在/opt/module/zookeeper-3.5.7/zkData 目录下创建一个 myid 的文件
[root@hadoop102 zookeeper-3.5.7]# vi myid
在文件中添加与 server 对应的编号(注意:上下不要有空行,左右不要有空格)
2 [root@hadoop102 zookeeper-3.5.7]# bin/zkServer.sh start [root@hadoop104 zookeeper-3.5.7]# bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg Client port found: 2181. Client address: localhost. Mode: follower [root@hadoop103 zookeeper-3.5.7]# bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg Client port found: 2181. Client address: localhost. Mode: leader [root@hadoop104 zookeeper-3.5.7]# bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/module/zookeeper-3.5.7/bin/../conf/zoo.cfg Client port found: 2181. Client address: localhost. Mode: follower