LEADER_NOT_AVAILABLE error in wurstmeister kafka

Viewed 5921

Im trying to setup a kafka cluster using the below link.

https://github.com/wurstmeister/kafka-docker

and when I try to produce some msg I get this below error.

[2017-09-20 17:00:53,160] WARN Error while fetching metadata with correlation id 3 : {topic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)

Now, I tried to edit the server.properties and set the value

advertised.listeners=PLAINTEXT://192.168.1.162:9092

to set my hostname and port number.

When I try to stop and start the kafka server I get the following error -

bash-4.3# ./kafka-server-stop.sh 
No kafka server to stop

Im successfully able to create a topic

bash-4.3# $KAFKA_HOME/bin/kafka-topics.sh --create --topic topic1 \
> --partitions 4 --zookeeper $ZK --replication-factor 2
Created topic "topic1".

How can I restart kafka to implement server.properties changes.

1 Answers

I got same problem like you and I added

KAFKA_ADVERTISED_LISTENERS: <ip address kafka listener>

in docker-compose.yml section environtment:

It'work !!!!!

Related