-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose-kafka.yml
38 lines (38 loc) · 1.14 KB
/
docker-compose-kafka.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
services:
kafka:
image: bitnami/kafka:3.5.1
container_name: kafka
volumes:
## 挂载位置(kafka镜像和宿主机器之间时间保持一致)
- /etc/localtime:/etc/localtime
- ./kafka/data:/bitnami/kafka
environment:
# KRaft settings
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
# Listeners
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
ports:
- "9092:9092"
networks:
- net-kafka
kafka-ui:
image: kafbat/kafka-ui:v1.0.0
container_name: kafka-ui
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
# 支持动态添加集群
DYNAMIC_CONFIG_ENABLED: true
ports:
- "9999:8080"
networks:
- net-kafka
networks:
net-kafka:
driver: bridge