zookeeper解压, 放到 /opt/zookeeper/ 下, 同目录再放一个 server1目录, 下面建data和log两个目录用于存放数据和日志
zoo.cfg
[[email protected] conf]$ more 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=/opt/zookeeper/server1/data # the port at which the clients will connect clientPort=2181 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # 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.1=127.0.0.1:10090:10100 server.2=127.0.0.1:10091:10101 server.3=127.0.0.1:10092:10102
为了更改日志的存放目录, 和zoo.cfg同目录创建文件 zookeeper-env.sh , 写入
ZOO_LOG_DIR=/opt/zookeeper/server1/log
我用的版本是zookeeper-3.4.6, 如果不起作用, 请查看bin/zkServer.sh 里面具体的指定.
时间: 2024-10-16 03:22:34