Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packaging/src/docker/conf/tez-site.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<name>tez.am.registry.namespace</name>
<value>${TEZ_AM_REGISTRY_NAMESPACE}</value>
</property>
<property>
<name>tez.am.rpc.port</name>
<value>${TEZ_AM_RPC_PORT}</value>
</property>
<property>
<name>tez.local.mode</name>
<value>false</value>
Expand Down
49 changes: 45 additions & 4 deletions packaging/src/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ services:
- hive-db:/var/lib/postgresql
networks:
- hive
healthcheck:
test: ["CMD-SHELL", "pg_isready -U hive -d metastore_db"]
interval: 5s
timeout: 3s
retries: 30

metastore:
image: apache/hive:${HIVE_VERSION}
depends_on:
- postgres
postgres:
condition: service_healthy
restart: unless-stopped
container_name: metastore
hostname: metastore
Expand Down Expand Up @@ -67,11 +73,18 @@ services:
- ./jars:/tmp/ext-jars:ro
networks:
- hive
healthcheck:
test: ["CMD-SHELL", "bash -c 'echo > /dev/tcp/localhost/9083'"]
interval: 5s
timeout: 5s
retries: 30
start_period: 30s

hiveserver2:
image: apache/hive:${HIVE_VERSION}
depends_on:
- metastore
metastore:
condition: service_healthy
restart: unless-stopped
container_name: hiveserver2
hostname: hiveserver2
Expand Down Expand Up @@ -125,6 +138,12 @@ services:
- ./jars:/tmp/ext-jars:ro
networks:
- hive
healthcheck:
test: ["CMD-SHELL", "bash -c 'echo > /dev/tcp/localhost/10000'"]
interval: 10s
timeout: 10s
retries: 30
start_period: 40s

zookeeper:
profiles:
Expand All @@ -137,10 +156,17 @@ services:
- '2181:2181'
networks:
- hive
environment:
ZOO_4LW_COMMANDS_WHITELIST: ruok
volumes:
- zookeeper_data:/data
- zookeeper_datalog:/datalog
- zookeeper_logs:/logs
healthcheck:
test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep imok"]
interval: 5s
timeout: 3s
retries: 30

tezam:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a chance to have healthcheck for tezams?
tez.am.rpc.port could be set to a static value, and multiple tez AM's won't collide given they are on different hosts like llap daemons

https://github.com/apache/tez/blob/4bccf3a2339c913ade0bc5447bdfc505c5536128/tez-dag/src/main/java/org/apache/tez/dag/api/client/DAGClientServer.java#L69

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have added tez am port check, hardcoded one

profiles:
Expand All @@ -149,14 +175,16 @@ services:
container_name: tezam
hostname: tezam
depends_on:
- zookeeper
zookeeper:
condition: service_healthy
restart: on-failure:3
environment:
USER: hive
SERVICE_NAME: 'tezam'

TEZ_FRAMEWORK_MODE: STANDALONE_ZOOKEEPER
TEZ_AM_ZOOKEEPER_QUORUM: zookeeper:2181
TEZ_AM_RPC_PORT: '15100'

# LLAP daemon discovery
HIVE_ZOOKEEPER_QUORUM: zookeeper:2181
Expand All @@ -171,13 +199,20 @@ services:
- scratch:/opt/hive/scratch
networks:
- hive
healthcheck:
test: ["CMD-SHELL", "bash -c 'echo > /dev/tcp/localhost/$${TEZ_AM_RPC_PORT}'"]
interval: 5s
timeout: 5s
retries: 30
start_period: 20s

llapdaemon:
profiles:
- llap
image: apache/hive:${HIVE_VERSION}
depends_on:
- zookeeper
zookeeper:
condition: service_healthy
restart: unless-stopped
environment:
USER: hive
Expand Down Expand Up @@ -205,6 +240,12 @@ services:
- scratch:/opt/hive/scratch
networks:
- hive
healthcheck:
test: ["CMD-SHELL", "bash -c 'echo > /dev/tcp/localhost/15001'"]
interval: 5s
timeout: 5s
retries: 30
start_period: 20s

volumes:
hive-db:
Expand Down
1 change: 1 addition & 0 deletions packaging/src/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export HIVE_SERVER2_TEZ_USE_EXTERNAL_SESSIONS="${HIVE_SERVER2_TEZ_USE_EXTERNAL_S
export TEZ_FRAMEWORK_MODE="${TEZ_FRAMEWORK_MODE:-}"
export TEZ_AM_REGISTRY_NAMESPACE="${TEZ_AM_REGISTRY_NAMESPACE:-/tez_am/server}"
export TEZ_AM_ZOOKEEPER_QUORUM="${TEZ_AM_ZOOKEEPER_QUORUM:-${HIVE_ZOOKEEPER_QUORUM}}"
export TEZ_AM_RPC_PORT="${TEZ_AM_RPC_PORT:-0}"

envsubst < $HIVE_HOME/conf/core-site.xml.template > $HIVE_HOME/conf/core-site.xml
envsubst < $HIVE_HOME/conf/hive-site.xml.template > $HIVE_HOME/conf/hive-site.xml
Expand Down
4 changes: 3 additions & 1 deletion packaging/src/docker/start-hive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ export COMPOSE_FILE="$COMPOSE_FILES"

echo "Starting Hive cluster (mode=$HIVE_EXECUTION_MODE)"

docker compose $PROFILE up -d $SCALE
docker compose $PROFILE up -d --wait $SCALE

echo "Hive cluster is ready."
Loading