DevOps | Cloud | Analytics | Open Source | Programming

How To Fix - Leader Not Available in Kafka Console Producer

This post explains How To Fix - Leader Not Available in Kafka Console Producer

Issue :

  • While producing message from CLI console , Kafka Gives below error -

LEADER\_NOT\_AVAILABLE} (org.apache.kafka.clients.NetworkClient)

Reason :

  • Possibly the Kafka producer is trying to identify the leader for a given partition . In this process it tries to access below two property flags and tries to connect to them . However if these settings are not configured correctly it then may think that the leader is unavailable. 


  • Please note - if is not configured , Kafka will use And the is configured in file.

Fix 1 - For Local Set-up :

  • Make below changes to the file

port = 9092 = localhost or
listeners = PLAINTEXT://


Fix 2: Multi Node Setup :

listeners = PLAINTEXT://

  Hope this helps - to Fix - Leader Not Available in Kafka Console Producer.   Additional Read -


leader not available kafka in console consumer, kafkacat broker: leader not available, leader not available kafka consumer, kafka producer error unknown_topic_or_partition, error while fetching metadata with correlation id leader_not_available consumer, failed to find leader in broker response giving up, embedded kafka leader_not_available, 1 partitions have leader brokers without a matching listener,