-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-kafka.yml
90 lines (89 loc) · 2.5 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
version: "3.8"
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
hostname: zookeeper
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
volumes:
- ./deploy/kafka/zookeeper-data:/data
- ./deploy/kafka/zookeeper-datalog:/datalog
networks:
- kafka
broker_a:
image: confluentinc/cp-kafka:7.3.0
container_name: broker_a
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker_a:9092,CONNECTIONS_FROM_HOST://localhost:19091
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONNECTIONS_FROM_HOST:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
KAFKA_DEFAULT_REPLICATION_FACTOR: 3
networks:
- kafka
ports:
- "19091:19091"
volumes:
- kafka_data_a:/var/lib/kafka/data
broker_b:
image: confluentinc/cp-kafka:7.3.0
container_name: broker_b
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker_b:9092,CONNECTIONS_FROM_HOST://localhost:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONNECTIONS_FROM_HOST:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
KAFKA_DEFAULT_REPLICATION_FACTOR: 3
networks:
- kafka
ports:
- "19092:19092"
volumes:
- kafka_data_b:/var/lib/kafka/data
broker_c:
image: confluentinc/cp-kafka:7.3.0
container_name: broker_c
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 3
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker_c:9092,CONNECTIONS_FROM_HOST://localhost:19093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONNECTIONS_FROM_HOST:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
KAFKA_DEFAULT_REPLICATION_FACTOR: 3
ports:
- "19093:19093"
volumes:
- kafka_data_c:/var/lib/kafka/data
networks:
- kafka
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
ports:
- 8080:8080
environment:
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=broker_a:9092
- KAFKA_CLUSTERS_0_READONLY=true
depends_on:
- zookeeper
- broker_a
- broker_b
- broker_c
networks:
- kafka
volumes:
kafka_data_a:
kafka_data_b:
kafka_data_c:
networks:
kafka:
name: kafka