0

i tried to run zookeeper on windows using the following command

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

and i got this error

     INFO Reading configuration from: config\zookeeper.properties 
     (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
     [2022-03-01 00:06:37,850] WARN config\zookeeper.properties is relative. Prepend .\ to 
     indicate that you're sure! (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
     [2022-03-01 00:06:37,850] ERROR Invalid config, exiting abnormally 
     (org.apache.zookeeper.server.quorum.QuorumPeerMain)
     org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing 
     config\zookeeper.properties
        at 
     org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:198)
        at 
     org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:124)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90)
Caused by: java.lang.IllegalArgumentException: config\zookeeper.properties file is missing
        at 
  org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFile Factory.java:54)
        at 
 org.apache.zookeeper.server.util.VerifyingFileFactory.validate(VerifyingFileFactory.java:47)
        at 
   
   
   
  org.apache.zookeeper.server.util.VerifyingFileFactory.create(VerifyingFileFactory.java:39)
        at 
    org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:180)
        ... 2 more
    Invalid config, exiting abnormally
    [2022-03-01 00:06:37,853] INFO ZooKeeper audit is disabled. 
    (org.apache.zookeeper.audit.ZKAuditProvider)
    [2022-03-01 00:06:37,855] ERROR Exiting JVM with code 2 
    (org.apache.zookeeper.util.ServiceUtils)
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

4 Answers4

2

The error message already tell you what went wrong

Caused by: java.lang.IllegalArgumentException: config\zookeeper.properties file is missing at org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFile Factory.java:54)

It's raising error because it cannot load the zookeeper.properties file when running zookeeper.

Kafka bat files for Windows is one folder nested inside windows folder, so you need to step out twice with ..\ to point to the config directory. enter image description here

This should work for you

kafka_2.13-3.1.0\bin\windows> .\zookeeper-server-start.bat ..\..\config\zookeeper.properties

And same thing, to start kafka server afterward

kafka_2.13-3.1.0\bin\windows> .\kafka-server-start.bat ..\..\config\server.properties

These commands should point to the zookeeper.properties and server.properties inside config directory of kafka at kafka_2.13-3.1.0\config

Assuming that you didn't modify/moving the default config directory of Kafka

ThangLeQuoc
  • 2,272
  • 2
  • 19
  • 30
  • zookeeper is runnig but kafka server is shutting down INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient) INFO Session: 0x1000003f9f80002 closed INFO EventThread shut down for session: 0x1000003f9f80002 (org.apache.zookeeper.ClientCnxn) INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient) INFO App info kafka.server for 0 unregistered (org.apache.kafka.common.utils.AppInfoParser) INFO shut down completed (kafka.server.KafkaServer) ERROR Exiting Kafka. (kafka.Kafka$) INFO shutting down (kafka.server.KafkaServer) – moazmahmoud saad Mar 01 '22 at 18:55
0

Here I'm on windows, I had to change the bars to work:

from:

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

to:

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

Hope this help you!

0

This should work: First, your directory should be on the Kafka folder just before the bin directory on both steps:

To start zookeeper:

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

To start the kafka server:

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

0

this cmd works for me in windows.

C:\kafka\bin\windows>zookeeper-server-start ../../config/zookeeper.properties

or try this (I guess you set your environment variable)

C:\kafka>zookeeper-server-start.bat config/zookeeper.properties
Ait Friha Zaid
  • 1,222
  • 1
  • 13
  • 20