docker-zk-kafka
docker-zk-kafka
- docker-compose.yml
version: '2'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:2.13-2.7.0
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: 192.168.113.104
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "test:1:3"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
kafka:
image: wurstmeister/kafka:2.13-2.7.0
ports:
- "9093:9092"
- 修改
KAFKA_ADVERTISED_HOST_NAME
为自己主机的IP
docker-compose up -d