Windows11本地安装Zookeeper(最新)

一、下载Zookeeper安装包

前提:需要有java1.8的运行环境,没有安装看这篇文章:Java JDK1.8 安装教程和环境配置_java 1.8-CSDN博客

测试java环境:

win+r输入cmd,打开命令行窗口,输入命令: java -version

出现版本号,则环境配置正确

1.zookeeper官网:​​​

这里我们使用3.4.11版本:zookeeper3.4.11

2.解压压缩包

注意:解压路径最好在没有中文路径的目录下(不要出现中文和空格),解压完如下图:

二、修改配置文件

1.在当前目录下创建一个data文件夹(存放数据)和log文件夹(存放日志)

2.进入conf目录,复制zoo_sample.cfg文件,重命名为zoo.cfg

3.使用记事本打开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=../data

dataLogDir=../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=../data指定数据保存路径

dataLogDir=../log指定日志文件保存路径

注:其中dataDir和dataLogDir也可以使用绝对路径,两种都可以。

三、启动测试

1.进入zookeeper的bin目录下,双击 zkServer.cmd

(注:windows的启动配置文件后缀一般都为.cmd)

启动后如下:

2.启动客户端

回到bin目录下,双击 zkCli.cmd ,看到Welcome to ZooKeeper!说明成功!

相关推荐
一知半解仙10 小时前
大国博弈与机器人纪元:我们正站在怎样的历史拐点?
大数据·人工智能·机器人
亚古数据10 小时前
亚古数据:新西兰公司工商报告Company Extract全解析
大数据·人工智能
baopixiaoz11 小时前
AI量化策略师|Web3 量化交易研究员
大数据·人工智能·python·区块链
IT古董11 小时前
【WMS学习笔记系列】01-需求分析
大数据·数据库
成长之路51411 小时前
【数据集】MD&A管理层讨论与分析文本(2001-2025年)
大数据
淡海水11 小时前
01-07-运行时-GC深度剖析-内存分配回收与结构选择
jvm·windows·unity·gc
浅念-13 小时前
MySQL 索引底层完整详解|磁盘Page|B+树推导|聚簇非聚簇索引|索引SQL操作
大数据·数据库·b树·sql·mysql·面试·职场和发展
小马过河R13 小时前
数据仓库入门:是什么、怎么做、和数据库有什么区别?
大数据·数据库·数据仓库·架构·驾驭工程·fde
leisoo809713 小时前
涨停板次日表现因子怎么挖掘本地化Python全流程实战
大数据·人工智能·python
用户36105886261213 小时前
SparkSQL 数据源与底层架构深度剖析
大数据·spark