且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法找到或加载主类org.apache.zookeeper.server.quorum.QuorumPeerMain

更新时间:2021-10-01 19:28:50

也许你的类路径制造麻烦。错误说,它可能无法加载QuorumPeerMain类。这个类将在zookeeper-(版本)的.jar。确保罐子可在libs文件夹,并确保您所指出的lib文件夹中的类路径中。显然,类路径指向的bin / kafka-run-class.sh。在年底kafka-run-class.sh你会发现一个行

Probably your class path is making trouble. The error says it could not able to load the QuorumPeerMain class. This class will be available at zookeeper-(version).jar. Make sure the jar is available at libs folder and also make sure that you have pointed lib folder in the classpath. Obviously the class path is pointed in the bin/kafka-run-class.sh. In the kafka-run-class.sh at the end you will find a line

if [ "x$DAEMON_MODE" = "xtrue" ]; then

上面的行之前添加一条语句 回声$ CLASSPATH 。现在尝试启动。所以,你可以查找字符串传递到classpath中。它应该包含:./../库/ zookeeper-(版本)的.jar: lib文件夹中找到的版本应该匹配的字符串。默认情况下它会很好地工作。我觉得有些已更改下载的文件。如果这样,那么这无疑将会开始。

add a statement echo $CLASSPATH before the above line. Now try to start. So that you can find what string is passing to the classpath. It should contain :./../libs/zookeeper-(version).jar: The version found in the lib folder should match with the string. By default it will work perfectly. I think some one has changed your downloaded file. If it so then surely it will start.

或尝试在下面的链接中的步骤prescribed,它为我工作

or try the steps prescribed in the below link, It worked for me

http://kafka.apache.org/07/quickstart.html一>

http://kafka.apache.org/07/quickstart.html