Pmm Connection Refused when I Installed Patroni

I have 2 nodes. One of them is PmmClient, other is PmmServer.
I installed Postgresql on the PmmClient node and successfully sent the queries to PmmServer node. There was no any problem.
After days,
I installed Patroni on the PmmClient node and I am getting this error message When I try to add postgresql.

sudo pmm-admin add postgresql --username=‘pmm’ --password=‘pmm’
Connection check failed: dial tcp connect: connection refused.

Here is the listening port

sudo lsof -i -P -n | grep LISTEN

patroni  623929        postgres    5u  IPv4 752493      0t0  TCP x.x.x.198:8008 (LISTEN)
postgres  624009        postgres    5u  IPv4 753603      0t0  TCP x.x.x.198:5432 (LISTEN)

Here is the pmm-admin status output

pmm-admin status
Agent ID : /agent_id/df4980d8-x-083606bb68f8
Node ID  : /node_id/33e8b22b-x-6384422ab5d6
Node name: PmmClient

PMM Server:
        URL    : https://x.x.x.195:443/
        Version: 2.35.0

PMM Client:
        Connected        : true
        Time drift       : -7.223401ms
        Latency          : 1.320039ms
        Connection uptime: 100
        pmm-admin version: 2.35.0
        pmm-agent version: 2.35.0
        /agent_id/0eb5621e-x-f546d617a4d2 node_exporter Running 42000
        /agent_id/5176d22a-x-bc27ddf36948 vmagent Running 42001
1 Like


Welcome to the Percona Forums. Thanks for being part of the community.

Could you try this?

sudo pmm-admin add postgresql --username='pmm' --password='pmm' --host=$(hostname) --port=5432



1 Like

Thank you, this is the solution