Windows 安装Zookeeper

安装

下载地址:Apache ZooKeeper

我下载的版本:zookeeper-3.4.12

下载后,解压

配置

1、 在D:\zookeeper-3.4.12文件夹中创建一个"data"文件夹和"log"文件夹

2、 复制zoo_sample.cfg,改名:zoo.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=D:\zookeeper-3.4.12\data
dataLogDir=D:\zookeeper-3.4.12\log
# the port at which the clients will connect
clientPort=2181
启动

进入目录:D:\zookeeper-3.4.12\bin

1、执行zkServer.cmd

2、执行zkCli.cmd

复制代码
#连接本地zk
zkCli.cmd

#链接远程zk
zkCli.cmd -server ip:port
简单用法

在zkCli.cmd上操作

  1. 创建节点

    create /test "my_data"

节点:/test

值:my_data

注意:在zk创建节点,必须要以"/"开头,否则会报错:Command failed: java.lang.IllegalArgumentException: Path must start with / character

  1. 获取节点

    get /test

  2. 修改节点

    set /test "abc"

  3. 创建子节点

    create /test/child "child"

  4. 查看子节点

    ls /test

  5. 删除节点

    delete /test/child

相关推荐
小马爱打代码2 天前
ZooKeeper:入门实战
分布式·zookeeper·云原生
岁岁种桃花儿3 天前
深度解析DolphinScheduler核心架构:搭建高可用Zookeeper集群
linux·分布式·zookeeper
AC赳赳老秦5 天前
DeepSeek一体机部署:中小企业本地化算力成本控制方案
服务器·数据库·人工智能·zookeeper·时序数据库·terraform·deepseek
张np6 天前
java进阶-Zookeeper
java·zookeeper·java-zookeeper
雪碧聊技术7 天前
什么是Zookeeper?
分布式·zookeeper
AC赳赳老秦8 天前
外文文献精读:DeepSeek翻译并解析顶会论文核心技术要点
前端·flutter·zookeeper·自动化·rabbitmq·prometheus·deepseek
what丶k12 天前
ZooKeeper从入门到精通:分布式协调的核心技术解析
zookeeper
yumgpkpm12 天前
在AI语言大模型时代 Cloudera CDP(华为CMP 鲲鹏版)对自有知识的保护
人工智能·hadoop·华为·zookeeper·spark·kafka
【赫兹威客】浩哥12 天前
【赫兹威客】伪分布式ZooKeeper测试教程
大数据·分布式·zookeeper
帅次12 天前
系统分析师-微服务系统分析与设计
docker·微服务·zookeeper·容器·kubernetes·etcd·kubelet