services:
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- "8080:8080"
environment:
DYNAMIC_CONFIG_ENABLED: "true"
volumes:
- ~/kui:/etc/kafkaui
extra_hosts:
- "kafka1:10.10.33.30"
- "kafka2:10.10.33.31"
- "kafka3:10.10.33.32"
container_name:容器名
ports:端口映射
DYNAMIC_CONFIG_ENABLED: "true“——启用动态配置
volumes:目录挂载(在这个目录下会保存修改后的配置文件)
extra_hosts:hosts配置,要和kafka集群一致
chmod 666 ~/kui
docker-compose up -d
打开页面,添加你的集群,就OK了