本文共 1186 字,大约阅读时间需要 3 分钟。
# 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 between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=~/tmp/datadataLogDir=~/tmp/data# the port at which the clients will connectclientPort=2181## 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
参数 | 说明 |
---|---|
tickTime | 默认值3000,单位是ms,可以不配置,zk的最小单元的长度,很多运行时时隔都是使用tickTime的倍数来表示的,例如zk中会话最小超时时间默认是tickTime*2 |
dataDir | 顾名思义就是 Zookeeper 保存数据的目录,默认情况下,Zookeeper 将写数据的日志文件也保存在这个目录里。 |
dataLogDir | 顾名思义就是 Zookeeper 保存日志文件的目录 |
clientPort | 这个端口就是客户端连接 Zookeeper 服务器的端口,Zookeeper 会监听这个端口,接受客户端的访问请求。 |
当这些配置项配置好后,你现在就可以启动 Zookeeper 了,启动后要检查 Zookeeper 是否已经在服务,可以通过 netstat – ano 命令查看是否有你配置的 clientPort 端口号在监听服务。
转载地址:http://wrqab.baihongyu.com/