zookeeper配置文件详解.md 1.7 KB

# The number of milliseconds of each tick
# 在ZooKeeper中,tickTime是指ZooKeeper服务器之间通信的基本时间单位,通常为毫秒。ZooKeeper使用tickTime来进行时间同步和心跳检测,用于保证ZooKeeper集群中所有服务器的时钟保持同步。tickTime的值越小,ZooKeeper服务器之间进行心跳检测的时间就越短,集群的同步性就越好,但同时也会增加网络通信的负载。因此,在设置tickTime的值时,需要根据具体的场景和需求进行权衡和调整。
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=/opt/modules/zookeeper/conf/data
# 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

## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true
dataLogDir=/opt/modules/zookeeper/conf/logs