1、创建目录
bash
mkdir zkcluster
2、进入 zkcluster目录,下载,解压
bash
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、修改名字
bash
mv apache-zookeeper-3.6.3-bin.tar.gz zookeeper01
4、再复制两份
bash
cp -r zookeeper01/ zookeeper02
cp -r zookeeper01/ zookeeper03
5、分别在zookeeper01、zookeeper02、zookeeper03⽬录下创建data及logs⽬录
bash
mkdir data
cd data
mkdir logs
6、复制配置文件
bash
cd conf
mv zoo_sample.cfg zoo.cfg
7、修改三个配置文件
bash
vim zkcluster/zookeeper01/conf/zoo.cfg
bash
vim zkcluster/zookeeper02/conf/zoo.cfg
bash
vim zkcluster/zookeeper03/conf/zoo.cfg
8、为三个节点创建数据目录和日志目录
bash
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