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

后端 未结 14 784
盖世英雄少女心
盖世英雄少女心 2020-12-05 07:47

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 gettin

相关标签:
14条回答
  • 2020-12-05 08:15

    I had same problem used zookeeper-3.4.12. bin directory do not has .bat files and windows directory. Just exist .com and .sh files. .com contain operation zookeeper execute. As you can see, that has to find %JAVA%. So I just set JAVA=[my java.exe path]. And it works.

    0 讨论(0)
  • 2020-12-05 08:15

    Yes, I too faced the same problem and tried this way which was suggested in some comments above,

    First I had my Kafka in C:\Program Files, Then I moved the kafka_2.11-2.1.0 folder to C:\ directory and tried the following command and it worked

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

    P.S - ran the zookeper server before starting kafka

    0 讨论(0)
  • 2020-12-05 08:18

    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.

    0 讨论(0)
  • 2020-12-05 08:19

    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
    
    0 讨论(0)
  • 2020-12-05 08:19

    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

    0 讨论(0)
  • 2020-12-05 08:22

    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.

    0 讨论(0)
提交回复
热议问题