Zookeeper配置詳解

# The number of milliseconds of each tick,
# Zookeeper 服務(wù)器之間或客戶端與服務(wù)器之間維持心跳的時(shí)間間隔,也就是每個(gè) tickTime 時(shí)間就會(huì)發(fā)送一個(gè)心跳。tickTime以毫秒為單位。session最小有效時(shí)間為tickTime*2
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
# 集群中的follower服務(wù)器(F)與leader服務(wù)器(L)之間初始連接時(shí)能容忍的最多心跳數(shù)(tickTime的數(shù)量),超過此數(shù)量沒有回復(fù)會(huì)斷開鏈接
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
# 集群中的follower服務(wù)器與leader服務(wù)器之間請求和應(yīng)答之間能容忍的最多心跳數(shù)(tickTime的數(shù)量)
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
# Zookeeper保存數(shù)據(jù)的目錄,默認(rèn)情況下,Zookeeper將寫數(shù)據(jù)的日志文件也保存在這個(gè)目錄里。不要使用/tmp目錄
dataDir=/var/zookeeper
# the port at which the clients will connect
# 客戶端連接 Zookeeper 服務(wù)器的端口,Zookeeper 會(huì)監(jiān)聽這個(gè)端口,接受客戶端的訪問請求。
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
# 最大客戶端鏈接數(shù)量
maxClientCnxns=60

# 以下配置用于數(shù)據(jù)清理,開啟之前務(wù)必閱讀官方文檔http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# 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

# zookeeper集群配置項(xiàng),server.1,server.2,server.3是zk集群節(jié)點(diǎn);zoo1,zoo2,zoo3是主機(jī)名稱;2888是主從通信端口;3888用來選舉leader
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 本文是 《從 Paxos 到 ZooKeeper 分布式一致性原理與實(shí)踐》書中關(guān)于 ZooKeeper 配置章節(jié)部...
    懶癌正患者閱讀 4,844評論 0 1
  • Zookeeper是通過一個(gè)***.cfg配置文件來進(jìn)行配置管理的,默認(rèn)使用zoo.cfg文件進(jìn)行配置。下面我們將...
    SkTj閱讀 1,245評論 0 1
  • 一、ZK的最小配置最小配置是指Zookeeper運(yùn)行所需的最小配置,Zookeeper只需要配置這些項(xiàng)就可以正常的...
    輕飄飄D閱讀 2,469評論 0 0
  • 該篇文章是作為單獨(dú)的zookeeper的配置詳解
    kacen閱讀 190評論 0 2
  • tickTime=2000 zookeeper里面最小的時(shí)間單位為2000ms initLimit=10 zook...
    yxktiming閱讀 3,056評論 0 0

友情鏈接更多精彩內(nèi)容