# tar -zxf zookeeper-3.4.14.tar.gz -C /opt/software/(自己指定的文件夹)
mkdir data(存储数据)
mkdir logs(存储日志)
tickTime = 2000
dataDir = /opt/software/zookeeper-3.4.14/data(自定义目录)
dataLogDir = /opt/software/zookeeper-3.4.14/logs(自定义目录)
clientPort = 2181
initLimit = 5
syncLimit = 2
进入bin目录,启动、停止、重启分和查看当前节点状态(包括集群中是何角色)别执行:
./zkServer.sh start
./zkServer.sh stop
./zkServer.sh restart
./zkServer.sh status
./zkCli.sh
执行成功后得到以下响应
Connecting to localhost:2181
................
................
................
Welcome to ZooKeeper!
................
................
WATCHER::
WatchedEvent state:SyncConnected type: None path:null