dubbo系列教程之一:zookeeper安装详细教程

本文详述了Zookeeper的安装过程,包括从清华大学镜像站下载3.4.11版本,配置zoo_sample.cfg(如修改dataDir、dataLogDir、clientPort等),启动zkServer.cmd并验证连接成功。通过这篇教程,读者可以掌握Zookeeper的基础设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    这几天在学习dobbo+zookeeper的搭建,中间费了不少心里,把过程和经验记录在这里了

    首先是zookeeper的安装,zookeeper可以为分布式应用程序协调服务,可以前往zookeeper的官网进行下载https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/这个是清华大学的节点,我下载的是3.4.11版本。下载解压后,首先修改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=C:\Work\JAVA_PACKAGE\zookeeper-3.4.11\\data
dataLogDir=C:\Work\JAVA_PACKAGE\zookeeper-3.4.11\\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

(其中dataDir和dataLogDir需要依据自己的目录修改。tickTime是每次心跳的间隔时间,单位是毫秒;dataDir是数据保存目录;dataLogDir是日志文件保存目录;clientPort是zookeeper的端口,zookeeper会监控这个端口,接受请求)


然后启动zookeeper,在zookeeper的安装路径下的bin目录中启动zkServer.cmd 这个脚本:

zkServer.cmd



我们可以启动下zookeeper的客户端来连接下:

zkCli.cmd 127.0.0.1:2181


如果出现下列的信息,就说明成功了


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值