ZooKeeper之zoo.cfg配置
1. zoo.cfg配置完整的zoo.cfg# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial# synchronization phase can takeinitLimit=10# The number of ticks that can pass betwee
·
1. 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.
dataDir=/tmp/zookeeper
# 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
2.tickTime
tickTime:用于计算的时间单元,单位为毫秒。比如session超时:N* tickTime。
3. initLimit
initLimit :用于集群,允许从节点连接并同步到master节点的初始化连接时间,以tickTime的倍数来表示。
4. syncLimit
syncLimit :用于集群,master主节点与从节点之间发送消息,请求和应答时间长度,超过一定的时间从节点就会被抛弃。(心跳机制)
5. dataDir
dataDir:必须配置,比如用来存储事务文件的数据等。
6. dataLogDir
dataLogDir:日志目录,如果不配置会和dataDir公用
- 注意:linux常常这样存放
7. clientPort
clientPort :连接服务器的端口,默认2181
更多推荐
已为社区贡献6条内容
所有评论(0)