dubbo系列--zookeeper搭建

本文档详细介绍了如何在Windows上安装并配置Zookeeper,以配合Dubbo使用。首先,下载zookeeper-3.4.5版本,修改`zoo.cfg`配置文件,包括设置`dataDir`和`clientPort`。接着,配置环境变量,并确保配置正确。启动Zookeeper服务,通过`zkServer.cmd`和`jps`命令检查服务是否运行成功。对于初学者,`clientPort`和`server.0`配置是关键。

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

前面已经把工程搭好了,下面是zookeeper的安装及搭建,(Windows版本)

下载zookeeper-3.4.5包,再把conf下面的文件改成:

再按照网上所说的在环境变量里配置好,注意一定要配置准确,不然会很坑的,

zoo.cfg文件内容,这里是我自己配的,

# The number of milliseconds of each tick
tickTime=40000
# 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=E:\\DUBBO\\zk\\zookeeper
# the port at which the clients will connect
clientPort=2181
#
# 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
server.0=10.10.202.252:2181:7770

作为制作demo,其中clientPort=2181,server.0=10.10.202.252:2181:7770很重要,其他的暂时不说

这个zookeeper启动后再启动工程,windows环境中启动是双击在bin下面的zkServer.cmd,再用cmd命令中jps,为什么采取jps命令查看,是因为zookeeper是java开发

这样代表启动成功

 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

田哥coder

你的鼓励是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值