Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Kafka error on windows - Couldnot find or load main class QuorumPeerMain

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.

like image 371
Pradeep Simha Avatar asked Jul 30 '14 12:07

Pradeep Simha


3 Answers

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

like image 88
Matheus Felipe Avatar answered Nov 11 '22 12:11

Matheus Felipe


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.

like image 28
Salvador Dali Avatar answered Nov 11 '22 14:11

Salvador Dali


I also got the same problem in Windows platform due to keeping the kafka_2.12-2.3.0 folder in the Program Files. I changed the Kafka directory from Program Files to C:\ drive root directory. It worked fine after executing the following commands:

First, go to the Kafka root folder:

cd C:\kafka_2.12-2.3.0

Run Zookeeper server:

bin\windows\zookeeper-server-start.bat config\zookeeper.properties

Then Run Kafka Server:

bin\windows\kafka-server-start.bat config\server.properties
like image 44
Jagan Kornana Avatar answered Nov 11 '22 13:11

Jagan Kornana