配置zookeeper,出现诸多如下错误:

Error contacting service. It is probably not running.


could not find or load main class org.apache.zookeeper.server.quorum.quorump

JMX enabled by default
Using config:/home/hadoop/app/zookeeper-3.5.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

找了不少教程,真是修复的心累:

有说JDK问题的,那就检查版本呗;

有说2181端口占用问题的,那就检查端口占用呗;

有说删除pid文件的;

有说删除dataDir=/zookeeperData目录下除myid之外的所有文件,启动zookeeper的;

发现相同的问题,很可能造成的原因各不相同,自然也就没法参考。逐个尝试,最后发现是源头出了错——也就是下载的安装文件问题。

下载地址如下:

http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.5.5/

外网论坛有个人给了答案:

I also get this error when try to run Apache Zookeper v3.5.5 on
Windows:

Error: Could not find or load main class
org.apache.zookeeper.server.quorum.QuorumPeerMain

As said by @Onnonymous, I finish my problem by downloading the
.bin.tar.gz (here) instead of .tar.gz version.

试着下载其中的 .bin.tar.gz ,重新安装,终于没有问题了。

参考链接:https://stackoverflow.com/questions/28484398/starting-zookeeper-cluster-error-could-not-find-or-load-main-class-org-apache?rq=1

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐