I have set up three containers that are networked because I would like to use Hadoop and Hive with PostgreSQL. You can access Docker set up via https://github.com/jcool12/hadoop-docker/tree/main/hivepost so you can download the folders/
files to run it. The Hadoop container works, the PostgreSQL container works, but the Hive container, upon startup, presents this error:
Waiting for PostgreSQL to start...
/entrypoint.sh: line 4: pg_isready: command not found
The PostgreSQL container is running and looks fine, yet I’m still encountering this error:
/entrypoint.sh: line 4: pg_isready: command not found.
I have installed the PostgreSQL client in the /hive/Dockerfile
and modified the entrypoint.sh
, but nothing resolves the error. Could you please help me resolve this issue?
2
Answers
Your existing setup actually seems to work for me. But perhaps you might consider moving the readiness check across to Docker Compose by updating your
docker-compose.yml
as follows:I have retained only the important bits for clarity.
healthcheck
to thepostgres
service, which usespg_isready
and will only mark the container as healthy when it is ready to accept connections.depends_on
for thehive
service, so that it will only start oncepostgres
has been marked as healthy.You can then remove the
pg_isready
command from theentrypoint.sh
file.You can explore the official Hive docker images, they have ways to run Hive with Hadooop with Postgres out of the box
https://hive.apache.org/development/quickstart/ search for POSTGRES_LOCAL_PATH here