1、下载安装包
1.1使用apache提供的zookeeper
Index of /dist/zookeeper (apache.org)
1.2使用我上传的
2、修改配置
将该目录下的zoo_sample文件复制并修改为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=D:\app\zookeeper-3.4.12\data
dataLogDir=D:\app\zookeeper-3.4.12\log
# the port at which the clients will connect
clientPort=2583
# 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
主要修改
# 指定zookeeper数据文件存放路径
dataDir=D:\app\zookeeper-3.4.12\data
# 指定zookeeper日志文件存放路径
dataLogDir=D:\app\zookeeper-3.4.12\log
# 指定zookeeper用于客户端连接的端口号
clientPort=2583
3、启动
双击zkServer.cmd启动
启动日志
可以看到zookeeper已经绑定到2583端口,代表启动成功。使用连接工具连接一下,双击zkCli.cmd
查看连接结果
可以正常连接。