zookeeper集群安装与配置

来源:互联网 发布:虚无世界2java路径 编辑:程序博客网 时间:2024/05/16 17:52
  1. # The number of milliseconds of each tick
  2. tickTime=2000
  3. # The number of ticks that the initial
  4. # synchronization phase can take
  5. initLimit=10
  6. # The number of ticks that can pass between
  7. # sending a request and getting an acknowledgement
  8. syncLimit=5
  9. # the directory where the snapshot is stored.
  10. # do not use /tmp for storage, /tmp here is just
  11. # example sakes.
  12. dataDir=/home/stat/zookeeper-3.4.6/data
  13. dataLogDir=/home/stat/zookeeper-3.4.6/logs
  14. # the port at which the clients will connect
  15. clientPort=2181
  16. # the maximum number of client connections.
  17. # increase this if you need to handle more clients
  18. #maxClientCnxns=60
  19. #
  20. # Be sure to read the maintenance section of the
  21. # administrator guide before turning on autopurge.
  22. #
  23. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
  24. #
  25. # The number of snapshots to retain in dataDir
  26. #autopurge.snapRetainCount=3
  27. # Purge task interval in hours
  28. # Set to "0" to disable auto purge feature
  29. #autopurge.purgeInterval=1
  30. server.0=10.189.122.207:2888:3888
  31. server.1=10.189.122.208:2888:3888
  32. server.2=10.189.122.213:2888:3888
设置文件如上所示,通过bin/zkServer.sh命令启动zk服务,用法如下

注意:有时候zk会启动失败,可以查看对应的dataDir下是否成功新建文件myid,其内容即为zoo.cfg中的serverid

0 0