-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathall-docker-compose.yaml
329 lines (310 loc) · 9.74 KB
/
all-docker-compose.yaml
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
version: "3"
services:
# Setting Up HDFS & YARN #
namenode:
image: mrugankray/namenode-spark-airflow-flume-zepplin:1.1
container_name: namenode
restart: always
ports:
- 9870:9870
- 9000:9000
- 8082:8082 # zeppelin ui
- 8080:8080 # spark master web ui
- 8081:8081 # spark slave web ui
- 4040:4040 # spark driver web ui
- 3000:3000 # airflow ui
volumes:
- hadoop_namenode:/hadoop/dfs/name
- hadoop_namenode_conda:/root/anaconda
- hadoop_namenode_spark:/opt/spark
- hadoop_namenode_zeppelin:/opt/zeppelin
- ./configs/zeppelin-site.xml:/opt/zeppelin/conf/zeppelin-site.xml
- ./configs/zeppelin-env.sh:/opt/zeppelin/conf/zeppelin-env.sh
- ./configs/namenode_bashrc.txt:/root/.bashrc
- ./configs/namenode_airflow.cfg:/root/airflow/airflow.cfg
- ./dags:/root/airflow/dags
- airflow_namenode:/root/airflow
- ./configs/namenode/flume/flume-env.sh:/opt/flume/conf/flume-env.sh
- ./flume_config/flume.conf:/opt/flume/conf/flume.conf
- hadoop_namenode_flume:/opt/flume
environment:
- CLUSTER_NAME=hadoop-learning
- CORE_CONF_fs_defaultFS=hdfs://namenode:9000
env_file:
- ./hadoop.env
datanode:
image: mrugankray/datanode-python:1.0
container_name: datanode
restart: always
volumes:
- hadoop_datanode:/hadoop/dfs/data
- hadoop_datanode_conda:/root/anaconda
- ./configs/datanode_bashrc.txt:/root/.bashrc
environment:
SERVICE_PRECONDITION: "namenode:9870"
CORE_CONF_fs_defaultFS: "hdfs://namenode:9000"
ports:
- "9864:9864"
env_file:
- ./hadoop.env
resourcemanager:
image: mrugankray/resourcemanager-python:1.0
container_name: resourcemanager
restart: always
volumes:
- hadoop_resourcemanager_conda:/root/anaconda
- ./configs/resourcemanager_bashrc.txt:/root/.bashrc
environment:
SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864"
ports:
- "8088:8088"
env_file:
- ./hadoop.env
nodemanager:
image: mrugankray/nodemanager-python:1.0
container_name: nodemanager
restart: always
volumes:
- hadoop_nodemanager_conda:/root/anaconda
- ./configs/nodemanager_bashrc.txt:/root/.bashrc
environment:
SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 resourcemanager:8088"
ports:
- "8042:8042"
- "19888:19888" # to access job history
env_file:
- ./hadoop.env
historyserver:
image: bde2020/hadoop-historyserver:2.0.0-hadoop3.2.1-java8
container_name: historyserver
restart: always
environment:
SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 resourcemanager:8088"
ports:
- "8188:8188"
volumes:
- hadoop_historyserver:/hadoop/yarn/timeline
env_file:
- ./hadoop.env
# Setting Kafka cluster #
zookeeper:
image: confluentinc/cp-zookeeper:5.4.0
hostname: zookeeper
container_name: zookeeper
depends_on:
- namenode
- datanode
- resourcemanager
- nodemanager
- historyserver
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
volumes:
- zookeeper_data:/var/lib/zookeeper/data
- zookeeper_log:/var/lib/zookeeper/log
kafka-broker:
image: confluentinc/cp-server:5.4.0
hostname: kafka-broker
container_name: kafka-broker
depends_on:
- zookeeper
ports:
- "29092:29092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: kafka-broker:29092
CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:2181
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
CONFLUENT_METRICS_ENABLE: "true"
CONFLUENT_SUPPORT_CUSTOMER_ID: "anonymous"
volumes:
- kafka_broker:/var/lib/kafka/data
schema-registry:
image: confluentinc/cp-schema-registry:5.4.0
hostname: schema-registry
container_name: schema-registry
depends_on:
- zookeeper
- kafka-broker
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "8083:8083"
environment:
# SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: http://kafka-broker:29092
SCHEMA_REGISTRY_HOST_NAME: schema-registry
# setting SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL to zookeper. schema registry will get kafka server url from zookeper
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"
SCHEMA_REGISTRY_LISTENERS: http://schema-registry:8083
SCHEMA_REGISTRY_KAFKASTORE_ZK_SESSION_TIMEOUT_MS: 300000
SCHEMA_REGISTRY_KAFKASTORE_INIT_TIMEOUT_MS: 300000
kadmin:
image: bettercloud/kadmin:0.9.3
hostname: kadmin
container_name: kadmin
ports:
- "8084:8080"
environment:
ZOOKEEPER_HOST: zookeeper:2181
KAFKA_HOST: kafka-broker:29092
control-center:
image: confluentinc/cp-enterprise-control-center:5.4.0
hostname: control-center
container_name: control-center
depends_on:
- zookeeper
- kafka-broker
- schema-registry
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "9021:9021"
environment:
CONTROL_CENTER_BOOTSTRAP_SERVERS: 'kafka-broker:29092'
CONTROL_CENTER_ZOOKEEPER_CONNECT: 'zookeeper:2181'
CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8083"
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
CONFLUENT_METRICS_TOPIC_REPLICATION: 1
PORT: 9021
# Setting up Hive #
hive-server:
image: mrugankray/hive-server-sqoop:1.0
container_name: hive-server
depends_on:
- namenode
- datanode
- hive-metastore
env_file:
- ./hadoop.env
volumes:
- hadoop_hive_server_sqoop:/usr/lib/sqoop
- ./configs/hive_server/sqoop-env.sh:/usr/lib/sqoop/conf/sqoop-env.sh
- ./configs/hive_server/hive_server_bashrc.txt:/root/.bashrc
- ./configs/hive_server/sqoop-site.xml:/usr/lib/sqoop/conf/sqoop-site.xml
- ./configs/hive_server/sshd_config.conf:/etc/ssh/sshd_config
environment:
HIVE_CORE_CONF_javax_jdo_option_ConnectionURL: "jdbc:postgresql://hive-metastore/metastore"
SERVICE_PRECONDITION: "hive-metastore:9083"
ports:
- 10000:10000
hive-metastore:
image: bde2020/hive:2.3.2-postgresql-metastore
container_name: hive-metastore
env_file:
- ./hadoop.env
command: /opt/hive/bin/hive --service metastore
environment:
SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 hive-metastore-postgresql:5432"
ports:
- "9083:9083"
depends_on:
- hive-metastore-postgresql
hive-metastore-postgresql:
image: bde2020/hive-metastore-postgresql:2.3.0
container_name: hive-metastore-postgresql
# Hue #
huedb:
image: postgres:15.1-alpine3.17
container_name: huedb
volumes:
- hue_pg_data:/var/lib/postgresl/data/
env_file:
- ./hadoop.env
environment:
SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 hive-metastore-postgresql:5432 hive-metastore:9083 hive-server:10000 resourcemanager:8088"
POSTGRES_USER: hue
POSTGRES_PASSWORD: hue
POSTGRES_DB: hue
hue:
image: gethue/hue:4.6.0
container_name: hue
environment:
SERVICE_PRECONDITION: "namenode:9000 namenode:9870 datanode:9864 hive-metastore-postgresql:5432 hive-metastore:9083 hive-server:10000 resourcemanager:8088"
ports:
- "8888:8888"
env_file:
- ./hadoop.env
volumes:
- ./hue-overrides.ini:/usr/share/hue/desktop/conf/hue-overrides.ini
depends_on:
- huedb
# Setup external DB & pagadmin
external_postgres_db:
image: postgres:15.1-alpine3.17
container_name: external_postgres_db
volumes:
- external_postgres_db_data:/var/lib/postgresl/data/
ports:
- "5432:5432"
environment:
POSTGRES_USER: external
POSTGRES_PASSWORD: external
POSTGRES_DB: external
external_pgadmin:
image: dpage/pgadmin4:6.18
container_name: external_pgadmin
ports:
- "5000:80"
environment:
- "PGADMIN_DEFAULT_PASSWORD=external"
depends_on:
- external_postgres_db
# Cassandra #
cassandra:
image: cassandra:4.1
container_name: cassandra
ports:
- "9042:9042"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
- "CASSANDRA_USER=cassandra"
- "CASSANDRA_PASSWORD=cassandra"
restart: always
volumes:
- cassandra_db:/var/lib/cassandra
healthcheck:
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
interval: 15s
timeout: 10s
retries: 10
volumes:
hadoop_namenode:
hadoop_namenode_conda:
hadoop_namenode_spark:
hadoop_namenode_zeppelin:
hadoop_namenode_flume:
hadoop_datanode:
hadoop_datanode_conda:
hadoop_resourcemanager_conda:
hadoop_nodemanager_conda:
hadoop_historyserver:
hadoop_hive_server_sqoop:
hue_pg_data:
external_postgres_db_data:
airflow_namenode:
cassandra_db:
zookeeper_data:
zookeeper_log:
kafka_broker: