Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kafka Missing required configuration "zookeeper.connect" which has no default value

Tags:

apache-kafka

I setup kafka cluster in vm.

but i have a problem.

My kafka version is kafka 2.11-0.0.0

 $ bin/kafka-server-start.sh config/zookeeper.properties 
[2017-01-31 09:15:55,216] FATAL  (kafka.Kafka$)
org.apache.kafka.common.config.ConfigException: Missing required configuration "zookeeper.connect" which has no default value.
    at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:148)
    at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:49)
    at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:56)
    at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:702)
    at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:691)
    at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28)
    at kafka.Kafka$.main(Kafka.scala:58)
    at kafka.Kafka.main(Kafka.scala)

please help me .

my zookeeper.properties (down)


zookeeper.properties

dataDir=/home/kafka01/zookeeper-data
# 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
initLimit=5
syncLimit=2
server.1=kafka01:2888:3888
server.2=kafka02:2888:3888
server.3=kafka03:2888:3888

server.properties

zookeeper.connect=kafka01:2181,kafka02:2181,kafka03:2181

what is the problem??

like image 834
Morriskim Avatar asked Jan 31 '17 08:01

Morriskim


3 Answers

You are trying to start a kafka server but you are passing the wrong config file.

Usually you want to start a kafka server using the following command:

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

And is in this file where you specify the address of the zookeeper:

zookeeper.connect=kafka01:2181,kafka02:2181,kafka03:2181

The quickstart guide in the kafka official documentation is quite good, I recommend you to have a look at it. You can find it here.

like image 98
jose.goncabel Avatar answered Nov 18 '22 22:11

jose.goncabel


You stared the wrong script. It should be:
bin/zookeeper-server-start.sh config/zookeeper.properties

like image 37
Chang Shu Avatar answered Nov 18 '22 21:11

Chang Shu


You are trying to start kafka server with zookeeper config properties file and that's why you are getting the above error.

Use the commands below instead:

Zookeeper:

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

Kafka:

.\bin\windows\kafka-server-start.bat .\config\server.properties
like image 6
Sumit Malpure Avatar answered Nov 18 '22 22:11

Sumit Malpure