天天看點

安裝運作zookeeper的坑

從官網下載下傳zookeeper的位址中有倆檔案

一個是apache-zookeeper-3.5.5.tar.gz ,另一個是apache-zookeeper-3.5.5-bin.tar.gz

若是使用前者,運作的話會報錯:Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain

通過檢視解壓縮後的檔案README.md,可以知道

apache-zookeeper-[version].tar.gz

        Contains all the source files which can be built by running:
        mvn clean install

        To generate an aggregated apidocs for zookeeper-server and zookeeper-jute:
        mvn javadoc:aggregate
        (generated files will be at target/site/apidocs)

           

還需要安裝maven,然後再運作

mvn clean install

mvn javadoc:aggregate

,前一個指令會下載下傳安裝好多jar包,不知道要花多長時間

另外可知

apache-zookeeper-[version]-bin.tar.gz

        Contains all the jar files required to run ZooKeeper
        Full documentation can also be found in the docs folder

           

帶bin的這個檔案已經自帶所需要的各種jar包,不用再安裝了

果斷使用這個apache-zookeeper-3.5.5-bin.tar.gz檔案,放棄apache-zookeeper-3.5.5.tar.gz 檔案。