目录
前言
今天给大家分享下搭建Zookeeper集群的经历,我是在一台服务器上搭建的,多服务器搭建类似
一、准备工作
步骤一:创建四个数据存储目录

步骤二:分别在zk1~zk4目录中创建myid文件,并按照顺序写入数字1、2、3、4

步骤三:创建四个zoo.cfg配置文件,分别为zoo1.conf,zoo2.conf,zoo3.conf,zoo4.conf

二、启动集群
1.启动四台ZooKeeper

2.查看集群状态

三、连接集群
./zkCli.sh -server 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183,127.0.0.1:2184


总结
以上就是今天要分享的内容