问题描述
启动失败如下:
hadoop@zc-virtual-machine:/usr/local/zookeeper$ ./bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... FAILED TO START
查询日志
hadoop@zc-virtual-machine:/usr/local/zookeeper$ ./bin/zkServer.sh start-foreground
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
错误: 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
问题解决
参考了网上大佬(原文传送门)的解答,似乎是该jar包没有编译,zookeeper从 3.5 版本以后,命名就发生了改变,如果是 apache-zookeeper-3.5.5.tar.gz 这般命名的,都是未编译的,而 apache-zookeeper-3.5.5-bin.tar.gz 这般命名的,才是已编译的包。
之后我就试了试,下载了bin版的,安装配置之后,成功启动。
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED