ZooKeeper安装部署
- 下载并解压ZooKeeper
tar -zxvf zookeeper-3.4.9.tar.gz
- 移动解压后的包到/usr/local/zookeeper下
mv zookeeper-3.4.9 /usr/local/zookeeper
- 拷贝修改配置文件名(先进入目录/usr/local/zookeeper/conf)
cp zoo_sample.cfg zoo.cfg
- 启动/关闭命令
/usr/local/zookeeper/bin/zkServer.sh start
/usr/local/zookeeper/bin/zkServer.sh stop
- 运行ZooKeeper命令行客户端
/usr/local/zookeeper/bin/zkCli.sh -server 127.0.0.1:2181
- 基本操作命令
ls / (查看根目录)
create /rm "test"(在根目录下创建Znode节点,路径标识为rm,包含内容"test")
get /rm(获取rm节点下包含的内容)
delete /rm(删除rm节点)
rmr(递归删除某个节点及其子节点)