从快速入门页面运行kafka的说明对我不起作用.
http://kafka.apache.org/07/quickstart.html
卡夫卡很好
05:55:01/kafka-0.8.1-src:58 $sbt package [info] Set current project to kafka-0-8-1-src (in build file:/shared/kafka-0.8.1-src/) [info] Packaging /shared/kafka-0.8.1-src/target/scala-2.10/kafka-0-8-1-src_2.10-0.1-SNAPSHOT.jar ... [info] Done packaging. [success] Total time: 0 s, completed Apr 17, 2014 5:55:07 AM
但是运行不好..
05:55:07/kafka-0.8.1-src:59 $bin/zookeeper-server-start.sh config/zookeeper.properties Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/zookeeper/server/quorum/QuorumPeerMain Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.server.quorum.QuorumPeerMain at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
kafka-server-start.sh和bin中的所有其他脚本也会发生类似的错误
您从下载页面下载了kafka-0.8.1-src.tgz.快速入门链接上的说明适用于二进制下载.从http://kafka.apache.org/downloads.html页面的二进制下载部分下载一个.现在试试.它应该工作.
或者,如果要从下载的src.tgz包构建,则运行./gradlew jar
.它将下载所有必需的依赖项.