linux安装zookeeper3.6.1
1. 下载 zookeeper3.6.1
(下载页面https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.6.1/apache-zookeeper-3.6.1-bin.tar.gz)
下载:
wget https://mirrors.bfsu.edu.cn/apache/zookeeper/zookeeper-3.6.1/apache-zookeeper-3.6.1-bin.tar.gz
解压:
tar -zxvf apache-zookeeper-3.6.1-bin.tar.gz
2. 创建配置文件
cd apache-zookeeper-3.6.1-bin/conf/
cp zoo_sample.cfg zoo.cfg
3. 启动服务
cd ..
cd bin/
./zkServer.sh start
常用命令:
启动: ./zkServer.sh start
启动查看日志: ./zkServer.sh start-foreground
重启: ./zkServer.sh restart
停止: ./zkServer.sh stop
查看状态: ./zkServer.sh status
连接zk: zkCli.sh -server 127.0.01
查询节点: ls /
删除节点:
delete /path/a/b (一层一层删除)
rmr /path
创建: create /test testdata
获取: get /test
网友评论