1.安装jdk
2.下载zookeeper
地址:http://zookeeper.apache.org
版本:zookeeper-3.4.10
3.解压zookeeper-3.4.10至E:\using\zookeeper-3.4.10
4.在E:\using\zookeeper-3.4.10 新建data及log目录。
5.安装单击模式
至E:\using\zookeeper-3.4.10\conf 复制 zoo_sample.cfg 并粘贴到当前目录下,命名zoo.cfg.
6.zoo.cfg 配置修改
dataDir与dataLogDir配置修改
# 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=/tmp/zookeeper
dataLogDir=E:\\using\\zookeeper-3.4.10\\data
dataDir=E:\\using\\zookeeper-3.4.10\\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
7.cmd命令下进入D:\machine\zookeeper-3.4.6\bin目录下运行zkserver.cmd.如下图所示:
zkserver.cmd这个脚本中会启动一个java进程
8.验证是否安装启动成功
8.1.使用jps -l –v 命令
8.2.动客户端连接一下
zkCli 127.0.0.1:2181