-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
157 lines (140 loc) · 4.47 KB
/
docker-compose.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: "3.7"
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
networks:
kafka-networks:
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
broker-1:
image: confluentinc/cp-kafka:7.5.0
hostname: broker-1
container_name: broker-1
depends_on:
- zookeeper
ports:
- "9091:9091"
networks:
kafka-networks:
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://broker-1:9091
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker-1:29092,EXTERNAL://192.168.64.1:9091
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
broker-2:
image: confluentinc/cp-kafka:7.5.0
hostname: broker-2
container_name: broker-2
depends_on:
- zookeeper
ports:
- "9092:9092"
networks:
kafka-networks:
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://broker-2:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker-2:29092,EXTERNAL://192.168.64.1:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
broker-3:
image: confluentinc/cp-kafka:7.5.0
hostname: broker-3
container_name: broker-3
depends_on:
- zookeeper
ports:
- "9093:9093"
networks:
kafka-networks:
environment:
KAFKA_BROKER_ID: 3
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://broker-3:9093
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker-3:29092,EXTERNAL://192.168.64.1:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
broker-4:
image: confluentinc/cp-kafka:7.5.0
hostname: broker-4
container_name: broker-4
depends_on:
- zookeeper
ports:
- "9094:9094"
networks:
kafka-networks:
environment:
KAFKA_BROKER_ID: 4
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://broker-4:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker-4:29092,EXTERNAL://192.168.64.1:9094
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
broker-5:
image: confluentinc/cp-kafka:7.5.0
hostname: broker-5
container_name: broker-5
depends_on:
- zookeeper
ports:
- "9095:9095"
networks:
kafka-networks:
environment:
KAFKA_BROKER_ID: 5
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://broker-5:9095
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker-5:29092,EXTERNAL://192.168.64.1:9095
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
# kafka-ui:
# container_name: kafka-ui
# image: provectuslabs/kafka-ui:latest
# volumes:
# - ./kafka/ui/config.yml:/etc/kafkaui/dynamic_config.yaml
# environment:
# DYNAMIC_CONFIG_ENABLED: 'true'
# depends_on:
# - kafka-1
# - kafka-2
# - kafka-3
# - kafka-4
# - kafka-5
# networks:
# - kafka-networks
# ports:
# - '8080:8080'
# healthcheck:
# test: wget --no-verbose --tries=1 --spider localhost:8080 || exit 1
# interval: 5s
# timeout: 10s
# retries: 3
# start_period: 30s
networks:
kafka-networks:
driver: bridge
name: kafka-networks
external: false #to use an existing network
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1