📅  最后修改于: 2022-03-11 14:58:32.249000             🧑  作者: Mango
### ===================
### ZOOKEEPER SERVICE
### ===================
zookeeper:
image: confluentinc/cp-zookeeper:latest
restart: "always"
environment:
- ZOOKEEPER_SERVER_ID=1
- ZOOKEEPER_CLIENT_PORT=2181
- ZOOKEEPER_TICK_TIMES=2000
- ZOOKEEPER_INIT_LIMIT=5
- ZOOKEEPER_SYNC_LIMIT=2
ports:
- 2181:2181
volumes:
- zk-data:/var/lib/zookeper/data
networks:
- docker_networks
### ====================
### KAFKA SERVICE
### ====================
kafka:
image: confluentinc/cp-kafka:latest
restart: "always"
environment:
- KAFKA_BROKER_ID=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
ports:
- 9092:9092
volumes:
- kf-data:/var/lib/kafka/data
networks:
- docker_networks
depends_on:
- zookeeper