-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
268 lines (252 loc) · 6.64 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
version: '3'
services:
zookeeper-1:
hostname: zookeeper1
image: confluentinc/cp-zookeeper:7.3.3.arm64
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 12181
ZOOKEEPER_DATA_DIR: /zookeeper/data
ZOOKEEPER_SERVERS: zookeeper1:22888:23888;zookeeper2:32888:33888;zookeeper3:42888:43888
ports:
- "12181:12181"
- "22888:22888"
- "23888:23888"
volumes:
- ./zookeeper/data/1:/zookeeper/data
deploy:
resources:
limits:
cpus: '1'
memory: 2G
zookeeper-2:
hostname: zookeeper2
image: confluentinc/cp-zookeeper:7.3.3.arm64
environment:
ZOOKEEPER_SERVER_ID: 2
ZOOKEEPER_CLIENT_PORT: 22181
ZOOKEEPER_DATA_DIR: /zookeeper/data
ZOOKEEPER_SERVERS: zookeeper1:22888:23888;zookeeper2:32888:33888;zookeeper3:42888:43888
ports:
- "22181:22181"
- "32888:32888"
- "33888:33888"
volumes:
- ./zookeeper/data/2:/zookeeper/data
deploy:
resources:
limits:
cpus: '1'
memory: 2G
zookeeper-3:
hostname: zookeeper3
image: confluentinc/cp-zookeeper:7.3.3.arm64
environment:
ZOOKEEPER_SERVER_ID: 3
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_DATA_DIR: /zookeeper/data
ZOOKEEPER_SERVERS: zookeeper1:22888:23888;zookeeper2:32888:33888;zookeeper3:42888:43888
ports:
- "32181:32181"
- "42888:42888"
- "43888:43888"
volumes:
- ./zookeeper/data/3:/zookeeper/data
deploy:
resources:
limits:
cpus: '1'
memory: 2G
kafka-1:
image: confluentinc/cp-kafka:7.3.3.arm64
hostname: kafka1
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:12181,zookeeper2:22181,zookeeper3:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:19092
KAFKA_LOG_DIRS: /kafka
KAFKA_LOG_RETENTION_MS: 86400000 # 1 day
ports:
- "19092:19092"
volumes:
- ./kafka/logs/1:/kafka
deploy:
resources:
limits:
cpus: '1'
memory: 2G
kafka-2:
image: confluentinc/cp-kafka:7.3.3.arm64
hostname: kafka2
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:12181,zookeeper2:22181,zookeeper3:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29092
KAFKA_LOG_DIRS: /kafka
KAFKA_LOG_RETENTION_MS: 86400000 # 1 day
ports:
- "29092:29092"
volumes:
- ./kafka/logs/2:/kafka
deploy:
resources:
limits:
cpus: '1'
memory: 2G
kafka-3:
image: confluentinc/cp-kafka:7.3.3.arm64
hostname: kafka3
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
environment:
KAFKA_BROKER_ID: 3
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:12181,zookeeper2:22181,zookeeper3:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:39092
KAFKA_LOG_DIRS: /kafka
KAFKA_LOG_RETENTION_MS: 86400000 # 1 day
ports:
- "39092:39092"
volumes:
- ./kafka/logs/3:/kafka
deploy:
resources:
limits:
cpus: '1'
memory: 2G
akhq:
image: tchiotludo/akhq:latest
hostname: akhq
depends_on:
- kafka-1
- kafka-2
- kafka-3
environment:
AKHQ_CONFIGURATION: |
akhq:
connections:
kafka:
properties:
bootstrap.servers: kafka1:19092,kafka2:29092,kafka3:39092
ports:
- "8080:8080"
spark-master:
image: bitnami/spark:latest
container_name: spark-master
ports:
- "8888:8080"
- "7077:7077"
environment:
- SPARK_MODE=master
- SPARK_MASTER_HOST=spark-master
- SPARK_MASTER_PORT=7077
volumes:
- ./spark-streaming:/spark-streaming
- ./kafka:/kafka
deploy:
resources:
limits:
cpus: '1'
memory: 1G
spark-worker-1:
image: bitnami/spark:latest
container_name: spark-worker-1
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark-master:7077
depends_on:
- spark-master
deploy:
resources:
limits:
cpus: '1'
memory: 2G
spark-worker-2:
image: bitnami/spark:latest
container_name: spark-worker-2
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark-master:7077
depends_on:
- spark-master
deploy:
resources:
limits:
cpus: '1'
memory: 2G
spark-worker-3:
image: bitnami/spark:latest
container_name: spark-worker-3
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark-master:7077
depends_on:
- spark-master
deploy:
resources:
limits:
cpus: '1'
memory: 2G
grafana:
image: grafana/grafana-oss:8.2.6
container_name: grafana
restart: unless-stopped
# environment:
# - GF_INSTALL_PLUGINS=hamedkarbasi93-kafka-datasource
# platform: 'linux/amd64' # hamedkarbasi93-kafka-datasource 이 플러그인에서 arm64를 지원하지 않음
ports:
- '3000:3000'
volumes:
- ./visualization/grafana:/var/lib/grafana
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./visualization/prometheus/config:/etc/prometheus
- ./visualization/prometheus/volume:/prometheus
ports:
- "9090:9090"
command: # web.enalbe-lifecycle은 api 재시작없이 설정파일들을 reload 할 수 있게 해줌
- '--web.enable-lifecycle'
- '--config.file=/etc/prometheus/prometheus.yml'
restart: unless-stopped
kafka-exporter:
image: danielqsj/kafka-exporter:latest
container_name: kafka-exporter
ports:
- "9308:9308"
command:
- --kafka.server=kafka1:19092
- --kafka.server=kafka2:29092
- --kafka.server=kafka3:39092
influxdb:
image: influxdb:2.7-alpine
container_name: influxdb
ports:
- "8086:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: "setup"
DOCKER_INFLUXDB_INIT_USERNAME: "admin"
DOCKER_INFLUXDB_INIT_PASSWORD: "12341234"
DOCKER_INFLUXDB_INIT_ORG: "log-streaming"
DOCKER_INFLUXDB_INIT_BUCKET: "dashboard"
DOCKER_INFLUXDB_INIT_RETENTION: "1w"
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: "sample-token"
volumes:
- ./influxdb-data:/var/lib/influxdb
kafka-influxdb-consumer:
container_name: kafka-influxdb-consumer
build:
context: kafka-influxdb-consumer
volumes:
- ./kafka-influxdb-consumer:/app
command: go run main.go