-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
277 lines (265 loc) · 8.21 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
version: '3.7'
services:
alluxio-master:
image: 'alluxio/alluxio-enterprise:latest'
user: root
hostname: alluxio-master
container_name: alluxio-master
networks:
custom:
ipv4_address: 172.23.0.2
depends_on:
- minio-create-buckets
environment:
# Run the command outside of this file to get the base64 formated license file
# Like this: export ALLUXIO_LICENSE_BASE64=$(cat ./my-alluxio-license-file.json | base64)
ALLUXIO_LICENSE_BASE64: ${ALLUXIO_LICENSE_BASE64}
ALLUXIO_JAVA_OPTS: "-Dalluxio.master.mount.table.root.ufs=/opt/alluxio/underFSStorage -Dalluxio.master.hostname=localhost"
volumes:
- alluxio-data:/opt/alluxio/underFSStorage
- ./alluxio-files/alluxio-site.properties:/opt/alluxio/conf/alluxio-site.properties:ro
expose:
- "19998"
- "19999"
- "19200"
ports:
- "19998:19998"
- "19999:19999"
command: ["master"]
alluxio-worker:
image: 'alluxio/alluxio-enterprise:latest'
user: root
hostname: alluxio-worker1
container_name: alluxio-worker1
networks:
custom:
ipv4_address: 172.23.0.3
shm_size: '1gb'
depends_on:
- alluxio-master
environment:
ALLUXIO_JAVA_OPTS: "-Dalluxio.master.hostname=alluxio-master -Dalluxio.worker.ramdisk.size=1G -Dalluxio.master.mount.table.root.ufs=/opt/alluxio/underFSStorage -Dalluxio.worker.hostname=alluxio-worker"
volumes:
- alluxio-data:/opt/alluxio/underFSStorage
- ./alluxio-files/alluxio-site.properties:/opt/alluxio/conf/alluxio-site.properties:ro
expose:
- "29999"
- "30000"
- "30001"
- "30003"
- "39999"
ports:
- "29999:29999"
- "30000:30000"
- "39999:39999"
command: ["worker"]
alluxio-mount-minio-bucket:
image: 'alluxio/alluxio-enterprise:latest'
user: root
container_name: alluxio-mount-minio-bucket
networks:
custom:
ipv4_address: 172.23.0.11
depends_on:
- alluxio-master
- minio-create-buckets
environment:
ALLUXIO_JAVA_OPTS: "-Dalluxio.master.hostname=alluxio-master"
volumes:
- ./alluxio-files/alluxio-site.properties:/opt/alluxio/conf/alluxio-site.properties:ro
entrypoint: >
/bin/sh -c "
sleep 5
alluxio fs mount \
--option alluxio.underfs.s3.endpoint=http://minio:9000 \
--option alluxio.underfs.s3.disable.dns.buckets=true \
--option alluxio.underfs.s3.inherit.acl=false \
--option s3a.accessKeyId=minio \
--option s3a.secretKey=minio123 \
/hive s3a://hive/
sleep 5
alluxio fs loadMetadata /hive
alluxio fs chmod -R 777 /
alluxio fs chmod -R 777 /hive/
alluxio fs chmod -R 777 /hive/warehouse
exit 0
"
mariadb:
image: 'mariadb:latest'
hostname: mariadb
container_name: mariadb
networks:
custom:
ipv4_address: 172.23.0.4
ports:
- '3306:3306'
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_DATABASE: metastore_db
volumes:
- mariadb-data:/var/lib/mysql
trino-coordinator:
image: 'trinodb/trino:431'
hostname: trino-coordinator
container_name: trino-coordinator
networks:
custom:
ipv4_address: 172.23.0.5
ports:
- '8080:8080'
volumes:
- trino-data:/data
- ./etc:/tmp/etc-trino
- ./alluxio-files:/tmp/alluxio-files
- ./conf:/tmp/conf
command:
- /bin/bash
- -c
- |
find /usr/lib/trino -name alluxio*shaded* -exec rm {} \;
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /usr/lib/trino/plugin/hive/
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /usr/lib/trino/plugin/hudi/
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /usr/lib/trino/plugin/iceberg/
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /usr/lib/trino/plugin/delta-lake/
cp -R /tmp/etc-trino/* /etc/trino/
cp /tmp/alluxio-files/alluxio-core-site.xml /etc/trino/core-site.xml
mkdir -p /home/trino && chown trino:trino /home/trino
/usr/lib/trino/bin/run-trino
hive-metastore:
image: 'bitsondatadev/hive-metastore:latest'
hostname: hive-metastore
container_name: hive-metastore
networks:
custom:
ipv4_address: 172.23.0.6
ports:
- '9083:9083' # Metastore Thrift
volumes:
- ./conf/metastore-site.xml:/opt/apache-hive-metastore-3.0.0-bin/conf/metastore-site.xml:ro
- ./alluxio-files:/tmp/alluxio-files
environment:
METASTORE_DB_HOSTNAME: mariadb
depends_on:
- mariadb
- minio
- alluxio-mount-minio-bucket
entrypoint: >
/bin/sh -c "
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /opt/apache-hive-metastore-3.0.0-bin/lib/
echo '#### Hive /opt/apache-hive-metastore-3.0.0-bin/lib/ ###'
ls -al /opt/apache-hive-metastore-3.0.0-bin/lib/ | grep alluxio
/entrypoint.sh
"
minio:
image: 'minio/minio:latest'
hostname: minio
container_name: minio
networks:
custom:
ipv4_address: 172.23.0.7
ports:
- '9000:9000'
- '9001:9001'
volumes:
- minio-data:/data
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
command: server --console-address ":9001" /data
minio-create-buckets:
image: minio/mc:latest
container_name: minio-create-buckets
networks:
custom:
ipv4_address: 172.23.0.10
depends_on:
- minio
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
entrypoint: >
/bin/sh -c "
sleep 5;
/usr/bin/mc config host add myminio http://minio:9000 minio minio123;
if [ \"`/usr/bin/mc ls myminio`\" == \"\" ]; then
echo \"Creating bucket myminio/hive\" && \
/usr/bin/mc mb myminio/hive && \
/usr/bin/mc policy download myminio/hive && \
/usr/bin/mc cp /etc/motd myminio/hive/warehouse/.temp_file;
else
echo \"Bucket myminio/hive already exists, skipping create\";
fi;
exit 0
"
spark-master:
image: docker.io/bitnami/spark:3.3
hostname: spark-master
container_name: spark-master
networks:
custom:
ipv4_address: 172.23.0.8
volumes:
- ./alluxio-files:/tmp/alluxio-files
environment:
- SPARK_MODE=master
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
ports:
- '8081:8080'
command:
- /bin/sh
- -c
- |
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /opt/bitnami/spark/jars/
echo "spark.hadoop.hive.metastore.uris=thrift://hive-metastore:9083" >> /opt/bitnami/spark/conf/spark-defaults.conf
cp /tmp/alluxio-files/alluxio-core-site.xml /opt/bitnami/spark/conf/core-site.xml
/opt/bitnami/scripts/spark/run.sh
spark-worker:
image: docker.io/bitnami/spark:3.3
hostname: spark-worker
container_name: spark-worker
networks:
custom:
ipv4_address: 172.23.0.9
volumes:
- ./alluxio-files:/tmp/alluxio-files
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark-master:7077
- SPARK_WORKER_MEMORY=1G
- SPARK_WORKER_CORES=1
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
command:
- /bin/sh
- -c
- |
cp /tmp/alluxio-files/alluxio-enterprise-*-client.jar /opt/bitnami/spark/jars/
echo "spark.hadoop.hive.metastore.uris=thrift://hive-metastore:9083" >> /opt/bitnami/spark/conf/spark-defaults.conf
cp /tmp/alluxio-files/alluxio-core-site.xml /opt/bitnami/spark/conf/core-site.xml
/opt/bitnami/scripts/spark/run.sh
ports:
- '8082:8081'
volumes:
mariadb-data:
driver: local
minio-data:
driver: local
alluxio-data:
driver: local
trino-data:
driver: local
networks:
custom:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.23.0.0/16
gateway: 172.23.0.1