When I run the console consume script, the following error message is returned: “Error while fetching metadata with correlation id 2 LEADER NOT AVAILABLE.”

Kafka is configured in a three-node cluster configuration.

Where do I begin debugging this issue?

Hi @briank

welcome :slight_smile:

first of all I would try to rule out network issues.
check if you could reach all kafka cluster nodes via telnet or s.th. like that

telnet $public_ip_node_[1-3]:9092

if there’s an issue with one node
check on the node:

  • firewall
  • kafka logs
  • kafka config

could provide more details if needed.


All the servers can communicate with each other. They are all on the same ESXI 6.5 server using the same switch.

The problem I’m seeing seems to be intermittent. Sometimes when I start the producer and consumer it works; other times it does not.

Here’s the exact error message.

[2022-03-25 15:00:05,232] WARN [Consumer clientId=consumer-console-consumer-66317-1, groupId=console-consumer-66317] Error while fetching metadata with correlation id 2 : {debezium-connector-mysql=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)

The interesting thing is this creates a topic named “debezium-connector-mysql” but there is no reference to this topic in any of the configuration.

Here’s my setup document

hi @briank

did you get an error as well or just this warning?
did you adapt the advertised.listenersparameter?

basically Kafka and Kafka connect create topics automatically if not disabled

Kafka broker parameter controlling the behavior

Kafka connect parameter controlling the behavior
topic.creation.enable = true