How to run pmm-client as docker container?

Hi. I’m trying to run Percona monitoring and management software. I’ve just installed pmm-server using docker image (https://hub.docker.com/r/percona/pmm-server). I also noticed pmm-client is also available as a docker image.(1. https://hub.docker.com/r/percona/pmm-client 2. https://hub.docker.com/r/perconalab/pmm-client) But there is no documentation that mentions running pmm-client as a docker container. Is it possible to run pmm-client as a docker container or it’s not recommended?

Thank you.

Hi @rnmkr

  • Please set next variables for running pmm-client in a docker container:

    PMM_AGENT_SERVER_ADDRESS

  • PMM_AGENT_SERVER_USERNAME
  • PMM_AGENT_SERVER_PASSWORD
  • PMM_AGENT_SERVER_INSECURE_TLS
  • PMM_AGENT_SETUP
  • PMM_AGENT_CONFIG_FILE

e.g.

1 Like

Thank you @adivinho running pmm-client has any limitations? Like node exporter and friends might need some extra configurations etc?

For now, I installed pmm-client with package manager.

1 Like

No additional configurations are required for exporters. If “pull” metrics mode is used than ports 4200[0…] have to be opened for your pmm-server on a monitored node.

@rnmkr Thanks for pointing this.

The documentation for docker in https://www.percona.com/doc/percona-monitoring-and-management/2.x/setting-up/client/docker.html but not linked in the menu (. It Will be fixed soon and updated

1 Like

Hi,
What about specific services?
Can we setup for example mysqld_exporter automatically on container start?

I installed it manually but on container restart it loses the specific exporter setup, just the basic node_exporter is present on restart.

1 Like

I’ve been looking inside the entrypoint.py script and it seems that there is a way (but not documented) to inject a prerun script that does the job of post startup actions like adding more services/exporters.
The prerun script has to be included inside docker-compose yaml file via environment variable PMM_AGENT_PRERUN_SCRIPT following the path to your custom shell script.

2 Likes