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
来源:https://blog.csdn.net/shaokeAK/article/details/98753409