Zookeeper issue in setting kafka
Asked Answered
P

13

14

To install kafka , I downloaded the kafka tar folder. To start the server I tried this command :

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

The following error occured on entering the above command:

INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2014-08-21 11:53:55,748] FATAL 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:110)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:99)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:76)
Caused by: java.lang.IllegalArgumentException: config/zookeeper.properties file is missing
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:94)
    ... 2 more
Invalid config, exiting abnormally

Is it that I need to setup zookeeper separately? How could I resolve this?

Preparedness answered 21/8, 2014 at 8:36 Comment(0)
A
15

This is basically because of this
java.lang.IllegalArgumentException: config/zookeeper.properties file is missing

it would be really useful if you could share what exactly have you done so far. Also check if the same file exists at the said location and you are running the command from the correct location .. it is supposed to be run from your $KAFKA_HOME folder (where you've extracted the tar file)

Alidis answered 21/8, 2014 at 9:40 Comment(3)
So far I have only downloaded kafka tar folder and ran the above command. It has zookeeper.properties file inside config folder. Zookeeper file has the following in it: """# the directory where the snapshot is stored. dataDir=/tmp/zookeeper # the port at which the clients will connect clientPort=2181 # disable the per-ip limit on the number of connections since this is a non-production config maxClientCnxns=0 """ Inside /temp I created zookeeper folder. What has to be created inside the folder?Preparedness
from where did you run this? you are supposed to run this from inside your kafka home folder (where you've extracted the tar)Alidis
Thank you.. I was running it inside bin folder of kafka.. That was the mistake.Preparedness
B
22

For Windows:

  1. Go to kafka_2.11-2.0.0\bin\windows folder
  2. Then run zookeeper-server-start.bat ../../config/zookeeper.properties
Banquer answered 16/8, 2018 at 9:56 Comment(1)
Notice that for windows there is a special folder so you need to go up two times ../../ The same for kafka-server-start.sh ../../config/server.propertiesDopey
A
15

This is basically because of this
java.lang.IllegalArgumentException: config/zookeeper.properties file is missing

it would be really useful if you could share what exactly have you done so far. Also check if the same file exists at the said location and you are running the command from the correct location .. it is supposed to be run from your $KAFKA_HOME folder (where you've extracted the tar file)

Alidis answered 21/8, 2014 at 9:40 Comment(3)
So far I have only downloaded kafka tar folder and ran the above command. It has zookeeper.properties file inside config folder. Zookeeper file has the following in it: """# the directory where the snapshot is stored. dataDir=/tmp/zookeeper # the port at which the clients will connect clientPort=2181 # disable the per-ip limit on the number of connections since this is a non-production config maxClientCnxns=0 """ Inside /temp I created zookeeper folder. What has to be created inside the folder?Preparedness
from where did you run this? you are supposed to run this from inside your kafka home folder (where you've extracted the tar)Alidis
Thank you.. I was running it inside bin folder of kafka.. That was the mistake.Preparedness
N
4

I too faced the same issue when I installed kafka from Brew on Macbook

This is happening because the zookeeper.properties file is not in config of bin.

Follow these step.

  1. Enter the command---> cd /usr/local/Cellar/kafka/2.3.0

  2. Enter the command ---->cd libex

  3. Now enter the command--->zookeeper-server-start config/zookeeper.properties

You will get the INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory) Message.

Earlier I was getting this error:

$ zookeeper-server-start config/zookeeper.properties [2019-10-02 14:35:20,159] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig) [2019-10-02 14:35:20,160] 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:156) at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:104) at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:81) Caused by: java.lang.IllegalArgumentException: config/zookeeper.properties file is missing at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:140) ... 2 more Invalid config, exiting abnormally

Nace answered 2/10, 2019 at 9:32 Comment(0)
D
2

I saw when you run the above command it doesn't take config file. So if you Put complete path like c:\Kafka\config\zookeeper.properties... this works.

Dado answered 12/6, 2019 at 17:23 Comment(0)
S
1

I faced the exact same error, and after a while I realized that the reason for the error was, I wasn't able to find the zookeeper.properties file, and that was because the path wasn't correct, I installed kafka through brew so the config folder was created inside libexec, so find where the config directory is and check for zookeeper.properties inside it and give that path.

Salep answered 28/10, 2017 at 20:16 Comment(1)
This fixed me up! Thanks! I didn't know the config file was inside libexec (also installed form homebrew)Nimbus
B
1

This happens because bin/windows is added to the path but kafka/config is not.
Just navigate to your kafka folder and then try to run. I am adding screenshot if it can help.

Before

After

Brig answered 28/7, 2019 at 15:35 Comment(0)
S
0

Had the same issue.

I was following this guide and step 2 mentions to run this command: bin/zookeeper-server-start.sh config/zookeeper.properties I had 2 problems, that first was that I wasn't inside the root directory of the file you untar and the second was that I didn't copy the complete command. Make sure both of them are correct and try again.

Saltcellar answered 9/8, 2018 at 18:46 Comment(0)
F
0

Just make sure that whether /config folder exist or not.

Try to type properties directly. e.g. zookeeper-server-start zookeeper.properties

I installed it with homebrew, it works.

Forsook answered 20/10, 2018 at 5:41 Comment(0)
O
0

You can use Powershell as an alternative to CMD.

Consider myKafka is your kafka home directory, Extract your kafka tar file here. Extracted folder(KafkaDir) will be having ./bin,/config, etc. internal folders.

  1. Now, open Powershell prompt, go to myKafka folder.
  2. Run below command:
.\kafkaDir\bin\windows\zookeeper-server-start.bat
.\kafkaDir\config\zookeeper.properties

Zookeeper will get start.

Ondine answered 24/9, 2019 at 19:42 Comment(0)
K
0

You need to fix the absolute path to:

$KAFKA_HOME/config/zookeeper.properties

For me I used:

$KAFKA_HOME = /usr/local/kafka
Knavery answered 6/4, 2022 at 10:34 Comment(0)
N
0

In \bin\windows\kafka-run-class.bat add the file content

rem Classpath addition for release
for %%i in ("%BASE_DIR%\libs\*") do (
    call :concat "%%i"
)

// Section to Add


rem Classpath addition for LSB style path
if exist %BASE_DIR%\share\java\kafka\* (
    call :concat %BASE_DIR%\share\java\kafka\*
)
**

// Above Section to Add

rem Classpath addition for core
for %%i in ("%BASE_DIR%\core\build\libs\kafka_%SCALA_BINARY_VERSION%*.jar") do (
    call :concat "%%i"
Nonrecognition answered 16/11, 2022 at 20:38 Comment(0)
B
0

I was getting the same error fix with this, to read your config file use ....\config\zookeeper.properties(dot dot \dot dot\config\zookeeper.properties)

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

Bread answered 6/3, 2023 at 15:46 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Edlun
S
-4

Have to run in from Kafka home directory, but you are running from the bin.

Slicker answered 26/9, 2015 at 17:42 Comment(1)
Always add answer which could help somebody, and answer in the context, by reading such meaningless answer you tend to waste others time.The best way to include scripts which you used to run so that others might get evidence what you wrote is meaningful.Turman

© 2022 - 2024 — McMap. All rights reserved.