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

相关推荐
阿波罗.201213 小时前
Zookeeper 客户端 .net访问框架 ZookeeperNetEx项目开发编译
分布式·zookeeper
武子康1 天前
大数据-30 ZooKeeper Java-API 监听节点 创建、删除节点
大数据·后端·zookeeper
小葛呀11 天前
互联网大数据求职面试:从Zookeeper到Flink的技术探讨
大数据·redis·zookeeper·面试·flink·互联网·yarn
小白上线*^_^*11 天前
Kafka与Zookeeper在linux上的下载记录
zookeeper·kafka·linux上的下载与安装
longxibo12 天前
ZooKeeper 3.9.2 集群安装指南
大数据·分布式·zookeeper·debian
dessler13 天前
ZooKeeper-备份(Backup)
linux·运维·zookeeper
dessler13 天前
ZooKeeper-监控(Monitor)
linux·运维·zookeeper
hwj运维之路14 天前
大数据系统架构实践(一):Zookeeper集群部署
大数据·zookeeper·系统架构
福如意如我心意14 天前
使用docker-compose安装kafka
docker·zookeeper·kafka
dessler16 天前
Zookeeper-事务日志(Txn Log)‌的阅读
linux·运维·zookeeper