zookeeper集群安装部署

官网下载

官网

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.6.2/apache-zookeeper-3.6.2-bin.tar.gz
配置

修改${zookeeperhome}/conf/zoo.cfg

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/bigdata/binfile/zookeeper-3.5.8/data
# the port at which the clients will connect
clientPort=2181
clientPortAddress=0.0.0.0
admin.serverPort = 2183
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
quorumListenOnAllIPs=true
4lw.commands.whitelist=*
server.0=master:2888:3888
server.1=slave1:2888:3888
server.2=slave2:2888:3888


在配置的dataDir下

vi myid

在这里插入图片描述

配置数字对应起来,这边master是0,slave1是1,slave2是2

复制到子节点

scp -r ./zookeeper hadoop@slave1:/app/

修改对应的myid

启动
# 三台机器都要启动,按顺序启动,有选举机制
./bin/zkServer.sh start
#  全部启动后,测试
./bin/zkServer.sh status
会显示Mode: leader/follower
# 全部启动后,测试
jps 出现QuorumPeerMain

echo ruok|nc master 2181
显示imok

# 客户端连接
./bin/zkCli.sh -server master:2181

博主公众号
求关注
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值