当前位置:   article > 正文

ZK配置文件

java使用zk获取配置文件

The number of milliseconds of each tick, 最小时间单位,很多运行时的时间

  1. #间隔都是使用tickTime的倍数来表示的,例如initLimit=10就是tickTime的十倍等于2W毫秒
  2. tickTime=2000
  3. # The number of ticks that can pass between, sending a request and getting an acknowledgement
  4. # 心跳最大延迟时间,如果leader在规定的时间内无法获取到follow的心跳检测响应,则认为节点已脱离
  5. syncLimit=5
  6. # the directory where the snapshot is stored. do not use /tmp for storage, /tmp here is just. example sakes.
  7. # 用于存放内存数据库快照的文件夹,同时用于集群的myid文件也存在这个文件夹里
  8. dataDir=G:\\program-my\\zookeeper-3.4.9\\data
  9. # the port at which the clients will connect,ZK端口
  10. clientPort=2181
  11. # the maximum number of client connections. increase this if you need to handle more clients
  12. # 允许连接的客户端数目,0-不限制,通过 IP 来区分不同的客户端
  13. maxClientCnxns=60
  14. #将管理机器把事务日志写入到“ dataLogDir ”所指定的目录,而不是“ dataDir ”所指定的目录。避免日志和快照之间的竞争
  15. #dataLogDir=/root/Hadoop-0.20.2/zookeeper-3.3.1/log/data_log
  16. # The number of snapshots to retain in dataDir
  17. #用于配置zookeeper在自动清理的时候需要保留的快照数据文件数量和对应的事务日志文件,最小值时三,如果比3小,会自动调整为3
  18. #autopurge.snapRetainCount=3
  19. # Purge task interval in hours. Set to "0" to disable auto purge feature
  20. #配套snapRetainCount使用,用于配置zk进行历史文件自动清理的频率,如果参数配置为0或者小于零,就表示不开启定时清理功能,默认不开启
  21. #autopurge.purgeInterval=1
  22. ##集群配置
  23. # The number of ticks that the initial, synchronization phase can take
  24. # follow服务器在启动的过程中会与leader服务器建立链接并完成对数据的同步,leader服务器允许follow在initLimit时间内完成,默认时10.集群量增大时
  25. #同步时间变长,有必要适当的调大这个参数, 当超过设置倍数的 tickTime 时间,则连接失败
  26. initLimit=10
  27. #server.A=B:C:D:其中 A 数字,表示是第几号服务器. dataDir目录下必有一个myid文件,里面只存储A的值,ZK启动时读取此文件,与下面列表比较判断是哪个server
  28. # B 是服务器 ip ;C表示与 Leader 服务器交换信息的端口;D 表示的是进行选举时的通信端口。
  29. server.1=127.0.0.1:2888:3888
  30. server.2=127.0.0.1:2889:3889
  31. server.3=127.0.0.1:2890:3890
  32. # 配置成observer模式
  33. peerType=observer
  34. # 注意观察者角色的末尾,需要拼接上observer
  35. server.4=10.2.143.38:2886:3886:observer

转载于:https://www.cnblogs.com/Desneo/p/7611593.html

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号