This repository provides a Docker Compose configuration to run Apache Kafka and Zookeeper using Bitnami images. Additionally, it includes Kafdrop, a web-based UI for monitoring Kafka topics.
- Zookeeper: Manages Kafka brokers.
- Kafka: A distributed event streaming platform.
- Kafdrop: Web UI for managing Kafka topics.
Ensure you have the following installed:
docker-compose up -d
docker-compose down
Service | Description | Port |
---|---|---|
Zookeeper | Kafka coordination service | 2181 |
Kafka | Event streaming platform | 9092 (External) / 29092 (Internal) |
Kafdrop | Web UI for Kafka monitoring | 9000 |
Open Kafdrop in your browser:
http://localhost:9000
- Kafka uses Zookeeper for broker coordination.
- Listeners are configured for internal (29092) and external (9092) communication.
- Kafdrop connects to Kafka via the internal broker port.
docker exec -it $(docker ps --filter "name=kafka" --format "{{.ID}}") kafka-topics.sh --bootstrap-server localhost:9092 --list
docker exec -it $(docker ps --filter "name=kafka" --format "{{.ID}}") kafka-topics.sh --bootstrap-server localhost:9092 --create --topic my-topic --partitions 1 --replication-factor 1
docker exec -it $(docker ps --filter "name=kafka" --format "{{.ID}}") kafka-console-producer.sh --broker-list localhost:9092 --topic my-topic
(Type a message and press Enter to send.)
docker exec -it $(docker ps --filter "name=kafka" --format "{{.ID}}") kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my-topic --from-beginning
docker-compose restart kafka zookeeper
docker-compose down -v
This project is open-source and available under the me.