From b83ec3001eccd4ef6eda69fe11c6a2638bb95486 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 5 Mar 2026 02:54:15 -0300 Subject: [PATCH 1/3] fix/hive-pgsql: Fix Postgres volume mount and healthcheck in Hive DB service Update volume mount to /var/lib/postgresql to avoid nested data dir issues introduced in postgres:18-alpine and later (docker-library/postgres#1394), and use $$POSTGRES_USER env var in healthcheck for consistency. Co-Authored-By: Claude Opus 4.6 --- module5-batch-processing/compose.spark-4.1-standalone.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module5-batch-processing/compose.spark-4.1-standalone.yaml b/module5-batch-processing/compose.spark-4.1-standalone.yaml index 55306482..c2421c1b 100644 --- a/module5-batch-processing/compose.spark-4.1-standalone.yaml +++ b/module5-batch-processing/compose.spark-4.1-standalone.yaml @@ -109,9 +109,9 @@ services: ports: - '5433:5432' volumes: - - vol-hive-db:/var/lib/postgresql/data + - vol-hive-db:/var/lib/postgresql healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"] interval: 5s timeout: 5s retries: 5 From a405cef5a506a851eace5336071e31926f1a44f7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 5 Mar 2026 03:00:35 -0300 Subject: [PATCH 2/3] fix/hive-pgsql: Update default Postgres image tag to 18-alpine Co-Authored-By: Claude Opus 4.6 --- module5-batch-processing/compose.spark-4.1-standalone.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module5-batch-processing/compose.spark-4.1-standalone.yaml b/module5-batch-processing/compose.spark-4.1-standalone.yaml index c2421c1b..5bf11929 100644 --- a/module5-batch-processing/compose.spark-4.1-standalone.yaml +++ b/module5-batch-processing/compose.spark-4.1-standalone.yaml @@ -1,6 +1,6 @@ x-spark-image: &spark-image apache/spark:${SPARK_VERSION:-4.1.1-scala2.13-java21-python3-ubuntu} x-hive-image: &hive-image apache/hive:${HIVE_VERSION:-4.2.0} -x-postgres-image: &postgres-image postgres:${POSTGRES_VERSION:-18.1-alpine} +x-postgres-image: &postgres-image postgres:${POSTGRES_VERSION:-18-alpine} x-spark-common: &spark-common From b25c4864c451580ad1d9f09c5c3504129e1d0e57 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 5 Mar 2026 03:14:53 -0300 Subject: [PATCH 3/3] fix/hive-pgsql: Update Hive metastore DB credentials to use 'hive' user Co-Authored-By: Claude Opus 4.6 --- .../compose.spark-4.1-standalone.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module5-batch-processing/compose.spark-4.1-standalone.yaml b/module5-batch-processing/compose.spark-4.1-standalone.yaml index 5bf11929..29ffb60f 100644 --- a/module5-batch-processing/compose.spark-4.1-standalone.yaml +++ b/module5-batch-processing/compose.spark-4.1-standalone.yaml @@ -103,8 +103,8 @@ services: image: *postgres-image container_name: hive-metastore-db environment: - POSTGRES_USER: 'postgres' - POSTGRES_PASSWORD: 'postgres' + POSTGRES_USER: 'hive' + POSTGRES_PASSWORD: 'hive' POSTGRES_DB: 'metastore' ports: - '5433:5432' @@ -125,8 +125,8 @@ services: SERVICE_OPTS: |- -Djavax.jdo.option.ConnectionDriverName=org.postgresql.Driver -Djavax.jdo.option.ConnectionURL=jdbc:postgresql://hive-db:5432/metastore - -Djavax.jdo.option.ConnectionUserName=postgres - -Djavax.jdo.option.ConnectionPassword=postgres + -Djavax.jdo.option.ConnectionUserName=hive + -Djavax.jdo.option.ConnectionPassword=hive HIVE_AUX_JARS_PATH: /opt/hive/aux_jars/ DB_DRIVER: 'postgres' ports: