docker-compose.yml
version: '2'
services:
zookeeper:
image: develop-harbor.geostar.com.cn/3rd/zookeeper:3.5.5
ports:
- "2181:2181"
kafka:
image: develop-harbor.geostar.com.cn/3rd/wurstmeister/kafka:2.12-2.2.1
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: 172.16.20.158
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Start a cluster:
docker-compose up -d
Add more brokers:
docker-compose scale kafka=3
Destroy a cluster:
docker-compose stop