windowsapache-zookeeper

Apache Zookeeper 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.


Solution

  • 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