《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》,点击传送门,即可获取!
$ mv zoo_sample.cfg zoo.cfg
- 编辑zoo.cfg文件
$ vim 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=/usr/local/zookeeper-3.4.5/data #日志目录 dataLogDir=/usr/local/zookeeper-3.4.5/logs # the port at which the clients will connect clientPort=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 #配置三个server server.0=192.168.192.130:2888:3888 server.1=192.168.192.131:2888:3888 server.2=192.168.192.134:2