Rate This Document
Findability
Accuracy
Completeness
Readability

Installing ZooKeeper

  1. Install dependencies.
    yum install -y wget openssl-devel zlib-devel autoconf automake libtool ant svn make libstdc++-static glibc-static git snappy snappy-devel fuse fuse-devel cppunit-devel net-tools
  2. Download the ZooKeeper installation package.
    1
    2
    3
    cd /home
    wget https://github.com/apache/zookeeper/archive/refs/tags/release-3.4.14.tar.gz --no-check-certificate
    mv release-3.4.14.tar.gz zookeeper-3.4.14.tar.gz
    
  3. Decompress the installation package.
    1
    2
    tar -zxf zookeeper-3.4.14.tar.gz
    mv zookeeper-release-3.4.14 zookeeper-3.4.14
    
  4. Go to the directory generated after the decompression.
    cd /home/zookeeper-3.4.14
  5. The build.xml and ivysettings.xml files need to be modified due to network proxy problems.
    1. Open build.xml.
      vim build.xml
    2. Press i to enter the insert mode, and comment out the lines of downloading and copying ant-eclipse.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Manually download the ant-eclipse-1.0.bin.tar.bz2 source package.
      wget https://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2 --no-check-certificate
      Or
      wget http://ufpr.dl.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2
    5. Copy the ant-eclipse-1.0.bin.tar.bz2 source package to the corresponding path.
      cp ant-eclipse-1.0.bin.tar.bz2 /home/zookeeper-3.4.14/zookeeper-server/src/main/resources
    6. Open the ivysettings.xml file.
      vim ivysettings.xml
    7. Press i to enter the insert mode and change the value of repo.maven.org to https://mirrors.huaweicloud.com/repository/maven/.

    8. Press Esc, type :wq!, and press Enter to save the file and exit.
    9. Modify the repo link in the build.xml file.
      1
      sed -i 's/http:\/\/repo2/https:\/\/repo1/' build.xml
      
  6. Perform the compilation.
    1
    ant package tar
    
  7. View the generated zookeeper-3.4.6.tar.gz package.
    ls build
  8. Move zookeeper-3.4.6.tar.gz to the specified directory and decompress it.
    1
    2
    3
    cp build/zookeeper-3.4.14.tar.gz /opt/
    cd /opt/
    tar -zxvf zookeeper-3.4.14.tar.gz