Invalid Config, Exiting abnormally when launching zookeper from Kafka tutorial
Asked Answered
Q

9

16

I'm following this tutorial trying to set up kafka,

https://kafka.apache.org/quickstart

And I get this error when doing the part on zookeeper. It certainly has something to do with the config, but I don't understand to what extend.

bin/zookeeper-server-start.sh config/server.properties
[2018-03-17 03:27:11,623] INFO Reading configuration from: config/server.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2018-03-17 03:27:11,628] ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing config/server.properties
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:154)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.lang.NumberFormatException: For input string: "initial.rebalance.delay.ms"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Long.parseLong(Long.java:589)
    at java.lang.Long.parseLong(Long.java:631)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:242)
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:150)
    ... 2 more
Invalid config, exiting abnormally
Quartermaster answered 17/3, 2018 at 9:25 Comment(1)
Use fully qualified name if you are on windows. I was facing same issue but it was resolved when I used fully qualified path for batch file & properties file.Phlox
S
24

If you look closely, you'll notice that the command to start Zookeeper is:

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

Using the zookeeper.properties file.

It looks like you copied the command to start Kafka which is using server.properties.

Smallish answered 17/3, 2018 at 10:35 Comment(1)
I do not understand why they use this command if the good one is the one you wrote. It works with your command. Thanks a lotQuartermaster
L
14

I fixed this on Windows by doing below.

Make sure to specify full paths.

First, go to the bin\windows folder of your kafka installation:

C:\kafka_2.12-2.0.0\bin\windows

Then, run the following command:

.\zookeeper-server-start.bat C:\kafka_2.12-2.0.0\config\zookeeper.properties

When done, you will see the following output:

[2020-07-06 20:25:13,703] INFO Server environment:user.dir=C:\kafka_2.12-2.0.0\bin\windows (org.apache.zookeeper.server.ZooKeeperServer)
[2020-07-06 20:25:13,716] INFO tickTime set to 3000 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-07-06 20:25:13,717] INFO minSessionTimeout set to -1 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-07-06 20:25:13,717] INFO maxSessionTimeout set to -1 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-07-06 20:25:13,787] INFO Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory (org.apache.zookeeper.server.ServerCnxnFactory)
[2020-07-06 20:25:13,791] INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory)
Laudatory answered 6/7, 2020 at 15:3 Comment(0)
N
1

You are using following to start the zookeeper:

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

Zookeeper configuration settings are placed in zookeeper.properties file. So, to start zookeeper:

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

And for starting KAFKA server:

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

Keep in mind which file comes with which server.

Nelsonnema answered 13/6, 2020 at 17:44 Comment(0)
W
0

I am facing same issue because I am directly giving step2 command in my terminal,which is wrong. We have to run command of step2 in our Kafka folder. Follow below steps to run zookeeper successfully.

Step1: Goto your kafka folder or simply do cd $KAFKA_HOME

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

Wavawave answered 26/6, 2020 at 2:20 Comment(0)
J
0
  1. check for "dataDir=/tmp/zookeeper1", if not present then create a directory and one file inside this directory myid
mkdir -p /tmp/zookeeper1
chmod -R 777 /tmp/zookeeper1
vi /tmp/zookeeper1/myid 
(add value as 1, this is server-id from server.1=)  
Jule answered 16/11, 2021 at 4:31 Comment(1)
Hi, I tried to change dataDir from "/tmp/zookeeper" to "/var/lib/zookeeper" which contains a file called myid (didn't alter the text inside though) but the Zookeeper service failed to start with the same error described in the question. What could be wrong?Portamento
P
0

On Window 10, this command solved this issue for me:

C:\kafka_2.13-3.6.0\bin\windows>zookeeper-server-start.bat C:\kafka_2.13-3.6.0\config\zookeeper.properties
Pencil answered 6/11, 2023 at 18:59 Comment(0)
I
0

I resolved it by the following steps,

export KAFKA_HOME=/home/kafka/kafka_2.13-3.7.0/
cd $KAFKA_HOME
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties

Silencing Logs:
bin/zookeeper-server-start.sh config/zookeeper.properties > /dev/null 2>&1 &
bin/kafka-server-start.sh config/server.properties > /dev/null 2>&1 &
Ingenerate answered 29/5 at 8:10 Comment(0)
L
0

I made a spelling mistake of "bin/zookeeper-server-start.sh config/zookeeper.propertie" missing the last character "s", the correct one should be: "bin/zookeeper-server-start.sh config/zookeeper.properties" wish i'll never be this dumb again..

Lycaon answered 21/6 at 2:23 Comment(0)
T
-1

Try to remove config/ , and use the file directly.

e.g.

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

Tympanum answered 20/10, 2018 at 5:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.