Apache Kafka error on windows - Couldnot find or l

2019-01-17 17:59发布

I just downloaded Kafka 2.8.0 from Apache website, and I am trying to setup using the instructions given on the website. But when I try to start zookeper server, I am getting below error:

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

My environment is Windows 7 64 bit. I tried to follow below e-mail chain: Apache Email Chain . But still it's having same issue. Can anyone guide me in this? As I am very new to this and couldn't find many information on Google/Apache Kafka email chain.

7条回答
We Are One
2楼-- · 2019-01-17 18:09

Just download the binary and follow the steps mentioned in below link. http://kafka.apache.org/07/quickstart.html

if you are facing errors like

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

copy zookeeper.properties from config folder to bin folder and bin/windows folder.

Now start the like
server : run zookeeper-server-start.bat zookeeper.properties

from bin or bin/windows(if you are in window machine). It should work.

If you are still facing problem, below link would be helpful http://blog.anilot.tk/2014/08/06/Set-Up-Kafka-On-Windows/

Now try staring the Kafka server.

use the below command if you are using windows: Goto bin/windows and then run kafka-server-start.bat ../../config/server.properties

if you are trying from shell prompt, goto bin and run below command

kafka-server-start.bat ../config/server.properties 

**Make sure server.properties is present in the config folder

查看更多
别忘想泡老子
3楼-- · 2019-01-17 18:12

Run these commands from your Kafka root folder:

cd bin/windows

Then run Zookeper server:

zookeeper-server-start.bat ../../config/zookeeper.properties

Then run Kafka server:

kafka-server-start.bat ../../config/server.properties


The gotcha here is to run the .bat files from the /bin/windows folder, so after you run your servers with the steps above and want to follow up with the tutorial, make sure you are running the correct batch files to create topics and whatnot, e.g.:

Create a topic:

kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

List topics:

kafka-topics.bat --list --zookeeper localhost:2181

查看更多
可以哭但决不认输i
4楼-- · 2019-01-17 18:12

This problem happened because you have downloaded wrong version of Kafka. On the official page

enter image description here

you have selected Source download. If you will download the binary, everything will work as expected.

查看更多
Summer. ? 凉城
5楼-- · 2019-01-17 18:21

Had the same error message even though I had the correct Kafka download for my Scala version.

It ended up I was running the non-windows sh file (needed to run the bat in the windows sub-folder) and was running from within the bin folder instead of the root. Moving up to the root Kafka folder and running from there appears to have worked.

C:\kafka_2.10-0.8.2.0>bin\windows\zookeeper-server-start.bat config\zookeeper.properties

查看更多
Luminary・发光体
6楼-- · 2019-01-17 18:26

I downloaded latest stable Kafka from Apache and instruction mentioned by Matheus Felipe worked as expected.

I downloaded binary option - Scala 2.11 @ http://kafka.apache.org/downloads

查看更多
Fickle 薄情
7楼-- · 2019-01-17 18:30

I'm running on OS X and I found that having spaces anywhere in the path leading to my Kafka base directory led to this exact error message. Renaming things without spaces solved the problem with no other fix.

As an example, my Kafka install was sitting at /Users/me/Kafka Demo/kafka_2.11-0.9.0.1 which caused that error when I tried to start Zookeeper. All I did was rename things as /Users/me/KafkaDemo/kafka_2.11-0.9.0.1 and everything worked fine.

查看更多
登录 后发表回答