docker-compose.yml
version: '3'
services:
# ref: https://hub.docker.com/r/wurstmeister/kafka
zookeeper:
image: zookeeper
hostname: zookeeper
container_name: zookeeper
ports:
- 2181:2181
volumes:
- ~/install/tools/zookeeper/data:/data
- ~/install/tools/zookeeper/datalog:/datalog
kafka:
image: wurstmeister/kafka
container_name: kafka
hostname: kafka
ports:
- "9092:9092"
links:
- zookeeper
environment:
KAFKA_ADVERTISED_HOST_NAME: 192.168.1.5
KAFKA_ADVERTISED_PORT: 9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- ./data/logs:/kafka
- /var/run/docker.sock:/var/run/docker.sock
## 挂载位置(kafka镜像和宿主机器之间时间保持一直)
- /etc/localtime:/etc/localtime
kafka-manager:
image: sheepkiller/kafka-manager
container_name: kafka-manager
ports:
- 9000:9000
environment:
ZK_HOSTS: zookeeper:2181