This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
608 lines (575 loc) · 16.6 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
version: "2.3"
services:
postgres:
image: bigdata-postgres:0.2
container_name: postgres
hostname: postgres.bigdatacluster
mem_limit: ${POSTGRES_DB_MEM_LIM}
mem_reservation: ${POSTGRES_DB_MEM_RES}
volumes:
- postgres_pgdata:/var/lib/postgresql/data/pgdata
networks:
bigdatacluster:
aliases:
- postgres.bigdatacluster.com
redis:
image: bigdata-redis:0.2
container_name: redis
hostname: redis.bigdatacluster
mem_limit: ${REDIS_MEM_LIM}
mem_reservation: ${REDIS_MEM_RES}
volumes:
- redis_data:/data
networks:
bigdatacluster:
aliases:
- redis.bigdatacluster.com
command: redis-server
zknode1:
image: zookeeper
container_name: zknode1
hostname: zknode1.bigdatacluster
mem_limit: ${ZOOKEEPER_MEM_LIM}
mem_reservation: ${ZOOKEEPER_MEM_RES}
volumes:
- zknode1_data:/data
- zknode1_log:/datalog
networks:
bigdatacluster:
aliases:
- zknode1.bigdatacluster.com
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zknode1.bigdatacluster:2888:3888 server.2=zknode2.bigdatacluster:2888:3888 server.3=zknode3.bigdatacluster:2888:3888
healthcheck:
test: ["CMD-SHELL", "netstat -tuplen | grep 2181 || exit 1"]
zknode2:
image: zookeeper
container_name: zknode2
hostname: zknode2.bigdatacluster
mem_limit: ${ZOOKEEPER_MEM_LIM}
mem_reservation: ${ZOOKEEPER_MEM_RES}
volumes:
- zknode2_data:/data
- zknode2_log:/datalog
networks:
bigdatacluster:
aliases:
- zknode2.bigdatacluster.com
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zknode1.bigdatacluster:2888:3888 server.2=zknode2.bigdatacluster:2888:3888 server.3=zknode3.bigdatacluster:2888:3888
healthcheck:
test: ["CMD-SHELL", "netstat -tuplen | grep 2181 || exit 1"]
zknode3:
image: zookeeper
container_name: zknode3
hostname: zknode3.bigdatacluster
mem_limit: ${ZOOKEEPER_MEM_LIM}
mem_reservation: ${ZOOKEEPER_MEM_RES}
volumes:
- zknode3_data:/data
- zknode3_log:/datalog
networks:
bigdatacluster:
aliases:
- zknode3.bigdatacluster.com
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zknode1.bigdatacluster:2888:3888 server.2=zknode2.bigdatacluster:2888:3888 server.3=zknode3.bigdatacluster:2888:3888
healthcheck:
test: ["CMD-SHELL", "netstat -tuplen | grep 2181 || exit 1"]
kafka1:
image: bigdata-kafka:0.2
container_name: kafka1
hostname: kafka1.bigdatacluster
mem_limit: ${KAFKA_MEM_LIM}
mem_reservation: ${KAFKA_MEM_RES}
networks:
bigdatacluster:
aliases:
- kafka1.bigdatacluster.com
depends_on:
- zknode1
- zknode2
- zknode3
environment:
KAFKA_HOST: kafka1.bigdatacluster
KAFKA_PORT: 9092
ZOOKEEPER_CONNECT: zknode1.bigdatacluster:2181,zknode2.bigdatacluster:2181,zknode3.bigdatacluster:2181
KAFKA_ID: 0
kafka2:
image: bigdata-kafka:0.2
container_name: kafka2
hostname: kafka2.bigdatacluster
mem_limit: ${KAFKA_MEM_LIM}
mem_reservation: ${KAFKA_MEM_RES}
networks:
bigdatacluster:
aliases:
- kafka2.bigdatacluster.com
depends_on:
- zknode1
- zknode2
- zknode3
environment:
KAFKA_HOST: kafka2.bigdatacluster
KAFKA_PORT: 9092
ZOOKEEPER_CONNECT: zknode1.bigdatacluster:2181,zknode2.bigdatacluster:2181,zknode3.bigdatacluster:2181
KAFKA_ID: 1
kafka3:
image: bigdata-kafka:0.2
container_name: kafka3
hostname: kafka3.bigdatacluster
mem_limit: ${KAFKA_MEM_LIM}
mem_reservation: ${KAFKA_MEM_RES}
networks:
bigdatacluster:
aliases:
- kafka3.bigdatacluster.com
depends_on:
- zknode1
- zknode2
- zknode3
environment:
KAFKA_HOST: kafka3.bigdatacluster
KAFKA_PORT: 9092
ZOOKEEPER_CONNECT: zknode1.bigdatacluster:2181,zknode2.bigdatacluster:2181,zknode3.bigdatacluster:2181
KAFKA_ID: 2
nginx:
image: nginx
container_name: nginx
hostname: nginx.bigdatacluster
mem_limit: ${NGINX_MEM_LIM}
mem_reservation: ${NGINX_MEM_RES}
networks:
bigdatacluster:
aliases:
- nginx.bigdatacluster.com
ports:
- "80:80"
- "8042:8042"
- "8080:8080"
- "8081:8081"
- "8088:8088"
- "8188:8188"
- "8793:8793"
- "9090:9090"
- "10002:10002"
- "50070:50070"
- "50075:50075"
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- hadoop-namenode
- hadoop-datanode1
- hadoop-datanode2
- hadoop-datanode3
- yarn-historyserver
- yarn-resourcemanager
- yarn-nodemanager1
- yarn-nodemanager2
- yarn-nodemanager3
- spark-master
- spark-worker1
- spark-worker2
- spark-worker3
- airflow-webui
- airflow-worker1
airflow-webui:
image: airflow-webui:0.2
container_name: airflow-webui
hostname: airflow-webui.bigdatacluster
mem_limit: ${AIRFLOW_WEB_MEM_LIM}
mem_reservation: ${AIRFLOW_WEB_MEM_RES}
volumes:
- airflow_dag:/usr/local/airflow/dags
- airflow_log:/usr/local/airflow/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
bigdatacluster:
aliases:
- airflowwebui.bigdatacluster.com
environment:
- CLUSTER_NAME=bigdatacluster
env_file:
- ./bigdata-cluster.env
user: "1000"
command: webserver
airflow-scheduler:
image: airflow-scheduler:0.2
container_name: airflow-scheduler
hostname: airflow-scheduler.bigdatacluster
mem_limit: ${AIRFLOW_SCH_MEM_LIM}
mem_reservation: ${AIRFLOW_SCH_MEM_RES}
volumes:
- airflow_dag:/usr/local/airflow/dags
- airflow_log:/usr/local/airflow/logs
depends_on:
airflow-webui:
condition: service_healthy
networks:
bigdatacluster:
aliases:
- airflowscheduler.bigdatacluster.com
environment:
- CLUSTER_NAME=bigdatacluster
env_file:
- ./bigdata-cluster.env
user: "1000"
command: scheduler
airflow-worker1:
image: airflow-worker:0.2
container_name: airflow-worker1
hostname: airflow-worker1.bigdatacluster
mem_limit: ${AIRFLOW_WRK_MEM_LIM}
mem_reservation: ${AIRFLOW_WRK_MEM_RES}
volumes:
- airflow_dag:/usr/local/airflow/dags
- airflow_log:/usr/local/airflow/logs
depends_on:
airflow-scheduler:
condition: service_healthy
networks:
bigdatacluster:
aliases:
- airflowworker1.bigdatacluster.com
environment:
- CLUSTER_NAME=bigdatacluster
env_file:
- ./bigdata-cluster.env
user: "1000"
command: worker
hadoop-namenode:
image: hadoop-namenode:0.2
container_name: hadoop-namenode
hostname: hadoop-namenode.bigdatacluster
mem_limit: ${HADOOP_NN_MEM_LIM}
mem_reservation: ${HADOOP_NN_MEM_RES}
volumes:
- hadoop_namenode:/hadoop/dfs/name
networks:
bigdatacluster:
aliases:
- namenode.bigdatacluster.com
environment:
- CLUSTER_NAME=bigdatacluster
env_file:
- ./bigdata-cluster.env
hadoop-datanode1:
image: hadoop-datanode:0.2
container_name: hadoop-datanode1
hostname: hadoop-datanode1.bigdatacluster
mem_limit: ${HADOOP_DN_MEM_LIM}
mem_reservation: ${HADOOP_DN_MEM_RES}
depends_on:
hadoop-namenode :
condition: service_healthy
volumes:
- hadoop_datanode1:/hadoop/dfs/data
networks:
bigdatacluster:
aliases:
- datanode1.bigdatacluster.com
env_file:
- ./bigdata-cluster.env
hadoop-datanode2:
image: hadoop-datanode:0.2
container_name: hadoop-datanode2
hostname: hadoop-datanode2.bigdatacluster
mem_limit: ${HADOOP_DN_MEM_LIM}
mem_reservation: ${HADOOP_DN_MEM_RES}
depends_on:
hadoop-namenode:
condition: service_healthy
volumes:
- hadoop_datanode2:/hadoop/dfs/data
networks:
bigdatacluster:
aliases:
- datanode2.bigdatacluster.com
env_file:
- ./bigdata-cluster.env
hadoop-datanode3:
image: hadoop-datanode:0.2
container_name: hadoop-datanode3
hostname: hadoop-datanode3.bigdatacluster
mem_limit: ${HADOOP_DN_MEM_LIM}
mem_reservation: ${HADOOP_DN_MEM_RES}
depends_on:
hadoop-namenode:
condition: service_healthy
volumes:
- hadoop_datanode3:/hadoop/dfs/data
networks:
bigdatacluster:
aliases:
- datanode3.bigdatacluster.com
env_file:
- ./bigdata-cluster.env
yarn-resourcemanager:
image: yarn-resourcemanager:0.2
container_name: yarn-resourcemanager
hostname: yarn-resourcemanager.bigdatacluster
mem_limit: ${YARN_RM_MEM_LIM}
mem_reservation: ${YARN_RM_MEM_RES}
networks:
bigdatacluster:
aliases:
- resourcemanager.bigdatacluster.com
depends_on:
hadoop-namenode:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
yarn-historyserver:
image: yarn-historyserver:0.2
container_name: yarn-historyserver
hostname: yarn-historyserver.bigdatacluster
mem_limit: ${YARN_HS_MEM_LIM}
mem_reservation: ${YARN_HS_MEM_RES}
depends_on:
yarn-resourcemanager:
condition: service_healthy
volumes:
- hadoop_historyserver:/hadoop/yarn/timeline
networks:
bigdatacluster:
aliases:
- historyserver.bigdatacluster.com
env_file:
- ./bigdata-cluster.env
yarn-nodemanager1:
image: yarn-nodemanager:0.2
container_name: yarn-nodemanager1
hostname: yarn-nodemanager1.bigdatacluster
mem_limit: ${YARN_NM_MEM_LIM}
mem_reservation: ${YARN_NM_MEM_RES}
networks:
bigdatacluster:
aliases:
- nodemanager1.bigdatacluster.com
depends_on:
yarn-resourcemanager:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
yarn-nodemanager2:
image: yarn-nodemanager:0.2
container_name: yarn-nodemanager2
hostname: yarn-nodemanager2.bigdatacluster
mem_limit: ${YARN_NM_MEM_LIM}
mem_reservation: ${YARN_NM_MEM_RES}
networks:
bigdatacluster:
aliases:
- nodemanager2.bigdatacluster.com
depends_on:
yarn-resourcemanager:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
yarn-nodemanager3:
image: yarn-nodemanager:0.2
container_name: yarn-nodemanager3
hostname: yarn-nodemanager3.bigdatacluster
mem_limit: ${YARN_NM_MEM_LIM}
mem_reservation: ${YARN_NM_MEM_RES}
networks:
bigdatacluster:
aliases:
- nodemanager3.bigdatacluster.com
depends_on:
yarn-resourcemanager:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
hive-metastore:
image: hive-metastore:0.2
container_name: hive-metastore
hostname: hive-metastore.bigdatacluster
mem_limit: ${HIVE_MS_MEM_LIM}
mem_reservation: ${HIVE_MS_MEM_RES}
networks:
bigdatacluster:
aliases:
- hivemetastore.bigdatacluster.com
depends_on:
postgres:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
command: /opt/hive/bin/hive --service metastore
hive-server:
image: hive-server:0.2
container_name: hive-server
hostname: hive-server.bigdatacluster
mem_limit: ${HIVE_HS_MEM_LIM}
mem_reservation: ${HIVE_HS_MEM_RES}
networks:
bigdatacluster:
aliases:
- hiveserver.bigdatacluster.com
depends_on:
hive-metastore:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
spark-master:
image: spark-master:0.2
container_name: spark-master
hostname: spark-master.bigdatacluster
mem_limit: ${SPARK_MS_MEM_LIM}
mem_reservation: ${SPARK_MS_MEM_RES}
networks:
bigdatacluster:
aliases:
- sparkmaster.bigdatacluster.com
volumes:
- spark_master_logs:/var/log/spark-master
depends_on:
yarn-resourcemanager:
condition: service_healthy
env_file:
- ./bigdata-cluster.env
spark-worker1:
image: spark-worker:0.2
container_name: spark-worker1
hostname: spark-worker1.bigdatacluster
mem_limit: ${SPARK_WN_MEM_LIM}
mem_reservation: ${SPARK_WN_MEM_RES}
networks:
bigdatacluster:
aliases:
- sparkworker1.bigdatacluster.com
volumes:
- spark_worker1_logs:/var/log/spark-worker
depends_on:
spark-master:
condition: service_healthy
environment:
- SPARK_MASTER=sparkmaster.bigdatacluster.com:7077
env_file:
- ./bigdata-cluster.env
spark-worker2:
image: spark-worker:0.2
container_name: spark-worker2
hostname: spark-worker2.bigdatacluster
mem_limit: ${SPARK_WN_MEM_LIM}
mem_reservation: ${SPARK_WN_MEM_RES}
networks:
bigdatacluster:
aliases:
- sparkworker2.bigdatacluster.com
volumes:
- spark_worker2_logs:/var/log/spark-worker
depends_on:
spark-master:
condition: service_healthy
environment:
- SPARK_MASTER=spark://sparkmaster.bigdatacluster.com:7077
env_file:
- ./bigdata-cluster.env
spark-worker3:
image: spark-worker:0.2
container_name: spark-worker3
hostname: spark-worker3.bigdatacluster
mem_limit: ${SPARK_WN_MEM_LIM}
mem_reservation: ${SPARK_WN_MEM_RES}
networks:
bigdatacluster:
aliases:
- sparkworker3.bigdatacluster.com
volumes:
- spark_worker3_logs:/var/log/spark-worker
depends_on:
spark-master:
condition: service_healthy
environment:
- SPARK_MASTER=spark://sparkmaster.bigdatacluster.com:7077
env_file:
- ./bigdata-cluster.env
volumes:
redis_data:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/redis/data
postgres_pgdata:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/postgres/pgdata
airflow_dag:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/airflow/dags
airflow_log:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/airflow/logs
zknode1_data:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/zookeeper/zknode1/data
zknode1_log:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/zookeeper/zknode1/log
zknode2_data:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/zookeeper/zknode2/data
zknode2_log:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/zookeeper/zknode2/log
zknode3_data:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/zookeeper/zknode3/data
zknode3_log:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/zookeeper/zknode3/log
hadoop_namenode:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/hadoop/nn
hadoop_datanode1:
driver: local-persist
driver_opts:
mountpoint: /data2/dockervolumes/hadoop/dn1
hadoop_datanode2:
driver: local-persist
driver_opts:
mountpoint: /data2/dockervolumes/hadoop/dn2
hadoop_datanode3:
driver: local-persist
driver_opts:
mountpoint: /data2/dockervolumes/hadoop/dn3
hadoop_historyserver:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/yarn/hs
spark_master_logs:
driver: local-persist
driver_opts:
mountpoint: /data1/dockervolumes/spark/master/logs
spark_worker1_logs:
driver: local-persist
driver_opts:
mountpoint: /data2/dockervolumes/spark/worker1/logs
spark_worker2_logs:
driver: local-persist
driver_opts:
mountpoint: /data2/dockervolumes/spark/worker2/logs
spark_worker3_logs:
driver: local-persist
driver_opts:
mountpoint: /data2/dockervolumes/spark/worker3/logs
networks:
bigdatacluster:
external: true