Zookeeper集群的搭建

心不动则不痛 提交于 2019-11-26 04:02:10

Zookeeper的集群配置

解压zookeeper包

创建指定文件夹执行 myid

/home/hadoop/zookeeper-3.4.7/zookeepermyid

创建一个myid文件 写入1

修改配置文件 名

cp zoo_sample.cfg zoo.cfg

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.
# 写入myid的位置
dataDir=/home/hadoop/zookeeper-3.4.7/zookeepermyid
# the port at which the clients will connect
clientPort=2181
# 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
server.1=hadoop1:2888:3888
server.2=hadoop2:2888:3888
server.3=hadoop3:2888:3888

使用scp发往其他两台机器

修改myid 分别为2 ,3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!