最简单的网站模板,安逸花借款app下载安装,企业宣传页模板,搭建网站需要什么技术安装
下载地址#xff1a;Apache ZooKeeper
我下载的版本#xff1a;zookeeper-3.4.12
下载后#xff0c;解压
配置
1、 在D:\zookeeper-3.4.12文件夹中创建一个“data”文件夹和“log”文件夹
2、 复制zoo_sample.cfg#xff0c;改名#xff1a;zoo.cfg
修改zoo.c…安装
下载地址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
tickTime2000
# The number of ticks that the initial
# synchronization phase can take
initLimit10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
#dataDir/tmp/zookeeper
dataDirD:\zookeeper-3.4.12\data
dataLogDirD:\zookeeper-3.4.12\log
# the port at which the clients will connect
clientPort2181
启动
进入目录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
2. 获取节点
get /test
3. 修改节点 set /test abc
4. 创建子节点
create /test/child child
5. 查看子节点
ls /test
6. 删除节点
delete /test/child