# The number of milliseconds of each tick # 这个时间是作为 Zookeeper 服务器之间或客户端 # 与服务器之间维持心跳的时间间隔,也就是每个 # tickTime 时间就会发送一个心跳。 tickTime=2000
# The number of ticks that the initial # synchronization phase can take # 这个配置项是用来配置 Zookeeper 接受客户端 #(这里所说的客户端不是用户连接 Zookeeper 服务 # 器的客户端,而是 Zookeeper 服务器集群中连接 # 到 Leader 的 Follower 服务器)初始化连接时最 # 长能忍受多少个心跳时间间隔数。当已经超过 10 # 个心跳的时间(也就是 tickTime)长度后 Zookeeper # 服务器还没有收到客户端的返回信息,那么表明这个 # 客户端连接失败。总的时间长度就是 10*2000=20 秒 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=/tmp/zookeeper
# 设置数据存储和日志存储路径 dataDir=data dataLogDir=log
# the port at which the clients will connect # 这个端口就是客户端连接 Zookeeper 服务器的端口, # Zookeeper 会监听这个端口,接受客户端的访问请求。 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. # # https://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