配置zookeeper
- 1 每个节点新建目录
/home/zookeeper-3.4.6/data
- 2 每个节点创建文件myid
vim /home/zookeeper-3.4.6/data/myid
分别键入1,2,3,4,5 - 3
cd zookeeper-3.6.0/conf/
复制zoo_sample.cfg为zoo.cfgcp zoo_sample.cfg zoo.cfg
- 4 打开配置文件
vim ~/soft/zookeeper-3.4.6/conf/zoo.cfg
- 5 修改相关配置
- 启动zookeeper
./zkServer.sh start
(注:需要在每个node上执行此命令) - 查看状态
./zkServer.sh status
- 登录zookeeper
./zkCli.sh -server node1:2181
查看Zookeeper日志zkServer.sh start-foreground