运行kafka需要使用Zookeeper,所有你需要先启动一个Zookeeper服务器,我使用kafka自带打包和配置好的Zookeeper。
输入bin/zookeeper-server-start.sh config/zookeeper.properties &
[root@localhost kafka-0.9.0.1-src]# bin/zookeeper-server-start.sh config/zookeeper.properties &
[1] 4213
[root@localhost kafka-0.9.0.1-src]# Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain
报这个错误,我是刚开始接触kafka的,也在网上寻找了半天,无奈还是无解决,所以想请教大神给指导下
服务器的jdk版本不正确,或是环境变量未设置好。
安装了,把自带的jdk卸载了重新安装的jdk7
注意一下是32位还是64位。
echo $JAVA_HOME
java -version
都确认一下
[root@localhost Desktop]# echo $JAVA_HOME [root@localhost Desktop]# java -version java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode) [root@localhost Desktop]#
我
echo $JAVA_HOME
的时候什么也不显示,版本显示64位的/etc/profile # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this # will prevent the need for merging in future updates. export JAVA_HOME=/usr/java/jdk1.7.0_79 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH pathmung e() {
这是环境变量
echo $JAVA_HOME 无值,还未生效。
恩恩,原来是下错kafka了,感谢无名大神的细心指导啊。真心感谢
请问一下最后是怎么解决的
你的答案