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

相关推荐
java1234_小锋4 小时前
ZooKeeper集群中服务器之间是怎样通信的?
分布式·zookeeper·云原生
AC赳赳老秦7 小时前
工业互联网赋能智造:DeepSeek解析产线传感器数据驱动质量管控新范式
前端·数据库·人工智能·zookeeper·json·flume·deepseek
java1234_小锋1 天前
Zookeeper分布式锁如何实现?
分布式·zookeeper·云原生
西敏寺的乐章1 天前
ZooKeeper 系统学习总结
分布式·学习·zookeeper
yumgpkpm2 天前
Cloudera CDP 7.3(国产CMP 鲲鹏版)平台与银行五大平台的技术对接方案
大数据·人工智能·hive·zookeeper·flink·kafka·cloudera
Msshu1232 天前
多协议PD快充诱骗取电芯片XSP26支持快充取电和识别电脑传输数据
zookeeper·hbase·etcd·memcached·memcache
AC赳赳老秦4 天前
财务数据智能解读:DeepSeek分析利润表生成异常波动原因报告
数据库·人工智能·postgresql·zookeeper·测试用例·时序数据库·deepseek
AC赳赳老秦4 天前
企业级人工智能平台选型深度分析:天翼云 DeepSeek 与开源解决方案的部署考量与成本博弈
人工智能·elasticsearch·zookeeper·rabbitmq·github·时序数据库·deepseek
程序员阿鹏5 天前
怎么理解削峰填谷?
java·开发语言·数据结构·spring·zookeeper·rabbitmq·rab