RE: Monitor Postgres database status on Docker

Daulat Ram <[email protected]> Fri, 27 Sep 2019 05:25:28 +0000
Newsgroups gmane.comp.db.postgresql.general,gmane.comp.db.postgresql.performance
Message-ID <MN2PR01MB5854D42658E934BE1C4A752A9B810@MN2PR01MB5854.prod.exchangelabs.com>
Hi Fan Liu,

I am able to make the connection to the Postgres database created in docker container via psql from postgres10 client but not able to connect through pg_isready.

psql -c 'select count (*) from pg_stat_activity' -h localhost -p 5432 -U postgres -W
Password for user postgres:
count
-------
     7

Give me suggestions.
 Thanks,


From: Daulat Ram
Sent: Tuesday, September 24, 2019 3:35 PM
To: Fan Liu <[email protected]>; [email protected]
Subject: RE: Monitor Postgres database status on Docker

Thanks but how we can use it for docker container.

Regards,
Daulat

From: Fan Liu <[email protected]<mailto:[email protected]>>
Sent: Tuesday, September 24, 2019 3:02 PM
To: Daulat Ram <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>
Subject: RE: Monitor Postgres database status on Docker

Hi,

I am not from PostgreSQL team.
Just let you know that when we run PostgreSQL in Kubernetes, we use below command for liveness check.

pg_isready --host localhost -p $PG_PORT -U $PATRONI_SUPERUSER_USERNAME


BRs,
Fan Liu


From: Daulat Ram <[email protected]<mailto:[email protected]>>
Sent: Tuesday, September 24, 2019 5:18 PM
To: [email protected]<mailto:[email protected]>
Subject: Monitor Postgres database status on Docker

Hi team,

We want to check the postgres database status on docker container just like we monitor Postgres (up  / down) via /etc/init.d/postgresql status

But I am not sure how we can do that with docker.

Thanks,
Daulat