5

How do I run Percona PMM2 with docker-compose?

I can run PMM1 just fine. But PMM2 has absolutely zero documentation available and I can't seem to figure it out.

Sample docker-compose.yml file

db:
  image: mariadb:10.4.13
  ports:
    - ${DB_PORT}:3306
  volumes:
    - db_data:/var/lib/mysql
  tmpfs:
    - /tmp/mysql-tmp
  restart: always
  environment:
    MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASS}"
    MYSQL_USER: "${DB_USER}"
    MYSQL_PASSWORD: "${DB_PASS}"

pmm-server:
  image: percona/pmm-server:2.7
  ports:
    - 8100:80
  environment:
    SERVER_USER: "${PMM_USER}"
    SERVER_PASSWORD: "${PMM_PASS}"
  restart: always
  volumes:
    - pmm_data:/srv

pmm-client:
  image: perconalab/pmm-client:2.7
  environment:
    PMM_AGENT_SERVER_ADDRESS: pmm-server:443
    PMM_AGENT_SERVER_USERNAME: "${PMM_USER}"
    PMM_AGENT_SERVER_PASSWORD: "${PMM_PASS}"
    PMM_AGENT_SERVER_INSECURE_TLS: 1
    DB_TYPE: mysql
    DB_HOST: "${DB_HOST}"
    DB_PORT: 3306
    DB_USER: root
    DB_PASSWORD: "${DB_ROOT_PASS}"
  restart: always
  depends_on:
    - db

volumes:
  db_data:
  pmm_data:

DB_* ENV variables are form PMM1 config. I have no idea how to set DB configuration for PMM2's Docker image. But the pmm-client seems to be failing before that. With above config I get following log for pmm-client. I can't understand why am I getting this error: "Agent ID is not provided, halting"

pmm-client | Starting pmm-agent ...
pmm-client | INFO[2020-06-09T20:28:20.963+00:00] Using /usr/local/percona/pmm2/exporters/node_exporter  component=main
pmm-client | INFO[2020-06-09T20:28:20.963+00:00] Using /usr/local/percona/pmm2/exporters/mysqld_exporter  component=main
pmm-client | INFO[2020-06-09T20:28:20.963+00:00] Using /usr/local/percona/pmm2/exporters/mongodb_exporter  component=main
pmm-client | INFO[2020-06-09T20:28:20.963+00:00] Using /usr/local/percona/pmm2/exporters/postgres_exporter  component=main
pmm-client | INFO[2020-06-09T20:28:20.963+00:00] Using /usr/local/percona/pmm2/exporters/proxysql_exporter  component=main
pmm-client | INFO[2020-06-09T20:28:20.964+00:00] Using /usr/local/percona/pmm2/exporters/rds_exporter  component=main
pmm-client | INFO[2020-06-09T20:28:20.964+00:00] Starting...                                   component=client
pmm-client | INFO[2020-06-09T20:28:20.964+00:00] Starting local API server on http://127.0.0.1:7777/ ...  component=local-server/JSON
pmm-client | ERRO[2020-06-09T20:28:20.964+00:00] Agent ID is not provided, halting.            component=client
pmm-client | INFO[2020-06-09T20:28:20.966+00:00] Started.                                      component=local-server/JSON

Can anyone push me to the right direction with this? I can't understand why there isn't any documentation available for it neither. For PMM1 docker image I found some but for PMM2 there's absolutely nothing. They are releasing this image publicly but no info on how to use it.

Renka
  • 146
  • 9
  • Did you figure it out? – Jared Chu Nov 25 '20 at 20:02
  • 1
    Not yet as I have no need for it anymore right now. But I will dive into it in the future again surely. I did open a thread in Percona forum also. Please take a look maybe it's helpful somehow and/or you can continue the thread there to get to the solution: https://forums.percona.com/discussion/55884/pmm2-docker-image-how-to-use-it-with-docker-compose#latest – Renka Dec 06 '20 at 12:53
  • I figure out that we don't need pmm-client if they are running on the same host. Additionally, you're missing a variable: PMM_AGENT_ID – Jared Chu Dec 07 '20 at 03:04
  • no, there are docs, you need to swith version https://www.percona.com/doc/percona-monitoring-and-management/2.x/install/docker-setting-up.html [![enter image description here](https://i.stack.imgur.com/gVGXM.png)](https://i.stack.imgur.com/gVGXM.png) – Ryabchenko Alexander Jul 09 '20 at 05:48

0 Answers0