1、创建目录
mkdir zkcluster
2、进入 zkcluster目录,下载,解压
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz
tar -xvf apache-zookeeper-3.6.3-bin.tar.gz
3、修改名字
mv apache-zookeeper-3.6.3-bin.tar.gz zookeeper01
4、再复制两份
cp -r zookeeper01/ zookeeper02
cp -r zookeeper01/ zookeeper03
5、分别在zookeeper01、zookeeper02、zookeeper03⽬录下创建data及logs⽬录
mkdir data
cd data
mkdir logs
6、复制配置文件
cd conf
mv zoo_sample.cfg zoo.cfg
7、修改三个配置文件
vim zkcluster/zookeeper01/conf/zoo.cfg
vim zkcluster/zookeeper02/conf/zoo.cfg
vim zkcluster/zookeeper03/conf/zoo.cfg
8、为三个节点创建数据目录和日志目录
cd zookeeper01/data
touch myid
vim myid 输入1
cd zookeeper02/data
touch myid
vim myid 输入2
cd zookeeper03/data
touch myid
vim myid 输入3
9、在每⼀个zookeeper 的 zoo.cfg配置客户端访问端⼝(clientPort)和集群服务器IP列表
10、启动三个zookeeper