Running PMM1 and PMM2 ClientsWant 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.

  1. Deploy PMM 1 on Server1 (you’ve probably already done this)
  2. Install and setup pmm-client for connectivity to Server1
  3. Deploy PMM 2 on Server2
  4. Install and setup pmm2-client for connectivity to Server2
  5. Remove pmm-client and switched completely to pmm2-client

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.

Install and Setup pmm2-client Connectivity to Server2

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.

Download pmm2-client Tarball

* 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.

Extract Files From pmm2-client Tarball

Register and Generate Configuration File

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.

Start pmm-agent

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.

Check the Current State of the Agent

Add MySQL Service

Detach the screen, then add the mysql service:

Here is the state of pmm-agent:

Confirm you can see activity in each of the two PMM Servers:

PMM 1PMM 2

Remove pmm-client and Switch Completely to pmm2-client

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.

Configure Percona Repositories

Here is a link to the apt variant.

Remove pmm-client

Install pmm2-client

Configure pmm2-client

Let’s copy the currently used pmm2-client configuration file in order to omit re-adding monitored instances.

It’s required to set the new location of exporters (/usr/local/percona/pmm2/exporters/) in the file.

The default configuration file has to be replaced by our file and the service pmm-agent has to be restarted.

Check Monitored Services

So now we can verify the current state of monitored instances.

Also, it can be checked on PMM server-side.

10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Kirill

Hi
I installed PMM2

But i can’t add mysql agent, have error:

DEBUG 2019-12-16 16:15:23.107100383Z: HTTP/1.1 400 Bad Request
Transfer-Encoding: chunked
Trailer: Grpc-Trailer-Content-Type
Connection: keep-alive
Content-Type: application/json
Date: Mon, 16 Dec 2019 16:15:23 GMT
Server: nginx

be
{“error”:”Connection check failed: dial tcp 127.0.0.1:3306: connect: connection refused.”,”code”:9,”message”:”Connection check failed: dial tcp 127.0.0.1:3306: connect: connection refused.”}
0

DEBUG 2019-12-16 16:15:23.107172147Z: Result:
DEBUG 2019-12-16 16:15:23.107186033Z: Error: &my_sql.AddMySQLDefault{_statusCode:400, Payload:(*my_sql.AddMySQLDefaultBody)(0xc0005d9440)}
Connection check failed: dial tcp 127.0.0.1:3306: connect: connection refused.

Kirill

ok, i found trouble, thanks

and have small question
why pmm2 don’t have option for connections on socket ?

Daniel Guzmán Burgos

Hi Vadim, thanks for the info! couple of comments:

1. The section “Register and Generate Configuration File” have a problem: you are repeating the directory name in the path. For example, instead of “$PWD/pmm2-client-2.1.0/bin/node_exporter” it should be “$PWD/bin/node_exporter”. Full command fixed:

./bin/pmm-agent setup –config-file=config/pmm-agent.yaml \
–paths-node_exporter=”$PWD/bin/node_exporter” \
–paths-mysqld_exporter=”$PWD/bin/mysqld_exporter” \
–paths-mongodb_exporter=”$PWD/bin/mongodb_exporter” \
–paths-postgres_exporter=”$PWD/bin/postgres_exporter” \
–paths-proxysql_exporter=”$PWD/bin/proxysql_exporter” \
–server-insecure-tls –server-address=172.17.0.2:443 \
–server-username=admin –server-password=”admin” 172.17.0.1 generic node8.ca

2. And the other is that, if pmm-client (for PMM 1) is already running, the 42000 port is already in use and the PMM2 client will keep trying to connect to it but it won’t. The fix is to edit the config/pmm-agent.yaml and change the starting port. It will look like this:

ports:
min: 42005
max: 51999

smit

Hi, I always got waiting state no values are fetched to grafana
node_exporter waiting /agent_id/a7130b1a-cb43-499a-a0a3-e6d9840566dd
mysqld_exporter waiting /agent_id/5fcdf261-3e74-47ad-8196-76de02f7a63f /service_id/81584871-9ea0-4844-a414-2d989884986b

Rohit Khurana

getting below while running two PMM agents

msg=”listen tcp :42000: bind: address already in use” source=”server.go:141″