-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-apache.yml
More file actions
101 lines (90 loc) · 3.94 KB
/
docker-compose-apache.yml
File metadata and controls
101 lines (90 loc) · 3.94 KB
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
name: hms
# ─── Verbose console logging ──────────────────────────────────────────────────
# conf/hive-log4j2.properties (bind-mounted below) defines a Console/SYSTEM_OUT
# appender named CONSOLE and sets the root logger to DEBUG. This file fully
# replaces the image's baked-in log4j2 config, so all HMS log output goes to
# stdout and is visible in `docker compose logs -f metastore`.
#
# Hive 3.x images do not support the VERBOSE env var, so it is omitted.
# ──────────────────────────────────────────────────────────────────────────────
services:
# ── PostgreSQL ───────────────────────────────────────────────────────────────
postgres:
image: postgres:15
container_name: postgres
hostname: postgres
restart: unless-stopped
environment:
POSTGRES_DB: metastore_db
POSTGRES_USER: hive
POSTGRES_PASSWORD: password
POSTGRES_INITDB_ARGS: "--auth-host=md5 --auth-local=md5"
command: ["postgres", "-c", "password_encryption=md5"]
ports:
- "5432:5432"
volumes:
- hive-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U hive -d metastore_db"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
networks:
- hive
# ── Download PostgreSQL JDBC driver (one-shot, skipped if already present) ──
# The HMS entrypoint copies every *.jar found in /tmp/ext-jars into
# $HIVE_HOME/lib before starting the service (see entrypoint.sh lines 28-35).
# postgres-jar:
# image: alpine/curl
# container_name: postgres-jar
# volumes:
# - hms-jars:/downloads
# command: >-
# sh -c "[ -f /downloads/postgresql.jar ] ||
# curl -fSL -o /downloads/postgresql.jar
# https://jdbc.postgresql.org/download/postgresql-42.7.3.jar"
# ── Hive Metastore (HMS) ─────────────────────────────────────────────────────
metastore:
image: apache/hive:${HIVE_VERSION:-3.1.3}
container_name: metastore
hostname: metastore
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
# postgres-jar:
# condition: service_completed_successfully
environment:
DB_DRIVER: postgres
SERVICE_NAME: metastore
# ── PostgreSQL JDBC connection ─────────────────────────────────────────
# -Xmx1G is kept here; entrypoint.sh prepends it again via
# HADOOP_CLIENT_OPTS so the value here sets the effective heap.
SERVICE_OPTS: >-
-Xmx1G
-Djavax.jdo.option.ConnectionDriverName=org.postgresql.Driver
-Djavax.jdo.option.ConnectionURL=jdbc:postgresql://postgres:5432/metastore_db
-Djavax.jdo.option.ConnectionUserName=hive
-Djavax.jdo.option.ConnectionPassword=password
# Schema will be initialised on first start; set to 'true' to skip.
IS_RESUME: "false"
HADOOP_CLASSPATH: /opt/hadoop/share/hadoop/tools/lib/*
ports:
- "9083:9083"
volumes:
- warehouse:/opt/hive/data/warehouse
# Jars placed here are auto-copied to $HIVE_HOME/lib by the entrypoint.
- hms-jars:/tmp/ext-jars:ro
# Custom log4j2 config: console-only appender at DEBUG level.
# Fully replaces the image's baked-in hive-log4j2.properties.
- ./conf/hive-log4j2.properties:/opt/hive/conf/hive-log4j2.properties:ro
networks:
- hive
volumes:
hive-db:
warehouse:
hms-jars:
networks:
hive:
name: hive