zookeeper伪分布安装配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ymybxx/article/details/79944968

之前写过完全分布式的配置,但伪分布更适合调试使用

1.配置三个配置文件(均在conf目录下)

将模板复制三份
cp zoo_sample.cfg zk1.cfg
cp zoo_sample.cfg zk2.cfg
cp zoo_sample.cfg zk3.cfg

分别做一些改动
zk1:

dataDir=/home/hadoop/bda/tmp/zk1
# the port at which the clients will connect
clientPort=2181

server.1=hadoop0:2222:2223
server.2=hadoop1:3333:3334
server.3=hadoop2:4444:4445

zk2:

dataDir=/home/hadoop/bda/tmp/zk2
# the port at which the clients will connect
clientPort=2182

server.1=hadoop0:2222:2223
server.2=hadoop1:3333:3334
server.3=hadoop2:4444:4445

zk3:

dataDir=/home/hadoop/bda/tmp/zk3
# the port at which the clients will connect
clientPort=2183

server.1=hadoop0:2222:2223
server.2=hadoop1:3333:3334
server.3=hadoop2:4444:4445

可以看出,只用修改各自的客户端连接端口和数据存储路径

2.配置3个myid

echo 1 > /home/hadoop/bda/tmp/zk1/myid
echo 2 > /home/hadoop/bda/tmp/zk2/myid
echo 3 > /home/hadoop/bda/tmp/zk3/myid

3.启动zookeeper

进入bin目录
./zkServer.sh start zk1.cfg
./zkServer.sh start zk2.cfg
./zkServer.sh start zk3.cfg

finish

阅读更多

没有更多推荐了,返回首页