zookeeper集群zoo.cfg配置文件详解

直接附上zoo.cfg文件内容:

# The number of milliseconds of each tick 心跳间隔2000ms
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
# 初始化客户端连接时间,不能超过10*2000ms,超过时间客户端请求失败
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
# leader与follower之间发送消息,请求和应答时间长度,
# 最长不能超过多少个tickTime的时间长度,总的时间长度就是5*2000=10秒。
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/home/zkdata #数据和快照位置
dataLogDir=/tmp/zklogs #日志位置
# 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
# 保留3个快照数量
autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
# 每3小时清除一次日志
autopurge.purgeInterval=3
#重点本机zookeeper的ip地址应该配置成0.0.0.0:2888:3888
server.1=0.0.0.0:2888:3888
server.2=xxx.xxx.xxx.160:2888:3888
server.3=xxx.xxx.xxx.7:2888:3888
#观察者模式的节点如下
server.4=xxx.xxx.xxx.205:2888:3888:observer
 

猜你喜欢

转载自blog.csdn.net/technology01/article/details/84825563