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

相关推荐
2501_942389552 天前
特斯拉的车辆摄像头每四天为AI训练集采集的数据量
人工智能·hadoop·zookeeper·oracle·时序数据库·memcache
泰克教育官方账号4 天前
泰涨知识 | Shell脚本之一键启动和关闭Zookeeper脚本
分布式·zookeeper·云原生
虚心的百褶裙6 天前
远程调用服务架构设计及zookeeper技术详解(下篇)
分布式·zookeeper·云原生
2301_801184758 天前
kafka-zookeeper
分布式·zookeeper·kafka
JLWcai202510091 个月前
铸造领域树脂砂轮|金利威多场景解决方案,20 + 配方覆盖全需求
mongodb·zookeeper·eureka·spark·rabbitmq·memcached·storm
Aurora_Dawn_yy1 个月前
单机部署数据同步_jdk,mysql,kafka,flink,zookeeper,达梦,starrocks
大数据·linux·starrocks·zookeeper·达梦
Jinkxs1 个月前
Dubbo- 主流注册中心介绍:Zookeeper/Nacos/Eureka 适配思路
zookeeper·eureka·dubbo
mqiqe1 个月前
面试题-Zookeeper 面试篇
分布式·zookeeper·面试
JAVA面经实录9171 个月前
ZooKeeper 完整知识体系
java·zookeeper·架构
爱吃牛肉的大老虎1 个月前
Kafka集群之抛弃 Zookeeper
分布式·zookeeper·kafka