Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LEADER_NOT_AVAILABLE error in wurstmeister kafka

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.

like image 350
user1050619 Avatar asked Oct 30 '22 01:10

user1050619


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 !!!!!

like image 186
ppromsiri Avatar answered Dec 25 '22 03:12

ppromsiri