1、开启三台虚拟机
2、
192.168.0.141 master
192.168.1.131 slave02
192.168.1.51 slave01
3、cd /usr/local/zookeeper-3.4.14/conf/
4、cp zoo_sample.cfg zoo.cfg
5、vim zoo.cfg
dataDir=/data/zookeeper
server.1=master:2888:3888 server.2=0.0.0.0:2888:3888 server.3=slave02:2888:3888 quorumListenOnAllIPs=true
6、 vim /data/zookeeper/myid
写上对应的server id
7、防火墙
253 yum install -y iptables
254 yum update iptables
255 yum install iptables-services
256 systemctl stop firewalld
257 systemctl mask firewalld
259 iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 2181 -j ACCEPT 260 iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 3888 -j ACCEPT
service iptables save
8、setenforce 0
8、.
/bin/zkServer.sh start