Zookeeper的命令及配置

Posted by KANG's BLOG on Tuesday, March 15, 2022

zookeeper命令

查看状态:zkServer.sh status

创建节点 create /name value

编辑节点 set /name editValue

递归删除节点 rmr /name

配置文件样例

# 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=/opt/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60