Want to try out Percona Monitoring and Management 2 (PMM 2) but you’re not ready to turn off your PMM 1 environment? This blog is for you! Keep in mind that the methods described are not intended to be a long-term migration strategy, but rather, simply a way to deploy a few clients in order to sample PMM 2 before you commit to the upgrade. 🙂
Here are step-by-step instructions for deploying PMM 1 & 2 client functionality i.e. pmm-client and pmm2-client, on the same host.
The first few steps are already described in our PMM1 documentation so we are simply providing links to those documents. Here we’ll focus on steps 4 and 5.
It’s not possible to install both clients from a repository at the same time. So you’ll need to download a tarball of pmm2-client. Here’s a link to the latest version directly from our site.
* Note that depending on when you’re seeing this, the commands below may not be for the latest version, so the commands may need to be updated for the version you downloaded.
|
1 |
$ wget https://www.percona.com/downloads/pmm2/2.1.0/binary/tarball/pmm2-client-2.1.0.tar.gz |
|
1 |
$ tar -zxvf pmm2-client-2.1.0.tar.gz <br>$ cd pmm2-client-2.1.0 |
Now it’s time to set up a PMM 2 client. In our example, the PMM2 server IP is 172.17.0.2 and the monitored host IP is 172.17.0.1.
|
1 |
$ ./bin/pmm-agent setup --config-file=config/pmm-agent.yaml <br>--paths-node_exporter="$PWD/bin/node_exporter" <br>--paths-mysqld_exporter="$PWD/bin/mysqld_exporter" <br>--paths-mongodb_exporter="$PWD/bin/mongodb_exporter" <br>--paths-postgres_exporter="$PWD/bin/postgres_exporter" <br>--paths-proxysql_exporter="$PWD/bin/proxysql_exporter" <br>--server-insecure-tls --server-address=172.17.0.2:443 <br>--server-username=admin --server-password="admin" 172.17.0.1 generic node8.ca |
Let’s run the pmm-agent using a screen. There’s no service manager integration when deploying alongside pmm-client, so if your server restarts, pmm-agent won’t automatically resume.
|
1 |
# screen -S pmm-agent<br> |
|
1 |
$ ./bin/pmm-agent --config-file="$PWD/config/pmm-agent.yaml" |
|
1 |
$ ./bin/pmm-admin list<br>Service type Service name Address and port Service ID<br><br>Agent type Status Agent ID Service ID<br>pmm-agent connected /agent_id/805db700-3607-40a9-a1fa-be61c76fe755 <br>node_exporter running /agent_id/805eb8f6-3514-4c9b-a05e-c5705755a4be |
Detach the screen, then add the mysql service:
|
1 |
$ ./bin/pmm-admin add mysql --use-perfschema --username=root mysqltest<br>MySQL Service added.<br>Service ID : /service_id/28c4a4cd-7f4a-4abd-a999-86528e38992b<br>Service name: mysqltest |
Here is the state of pmm-agent:
|
1 |
$ ./bin/pmm-admin list<br>Service type Service name Address and port Service ID<br>MySQL mysqltest 127.0.0.1:3306 /service_id/28c4a4cd-7f4a-4abd-a999-86528e38992b<br><br>Agent type Status Agent ID Service ID<br>pmm-agent connected /agent_id/805db700-3607-40a9-a1fa-be61c76fe755 <br>node_exporter running /agent_id/805eb8f6-3514-4c9b-a05e-c5705755a4be <br>mysqld_exporter running /agent_id/efb01d86-58a3-401e-ae65-fa8417f9feb2 /service_id/28c4a4cd-7f4a-4abd-a999-86528e38992b<br>qan-mysql-perfschema-agent running /agent_id/26836ca9-0fc7-4991-af23-730e6d282d8d /service_id/28c4a4cd-7f4a-4abd-a999-86528e38992b |
Confirm you can see activity in each of the two PMM Servers:
| PMM 1 | PMM 2 |
![]() |
![]() |
![]() |
![]() |
Once you’ve decided to move over completely to PMM2, it’s better to make a switch from the tarball version to installation from the repository. It will allow you to perform client updates much easier as well as register the new agent as a service for automatically starting with the server. Also, we will show you how to make a switch without re-adding monitored instances.
|
1 |
$ sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm <br>$ sudo percona-release disable all <br>$ sudo percona-release enable original release <br>$ yum list | grep pmm <br>pmm-client.x86_64 1.17.2-1.el6 percona-release-x86_64<br>pmm2-client.x86_64 2.1.0-1.el6 percona-release-x86_64 |
Here is a link to the apt variant.
|
1 |
yum remove pmm-client |
|
1 |
$ yum install pmm2-client<br>Loaded plugins: priorities, update-motd, upgrade-helper<br>4 packages excluded due to repository priority protections<br>Resolving Dependencies<br>--> Running transaction check<br>---> Package pmm2-client.x86_64 0:2.1.0-5.el6 will be installed<br>...<br>Installed:<br> pmm2-client.x86_64 0:2.1.0-5.el6 <br><br>Complete! |
Let’s copy the currently used pmm2-client configuration file in order to omit re-adding monitored instances.
|
1 |
$ cp pmm2-client-2.1.0/config/pmm-agent.yaml /tmp |
It’s required to set the new location of exporters (/usr/local/percona/pmm2/exporters/) in the file.
|
1 |
$ sed -i 's|node_exporter:.*|node_exporter: /usr/local/percona/pmm2/exporters/node_exporter|g' /tmp/pmm-agent.yaml<br>$ sed -i 's|mysqld_exporter:.*|mysqld_exporter: /usr/local/percona/pmm2/exporters/mysqld_exporter|g' /tmp/pmm-agent.yaml<br>$ sed -i 's|mongodb_exporter:.*|mongodb_exporter: /usr/local/percona/pmm2/exporters/mongodb_exporter|g' /tmp/pmm-agent.yaml <br>$ sed -i 's|postgres_exporter:.*|postgres_exporter: /usr/local/percona/pmm2/exporters/postgres_exporter|g' /tmp/pmm-agent.yaml<br>$ sed -i 's|proxysql_exporter:.*|proxysql_exporter: /usr/local/percona/pmm2/exporters/proxysql_exporter|g' /tmp/pmm-agent.yaml |
The default configuration file has to be replaced by our file and the service pmm-agent has to be restarted.
|
1 |
$ cp /tmp/pmm-agent.yaml /usr/local/percona/pmm2/config/<br>$ systemctl restart pmm-agent |
So now we can verify the current state of monitored instances.
|
1 |
$ pmm-admin list |
Also, it can be checked on PMM server-side.

Resources
RELATED POSTS