当前位置: 首页 > news >正文

windows中安装zookeeper

https://zhuanlan.zhihu.com/p/692451839

【zookeeper】在Windows上启动zookeeper_windows启动zk-CSDN博客

Index of /apache/zookeeper/zookeeper-3.9.2

Index of /apache/zookeeper/zookeeper-3.9.2

Zookeeper的应用场景

1、配置管理

2、服务注册中心

3、主从协调

4、分布式锁。(客户端在一个节点下创建有序节点,如果分配的节点号最小,则获取锁,没有获取到锁的客户端监听前一节点变化,判断自己是否是最小的节点来获取锁)

Windows版本的zookeeper用于学习还是很方便的,毕竟个人电脑操作系统大部分都是windows的。

下载

下载地址:点击下载

下载后文件名:apache-zookeeper-3.9.2-bin.tar.gz

解压到文件夹

例如:F:\devtool\apache-zookeeper-3.9.2-bin

修改配置文件

将%zookeeper%\conf\zoo_sample.cfg文件改为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=/tmp/zookeeper
dataDir=F:\devtool\apache-zookeeper-3.9.2-bin\data
dataLogDir=F:\devtool\apache-zookeeper-3.9.2-bin\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.
#
# https://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## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpHost=0.0.0.0
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

新增文件夹

对应上图配置的文件夹

配置环境变量

为了使用zookeeper命令方便,将zookeeper的bin文件夹加入到环境变量中

启动服务

启动客户端

测试

在客户端控制台创建节点

发布于 2024-04-14 22:27・IP 属地山西

http://www.lryc.cn/news/361470.html

相关文章:

  • 直接写和放在函数中不同的R语言用法
  • 《mysql轻松学习·二》
  • Swift对比版本号
  • MySQL数据表的“增删查改“
  • Github查询语法
  • pqgrid的使用
  • 媳妇面试了一家公司,期望月薪20K,对方没多问就答应了,只要求3天内到岗,可我总觉得哪里不对劲。
  • 【Makefile笔记】小白入门篇
  • 快速入门文件操作+5种例子演示
  • 基于Vue3的Uniapp实训项目|一家鲜花店
  • Python3 字典
  • JPA详解
  • Linux线程:线程分离
  • chatgpt之api的调用问题
  • Java中lambda表达式是啥怎么使用
  • selenium中, quit 和close的区别
  • 管易云和金蝶云星空接口打通对接实战
  • DP-Kmaens密度峰值聚类算法
  • STM32-14-FSMC_LCD
  • linux nohup命令详解:持久运行命令,无视终端退出
  • PS系统教程09
  • 2024089期传足14场胜负前瞻
  • 备战十一届大唐杯国赛预选赛
  • 安装 Android Studio 2024.1.1.6(Koala SDK35)和过程问题解决
  • 美团一面:什么是CAS?有什么优缺点?我说你说的是AtomicInteger吗?
  • 【linux】(2)文件内容排序sort
  • css 图片上添加模糊背景的文字内容
  • Python3 函数参数
  • 精准检测,可燃气体报警系统的技术原理与特点
  • 6月2(信息差)