一、下载ZooKeeper安装包
本示例用的版本是3.4.13
- 官网下载地址:ZooKeeper下载链接
- 下载完解压即可,解压目录如下

二、配置ZooKeeper
- 在解压目录同级新建data/logs文件夹,用来存放ZooKeeper的相关数据和日志

- 进入安装目录下的/conf文件夹,复制zoo_sample.ctg新建一个zoo.ctg文件,并修改内容如下
# The number of milliseconds of eachtick 心跳间隔毫秒每次
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 gettinganacknowledgement
syncLimit=5
# the directory where the snapshotisstored. //镜像数据位置
dataDir=E:\\zookeeper\\data
#日志位置
dataLogDir=E:\\zookeeper\\logs
# the port at which the clientswillconnect 客户端连接的端口
clientPort=2181
三、启动服务
- 进入安装目录下的bin目录,双击zkServer.cmd

- 双击zhCli.cmd连接测试

持续更新中…
本文详细介绍了如何下载ZooKeeper安装包,版本为3.4.13,包括配置data和logs文件夹用于存储数据和日志,以及设置zoo.ctg文件中的关键参数如tickTime、initLimit、syncLimit、dataDir、dataLogDir和clientPort。最后,指导如何启动ZooKeeper服务。

4492

被折叠的 条评论
为什么被折叠?



