码迷,mamicode.com
首页 > 其他好文 > 详细

zookeeper多节点配置

时间:2015-04-04 13:37:31      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:

zookeeper解压, 放到 /opt/zookeeper/ 下, 同目录再放一个 server1目录, 下面建data和log两个目录用于存放数据和日志

zoo.cfg

[milton@localhost 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 里面具体的指定.

 

zookeeper多节点配置

标签:

原文地址:http://www.cnblogs.com/milton/p/4391921.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!