I have successfully setup latest PMM-Server on my local machine using a pre-built docker image (Followed: https://www.percona.com/doc/percona-monitoring-and-management/1.x/deploy/server/docker.html).
Now, on the same local machine when trying to spin up PMM-Client using a pre-built docker image. As soon as I try to start the container using the following docker command:
PMM_SERVER=localhost:443
docker run \
--rm \
--name pmm-client \
-e PMM_AGENT_SERVER_ADDRESS=${PMM_SERVER} \
-e PMM_AGENT_SERVER_USERNAME=admin \
-e PMM_AGENT_SERVER_PASSWORD=admin \
-e PMM_AGENT_SERVER_INSECURE_TLS=0 \
-e PMM_AGENT_SETUP=1 \
-e PMM_AGENT_CONFIG_FILE=pmm-agent.yml \
--volumes-from pmm-client-data \
percona/pmm-client:2
I get a connection refused error. The logs printed in console are,
Starting [u'pmm-agent', u'setup'] ...
Checking local pmm-agent status...
INFO[2022-03-25T13:21:39.266+00:00] Loading configuration file /usr/local/percona/pmm2/pmm-agent.yml. component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/node_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/mysqld_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/mongodb_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/postgres_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/proxysql_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/rds_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/azure_exporter component=setup
INFO[2022-03-25T13:21:39.266+00:00] Using /usr/local/percona/pmm2/exporters/vmagent component=setup
pmm-agent is not running.
Registering pmm-agent on PMM Server...
Failed to register pmm-agent on PMM Server: Post "https://localhost:443/v1/management/Node/Register": dial tcp 127.0.0.1:443: connect: connection refused.
[u'pmm-agent', u'setup'] exited with 1.
However, when I try to access the server landing page at 127.0.0.1:443/graph, I am able to get in.
I am new. What could I be doing wrong here?
1 Like
Hi @murtaza13 thank you for posting to the Percona forums, welcome!
Firstly I recommend that you use PMM version 2 instead of version 1, since v1 will be going EOL in a month or two.
Secondly it is likely a case of docker routing you need to modify here - you might need to be pointing to the 172.x address that is assigned to the local PMM Server container.
1 Like
Thanks for getting back @Michael_Coburn.
- I am using v2 of pmm-server/pmm-client
- Could you shed more light on ‘… pointing to 172.x address assigned to the local PMM server container.’
The assigned ip address is 172.17.0.2 to pmm-server container. However, now, when I try using the ip-address, to the run the client, I get
murtaza.hasan@mac-Q1CQMD6R ~ % PMM_SERVER=172.17.0.2
docker run \
--rm \
--name pmm-client \
-e PMM_AGENT_SERVER_ADDRESS=${PMM_SERVER} \
-e PMM_AGENT_SERVER_USERNAME=admin \
-e PMM_AGENT_SERVER_PASSWORD=admin \
-e PMM_AGENT_SERVER_INSECURE_TLS=0 \
-e PMM_AGENT_SETUP=1 \
-e PMM_AGENT_CONFIG_FILE=pmm-agent.yml \
--volumes-from pmm-client-data \
percona/pmm-client:2
Starting [u'pmm-agent', u'setup'] ...
Checking local pmm-agent status...
INFO[2022-03-28T05:55:46.148+00:00] Loading configuration file /usr/local/percona/pmm2/pmm-agent.yml. component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/node_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/mysqld_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/mongodb_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/postgres_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/proxysql_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/rds_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/azure_exporter component=setup
INFO[2022-03-28T05:55:46.148+00:00] Using /usr/local/percona/pmm2/exporters/vmagent component=setup
INFO[2022-03-28T05:55:46.148+00:00] Updating PMM Server address from "172.17.0.2" to "172.17.0.2:443". component=setup
pmm-agent is not running.
Registering pmm-agent on PMM Server...
Failed to register pmm-agent on PMM Server: Post "https://172.17.0.2:443/v1/management/Node/Register": x509: cannot validate certificate for 172.17.0.2 because it doesn't contain any IP SANs.
[u'pmm-agent', u'setup'] exited with 1.
1 Like
@murtaza13 is this issue solved now ? I am facing this error now.
1 Like
Yes. Try and use docker.host.internal in place of localhost
1 Like