Zookeeper安装配置

本文介绍了Zookeeper的安装与配置方法。可从指定清华镜像下载tar.gz文件,在Windows上也能使用。解压后修改conf文件夹下的zoo_sample.cfg文件,配置数据和日志存储地址。进入bin文件夹,运行zkServer.cmd启动服务,运行zkCli.cmd查看是否启动成功。

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

安装和配置

   1、下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/

         注意下载的是*tar.gz文件,虽然是linux的安装包,但是没关系,在windows上面也是可用的

    2、解压(随意选择)

      

    3、修改解压之后的conf文件夹下面的zoo_sample.cfg文件

      主要是修改文件以后应用中Zookeeper的数据存储地址和日志存储地址dataDir和dataLogDir

# The number of milliseconds of each tick
tickTime=2000 #这个时间是作为Zookeeper服务器之间或者客户端与服务器之间维持心跳的时间间隔,也就是每个tickTime时间就会发送和一个心跳
# 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:\\zookeeper\\data #Zookeeper保存数据的目录,默认情况是将日志文件也是保存在这里的
dataLogDir=D:\\zookeeper\\log  #Zookeeper保存日志文件的目录
# the port at which the clients will connect
clientPort=2181 #客户端连接Zookeeper服务器的端口,Zookeeper会监听这个端口,接受客户端的访问请求
# 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

    至于文件中有几个变量是非常重要的已经把注释给出来了,就不单独拉出来了

4、到目前位置已经配置好了,接下来就是启动了

   进入到安装目录下面的bin文件夹下面

 

 5、启动Zookeeper的服务(运行zkServer.cmd文件即可)

6、查看是否已经启动(运行zkCli.cmd到本地的对应端口j即可)

上面显示已经完全启动了

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值