Quickstart: Start and manage a Kafka cluster with Docker Compose
masterTo run a Kafka cluster using this project, ensure you have docker-compose installed. Use the following commands to manage the lifecycle of your cluster:
- Start a cluster:
docker-compose up -d - Scale the cluster (e.g., to 3 brokers):
docker-compose scale kafka=3 - Stop the cluster:
docker-compose stop
Important: By default, each broker will receive a new port number and broker ID on restart. If you require stable IDs and ports, use a specific configuration file like docker-compose-single-broker.yml.
docker-compose up -d
docker-compose scale kafka=3
docker-compose stop