Zookeeper fully distributed installation step tutorial

  1. Three nodes need to install JDK
  2. Three nodes need to close the firewall
    service iptables stop
    chkconfig iptables off
  3. The first server enters the software directory
    cd /home/software/
  4. Delete the stand-alone mode of Zookeeper
    rm -rf zookeeper-3.4.8
  5. Turn off Zookeeper's stand-alone mode.
    View through jps, find QuorumPeerMain, and then kill -9 process number
  6. Re-extract
    tar -xvf zookeeper-3.4.8.tar.gz
  7. Enter
    cd zookeeper-3.4.8/conf in the subdirectory conf
  8. Copy
    cp zoo_sample.cfg zoo.cfg
  9. 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
  10. Create a new data directory and enter
    cd…
    mkdir tmp
    cd tmp
  11. 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
  12. 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] :PWDscprzookeeper3.4.8root@10.9.130.83: PWD
    cloud host password: tarena2017Up;
  13. 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
  14. Start Zookeeper
    cd /home/software/zookeeper-3.4.8/bin
    sh zkServer.sh start
  15. Check the status of the Zookeeper node
    sh zkServer.sh status
    If there is 1 leader+2 followers, it means the startup is successful

Guess you like

Origin blog.csdn.net/qq_41536934/article/details/113984883