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

后端 未结 14 785
盖世英雄少女心
盖世英雄少女心 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:23

    The solution for windows OS is to do the following:

    1. Download the binary version instead of the source version from the official website of Apache Kafka.
    2. Make sure the JAVA_HOME environment variable does not have a space in it (by default it is installed in Program files), follow the official installation documentation for this. https://docs.oracle.com/cd/E39271_01/general.300/eid_getting_started/src/tgs_install_jdk.html.
    3. Make sure the JRE path and KAFKA_HOME path do not have spaces in them as well.
    4. Run the zookeeper before starting Kafka.
    0 讨论(0)
  • 2020-12-05 08:23

    I am using below mention command in windows environment.

    Confluent_home\bin\windows> zookeeper-server-start.bat ..\..\etc\kafka\zookeeper.properties
    

    if still you are getting the same error, then please verify you folder structure, Is there any space between folder name if yes then replace with either "_" or removed completely.

    I was also facing the same error.

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

    First Thing: Remove all blank space from the folder name. Second Thing: Use Powershell

    Wrong Path:

    d:\kafka node> .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
    

    Correct Path

    d:\kafka_node> .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
    

    Thanks & Regards Jaiswar Vipin Kumar R.

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

    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

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

    I used to meet the issue by running below cmd via git bash tool.

    bin/zookeeper-server-start.sh config/zookeeper.properties
    

    Solution: I switched to cygwin tool (http://cygwin.com/) to run the same cmd and I did not see the issue any more.

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

    Its bit weird. But replacing the root folder name to Kafka resolved my issue. It might help one or others.

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