1.修改conf/zoo.cfg
cp zoo_sample.cfg zoo.cfg
tickTime=2000 # 心跳间隔
dataDir=/var/lib/zookeeper # 备份数据
clientPort=2181 # 开放端口
启动zookeeper
bin/zkServer.sh start
连接zk
bin/zkCli.sh -server 127.0.0.1:2181
参考:
https://zookeeper.apache.org/doc/current/zookeeperStarted.html