Buy Percona ServicesBuy Now!

Deploying Percona Monitoring and Management

PMM (Percona Monitoring and Management) is designed to be scalable for various environments. If you have just one MySQL or MongoDB server, you can install and run both PMM server and PMM clients on one database host.

It is more typical to have several MySQL and MongoDB server instances distributed over different hosts. In this case, you need to install the PMM client package on each database host that you want to monitor. In this scenario, the PMM server is set up on a dedicated monitoring host.

Installing PMM Server

To install and set up the PMM Server, use one of the following options:

Verifying PMM Server

In your browser, go to the server by its IP address. If you run your server as a virtual appliance or by using an Amazon machine image, you will need to setup the user name, password and your public key if you intend to connect to the server by using ssh. This step is not needed if you run PMM Server using Docker.

In the given example, you would need to direct your browser to http://192.168.100.1. Since you have not added any monitoring services yet, the site will not show any data.

Accessing the Components of the Web Interface
Component URL
PMM Home Page http://192.168.100.1
Query Analytics (QAN) http://192.168.100.1/qan/
Metrics Monitor (MM)
http://192.168.100.1/graph/
User name: admin
Password: admin
Orchestrator http://192.168.100.1/orchestrator

Installing Clients

Percona provides PMM Client packages through software repositories of popular Linux distributions:

It is recommended that you install your PMM client by using the software repository for your system. If this option does not work for you, Percona provides downloadable PMM Client packages from the Download Percona Monitoring and Management page.

In addition to DEB and RPM packages, this site also offers:

  • Generic tarballs that you can extract and run the included install script.
  • Source code tarball to build your PMM client from source.

Connecting PMM Clients to the PMM Server

With your server and clients set up, you need to establish connection from clients to the server by specifying the IP address of the server as a parameter to the pmm-admin config --server command.

For example, if your PMM Server is running on 192.168.100.1, and you have installed PMM Client on a machine with IP 192.168.200.1, run the following in the terminal of your client:

$ sudo pmm-admin config --server 192.168.100.1
OK, PMM server is alive.

PMM Server      | 192.168.100.1
Client Name     | ubuntu-amd641
Client Address  | 192.168.200.1

Note

If you change the default port 80 when running PMM Server, specify it after the server’s IP address. For example:

$ sudo pmm-admin config --server 192.168.100.1:8080

Collecting Data from PMM Clients on PMM Server

To start collecting data on each PMM client connected to a PMM server, run the pmm-admin add command along with the name of the selected monitoring service.

For example, to enable general system metrics, MySQL metrics, as well as MySQL query analytics, run pmm-admin add as follows:

$ sudo pmm-admin add mysql

To enable general system metrics, MongoDB metrics, and MongoDB query analytics, run:

$ sudo pmm-admin add mongodb

To enable ProxySQL performance metrics, run:

$ sudo pmm-admin add proxysql:metrics

To see what is being monitored, run:

$ sudo pmm-admin list

For example, if you enable general OS and MongoDB metrics monitoring, the output should be similar to the following:

$ sudo pmm-admin list

...

PMM Server      | 192.168.100.1
Client Name     | ubuntu-amd64
Client Address  | 192.168.200.1
Service manager | linux-systemd

---------------- ----------- ----------- -------- ---------------- --------
SERVICE TYPE     NAME        LOCAL PORT  RUNNING  DATA SOURCE      OPTIONS
---------------- ----------- ----------- -------- ---------------- --------
linux:metrics    mongo-main  42000       YES      -
mongodb:metrics  mongo-main  42003       YES      localhost:27017

For more information about the available commands of pmm-admin add, run pmm-admin add --help in your terminal.

Updating

When changing to a new version of PMM, you update the PMM server and each PMM client separately.

The updating procedure of your PMM server, depends on the option that you selected for installing it. If you have installed your PMM server from a Docker image, follow instructions in the Updating PMM Server Using Docker section.

If you are running PMM Server as a virtual appliance or using Amazon Machine Image, you can use the update button in the bottom right corner of the PMM home page (see PMM Home Page).

../_images/update-button.png

Update your server by clicking the Update button on the PMM landing page.

Updating PMM clients

When a newer version of PMM Client becomes available, you can update to it from the Percona software repositories:

  • For Debian or Ubuntu:

    $ sudo apt-get update && sudo apt-get install pmm-client
    
  • For RedHat or CentOS:

    $ yum update pmm-client
    

If you have installed your PMM client manually, you need to remove it and then download and install a newer version.

Removing the PMM Client and PMM Server

Each PMM client and the PMM server are removed separately. First, remove all monitored services by using the pmm-admin remove command (see Removing monitoring services). Then you can remove each PMM client and the PMM server.

Removing the PMM Client

The exact procedure of removing the PMM client, depends on the method of installation:

  • Removing an installed package using YUM:

    $ sudo yum remove pmm-client
    
  • Removing an installed package using APT:

    $ sudo apt-get remove pmm-client
    
  • Removing a manually installed RPM package:

    $ rpm -e pmm-client
    
  • Removing a manually installed DEB package:

    $ dpkg -r pmm-client
    
  • Removing a binary installed by using the generic PMM Client tarball (assuming you have changed into the directory where the tarball contents was extracted to):

    $ sudo ./uninstall
    

Removing the PMM Server

If you run your PMM Server using a Docker, stop the container as follows:

$ docker stop pmm-server && docker rm pmm-server

To discard all collected data (if you do not plan to user PMM Server in the future), remove the pmm-data container:

$ docker rm pmm-data

If you run your PMM Server using a virtual appliance, just stop and remove it.

To terminate the PMM Server running from an Amazon machine image, run the following command in your terminal:

$ aws ec2 terminate-instances --instance-ids -i-XXXX-INSTANCE-ID-XXXX
Visit Percona Store


General Inquiries

For general inquiries, please send us your question and someone will contact you.