KAFKA_CFG_LISTENERS must include a listener for CONTROLLER – Apache-kafka

by
Ali Hasan
apache-kafka kraft

Quick Fix: Update the KAFKA_CFG_LISTENERS environment variable to include a listener for the CONTROLLER. For example:

KAFKA_CFG_LISTENERS=CLIENT://:9092,CONTROLLER://:9093

The Solutions:

Solution 1: Use `KAFKA_ENABLE_KRAFT` environment variable

The Bitnami Kafka image tag 3.4 defaults to starting Kafka in Kraft mode. To revert back to Zookeeper, add this to your environment variables in docker-compose.yml:
“`
KAFKA_ENABLE_KRAFT=no
“`

Q&A

What changed in the latest Bitnami Kafka tag?

Bitnami Kafka tag 3.4 now defaults to start Kafka in Kraft mode, requiring a Raft controller (not Zookeeper) and a defined listener named CONTROLLER.

Why did deleting Docker images affect the Kafka setup?

Deleting Docker images does not necessitate a fresh start for everything; a working Compose file could have been retained.