RE: Monitor Postgres database status on Docker

From: Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com>
To: Fan Liu <fan(dot)liu(at)ericsson(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: RE: Monitor Postgres database status on Docker
Date: 2019-09-27 05:25:28
Message-ID: MN2PR01MB5854D42658E934BE1C4A752A9B810@MN2PR01MB5854.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

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 <fan(dot)liu(at)ericsson(dot)com>; pgsql-general(at)lists(dot)postgresql(dot)org
Subject: RE: Monitor Postgres database status on Docker

Thanks but how we can use it for docker container.

Regards,
Daulat

From: Fan Liu <fan(dot)liu(at)ericsson(dot)com<mailto:fan(dot)liu(at)ericsson(dot)com>>
Sent: Tuesday, September 24, 2019 3:02 PM
To: Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com<mailto:Daulat(dot)Ram(at)exponential(dot)com>>; pgsql-general(at)lists(dot)postgresql(dot)org<mailto:pgsql-general(at)lists(dot)postgresql(dot)org>
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 <Daulat(dot)Ram(at)exponential(dot)com<mailto:Daulat(dot)Ram(at)exponential(dot)com>>
Sent: Tuesday, September 24, 2019 5:18 PM
To: pgsql-general(at)lists(dot)postgresql(dot)org<mailto:pgsql-general(at)lists(dot)postgresql(dot)org>
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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Luca Ferrari 2019-09-27 10:37:08 incoherent dead tuples between pg_stat_user_tables and pgstattuple?
Previous Message keisuke kuroda 2019-09-27 04:24:15 Re: pg12 rc1 on CentOS8 depend python2

Browse pgsql-performance by date

  From Date Subject
Next Message Amarendra Konda 2019-09-27 05:40:50 Autovacuum is cleaning very less dead tuples
Previous Message Tom Lane 2019-09-26 23:11:39 Re: Slow pg_publication_tables with many schemas and tables