- Three nodes need to install JDK
- Three nodes need to close the firewall
service iptables stop
chkconfig iptables off - The first server enters the software directory
cd /home/software/ - Delete the stand-alone mode of Zookeeper
rm -rf zookeeper-3.4.8 - Turn off Zookeeper's stand-alone mode.
View through jps, find QuorumPeerMain, and then kill -9 process number - Re-extract
tar -xvf zookeeper-3.4.8.tar.gz - Enter
cd zookeeper-3.4.8/conf in the subdirectory conf - Copy
cp zoo_sample.cfg zoo.cfg - Edit
vim zoo.cfg to
modify the dataDir attribute
dataDir=/home/software/zookeeper-3.4.8/tmp and
add
server at the end of the file . Number = IP or host name: port number 1: port number 2,
for example
server.1=10.9.162.133 :2888:3888
server.2=10.9.152.65:2888:3888
server.3=10.9.130.83:2888:3888 - Create a new data directory and enter
cd…
mkdir tmp
cd tmp - Edit
vim myid
to add the number given by the current cloud host to the file, for example, the number 1 given by the first cloud host - Remote copy
cd /home/software/
scp -r zookeeper-3.4.8 [email protected]: PWD scp − rzookeeper − 3.4.8 root @ 10.9.130.83: PWD scp -r zookeeper-3.4.8 [email protected] :PWDscp−rzookeeper−3.4.8root@10.9.130.83: PWD
cloud host password: tarena2017Up; - Modify the myid of the other two cloud hosts
cd /home/software/zookeeper-3.4.8/tmp
vim myid
to change the number to the number corresponding to the current cloud host - Start Zookeeper
cd /home/software/zookeeper-3.4.8/bin
sh zkServer.sh start - Check the status of the Zookeeper node
sh zkServer.sh status
If there is 1 leader+2 followers, it means the startup is successful
Zookeeper fully distributed installation step tutorial
Guess you like
Origin blog.csdn.net/qq_41536934/article/details/113984883
Recommended
Ranking