安装ZooKeeper

下载zookeeper
http://zookeeper.apache.org/releases.html#download

解压缩到制定目录(f:\zookeeper)

添加配置文件(config\zoo.cfg, 可以copy文件conf\zoo_sample.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=f:/var/zookeeper/data
dataLogDir=f:/var/zookeeper/log
# 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

Windows运行
进入zookeeper\bin, 执行zkServer.cmd。
如果出现错误(zookeeper Error: JAVA_HOME is incorrectly set.), 打开文件zkEnv.cmd, 将%JAVA_HOME%\bin\java替换为"%JAVA_HOME%\bin\java"

posted on 2015-12-17 13:58  jmbkeyes  阅读(119)  评论(0)    收藏  举报

导航