How to pass a port to pmm-admin config?

I thought it would be nice to install pmm2 on a web server, to monitor the OS level stats.

So it cannot be on port 80 or 443 since those are used by apache.

pmm is installed in docker on centos with

docker run -d -p 8080:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2

and accessing via the web with hostname:8080 works.

But, when trying to config the agent with

pmm-admin config --server-url=http://admin:xxxxx@xxx.xxx.xxx.xxx:8080

does not work, it seems the port 8080 is not being applied, the regular apache on the box is trying to serve /v1/management/Node/Register.

It looks like in prior versions of pmm-admin you could specify a port on the command line, is this still possible with pmm2?

1 Like

Hi, you don’t need to install both server and client components on the same host. PMM server should be installed on a separate host, and then you install PMM client on any hosts you want to monitor, then point them to PMM server.

1 Like

Your issue is that you are trying to use an insecure port for sending metrics. Metrics can only be sent on a secure connection even if using an untrusted certificate, which is default.

Using port 80 (or 8080 as you mapped in your docker setup) is allowed for the UI for browser access although we do not recommend it.

Instead you will need to redo the docker run command and use port 443 (so you may want 8443:443 if 443 is already used on the webserver).

Ivan is right though. Best practice is to have a separate PMM server from all the things you are monitoring to ensure maximum resources for your app/db servers.

1 Like