A Guide to Installing Percona Monitoring and Management (PMM)2 For the First Time

Percona Monitoring and Management 2Percona Monitoring and Management (PMM) is a free and open-source platform for managing and monitoring MySQL®, MongoDB®, and PostgreSQL® performance. You can run PMM in your own environment for maximum security and reliability. It provides thorough time-based analysis for MySQL, MongoDB, and PostgreSQL servers to ensure that your data works as efficiently as possible.

Please see our previous blog for full information on the new features included in PMM2, our latest software release.

To use PMM2 you will need to remove any earlier versions of PMM Server and Client as there is no in-place upgrade path for historical data, and then download and run our latest software.

Install PMM Server with docker

The easiest way to install PMM Server is to deploy it with Docker. Running the PMM2 Docker container with PMM Server can be done by the following commands (note the version tag of 2):

Now you can check the newly installed PMM Server in your browser, going to your server by its IP address and using the default credentials:

username: admin

password: admin

You will be prompted to change the admin password after logging in.

Install PMM Client

You can get PMM2 Client package from the official download page on the Percona web site, or use the official percona-release package from Percona to enable the tools repository, as follows (please see percona-release official documentation for further details on this new tool).

Ubuntu/Debian instructions

Install the Percona repository:

Install the pmm2-client package:

Red Hat/CentOS Instructions

Install the Percona repository:

Install the pmm2-client package:

Users who have previously installed pmm2-client pre-release versions should fully remove the package and then install the latest available version.

Configure PMM

Once PMM Client is installed, run the pmm-admin config command with your PMM Server IP address in order to register with the PMM Server:

Note that you need to pass the authentication string as part of the --server-url. These credentials are the same ones you used to login to PMM Server.

You should see the following:

Adding MySQL Metrics and Query Analytics

MySQL server can be added for the monitoring in its normal way. Here is a command which adds it using the PERFORMANCE_SCHEMA source:

where username and password are credentials for the monitored MySQL access, which will be used locally on the database host.

The syntax to add MySQL services (Metrics and Query Analytics) using the Slow Log source is the following:

When the server is added, you can check your MySQL dashboards and Query Analytics in order to view its performance information!

Adding MongoDB Metrics and Query Analytics

Please refer to PMM 2 documentation to find out how to set up the required permissions and enable profiling with MongoDB.

You can add MongoDB services (Metrics and Query Analytics) with a similar command:

Adding PostgreSQL Metrics and Query Analytics

Please refer to PMM2 documentation to find out how to add PostgreSQL extension for queries monitoring, as well as set up the required user permissions and authentication.

Add PostgreSQL monitoring to your PMM Server with the following command:

Where username and password parameters should contain actual PostgreSQL user credentials.

Add ProxySQL monitoring service

You can add ProxySQL service as follows:

Please help us improve our software quality by reporting any Percona Monitoring and Management bugs you encounter using our bug tracking system.

Share this post

Comments (5)

  • Trimurthy Reply

    More information on Linux generic client installation is much appreciated.

    Step 1: Extract tar file.
    pmmclient:/opt/mysql # tar -zxvf pmm2-client-2.0.0.tar.gz
    pmm2-client-2.0.0/
    pmm2-client-2.0.0/config/
    pmm2-client-2.0.0/config/pmm-agent.init
    pmm2-client-2.0.0/config/pmm-agent.service
    pmm2-client-2.0.0/config/pmm-agent.logrotate
    pmm2-client-2.0.0/rpm/
    pmm2-client-2.0.0/rpm/pmm2-client.spec
    pmm2-client-2.0.0/queries-postgres.yml
    pmm2-client-2.0.0/bin/
    pmm2-client-2.0.0/bin/mongodb_exporter
    pmm2-client-2.0.0/bin/pmm-admin
    pmm2-client-2.0.0/bin/clickhouse_exporter
    pmm2-client-2.0.0/bin/proxysql_exporter
    pmm2-client-2.0.0/bin/pmm-agent
    pmm2-client-2.0.0/bin/postgres_exporter
    pmm2-client-2.0.0/bin/node_exporter
    pmm2-client-2.0.0/bin/mysqld_exporter
    pmm2-client-2.0.0/bin/rds_exporter
    pmm2-client-2.0.0/VERSION
    pmm2-client-2.0.0/queries-mysqld.yml
    pmm2-client-2.0.0/example.prom
    pmm2-client-2.0.0/install_tarball
    pmm2-client-2.0.0/debian/
    pmm2-client-2.0.0/debian/copyright
    pmm2-client-2.0.0/debian/rules
    pmm2-client-2.0.0/debian/compat
    pmm2-client-2.0.0/debian/install
    pmm2-client-2.0.0/debian/files
    pmm2-client-2.0.0/debian/postrm
    pmm2-client-2.0.0/debian/preinst
    pmm2-client-2.0.0/debian/control
    pmm2-client-2.0.0/debian/postinst

    pmmclient:/opt/mysql # cd pmm2-client-2.0.0/
    pmmclient:/opt/mysql/pmm2-client-2.0.0 # ls
    VERSION bin config debian example.prom install_tarball queries-mysqld.yml queries-postgres.yml rpm

    Step 2: Install
    pmmclient:/opt/mysql/pmm2-client-2.0.0 # ./install_tarball
    Installing into /usr/local/percona/pmm2…

    Step 3: Post install not seeing any client on the server.
    pmmclient:/opt/mysql/pmm2-client-2.0.0 # pm
    pmap pmap_set2 pmt-ehd pmvarrun

    September 20, 2019 at 7:38 am
  • Sids Reply

    Config command: pmm-admin config –server-insecure-tls –server-url=https://admin:admin@:443
    store the credentials in file : /usr/local/percona/pmm2/config/pmm-agent.yaml
    Also it displays it when run: pmm-admin status

    As config command only accepts user with grafanaAdmin privileges.
    It should be implemented in way to not to disclose Admin password and also not to store any passwords (Grafana + Database) in monitoring nodes in plain text format.

    September 20, 2019 at 8:10 am
    • Michael Coburn Reply

      Hi @Sids

      What did you expect instead of the existing syntax? Can you provide an example?

      September 21, 2019 at 6:28 pm
      • Sids Reply

        Hey @Michael. I don’t see issue in syntax but the flow by which pmm-admin registers node.
        This can be secured by not storing “GrafanaAdmin” credentials as PLAIN-TEXT on to monitoring nodes and if possible to allow configuring monitoring nodes with “Admin” credentials instead of “GrafanaAdmin” if possible. Already reported bug PMM-4743 for same.

        BTW, PMM2 is great… 🙂

        September 24, 2019 at 3:14 am
  • trimurthypimurthy Reply

    Looks like the client installation is not working as expected on SUSE Linux Enterprise Server 12 SP1 & SUSE Linux Enterprise Server 12 SP3

    pmmclient:/opt/mysql/pmm2-client-2.0.0 # ./install_tarball
    Installing into /usr/local/percona/pmm2…

    pmmclient:/opt/mysql/pmm2-client-2.0.0 # pmm-admin config –server-insecure-tls –server-url=https://admin:admin@ipaddress:444/
    If ‘pmm-admin’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf pmm-admin

    pmmclient:/opt/mysql/pmm2-client-2.0.0 # export PATH=/usr/local/percona/pmm2/bin:$PATH
    pmmclient:/opt/mysql/pmm2-client-2.0.0 # pmm-admin config –server-insecure-tls –server-url=https://admin:admin@ipaddress:443
    Checking local pmm-agent status…
    pmm-agent is not running. Please re-run pmm-agent setup with –config-file flag.
    pmmclient:/opt/mysql/pmm2-client-2.0.0 #

    September 20, 2019 at 8:32 am

Leave a Reply