Deploying Percona Monitoring and Management (PMM) with One-Click Apps

Updated by Linode Contributed by Linode

Contribute on GitHub

Report an Issue | View File | Edit File

Marquee image for How to Deploy Percona Monitoring and Management (PMM) with One-Click Apps

Percona (PMM) One-Click App

Percona Monitoring and Management (PMM) is an open-source tool which provides a GUI powered by Grafana for monitoring and managing MySQL, MariaDB, PostgreSQL, and MongoDB databases. You can use PMM to easily observe important metrics, logging, and statistics related to your databases and the hosts they run on. Additionally, it includes a number of tools which can help to optimize your database’s performance, manage all database instances, and track and identify potential security threats. Linode’s Percona (PMM) One-Click App deploys a Linode with PMM installed and ready for you to begin monitoring your databases.

PMM Architecture Overview

The PMM tool uses a client-server model which makes it easy to scale monitoring across several databases hosted on various remote hosts. See the table below to better understand how each PMM component fits into the context of Linode’s Percona (PMM) One-Click App.

Component Description
PMM Server The Percona (PMM) One-Click App deploys an instance of the PMM Server, which includes the Grafana web interface to visualize all the data collected from the databases it monitors.
PMM Client You will need to install the PMM Client on any Linode that hosts a database that you would like to monitor. The PMM Client will help you connect to the PMM Server and relay host and database performance metrics to the PMM Server.
Note
For a more detailed information on PMM’s architecture see Percona’s official documentation.

Deploy a Percona (PMM) One-Click App

Linode’s One-Click App Marketplace allow you to easily deploy software on a Linode using the Linode Cloud Manager. To access Linode’s One-Click App Marketplace:

  1. Log in to your Linode Cloud Manager account.

  2. From the Linode dashboard, click on the Marketplace button in the left-hand navigation menu.

  3. The Linode creation page will appear, with the One-Click and Marketplace tabs pre-selected.

  4. Under the Select App section, select the app you would like to deploy:

    Select a One-Click App to deploy
  5. Once you have selected the app, proceed to the app’s Options section and provide values for the required fields.

Percona (PMM) Options

Configuration Description
Hostname The hostname to assign to your new Linode. Required.

Linode Options

The following configuration options are possible for your Linode server:

Configuration Description
Select an Image Debian 10 and Ubuntu 20.04 are currently the only images supported by the Percona (PMM) One-Click App. Required.
Region The region where you would like your Linode to reside. In general, it’s best to choose a location that’s closest to you. For more information on choosing a DC, review the How to Choose a Data Center guide. You can also generate MTR reports for a deeper look at the network routes between you and each of our data centers. Required.
Linode Plan Your Linode’s hardware resources. Percona recommends roughly 1 GB of storage on your PMM Server for each database node you would like to monitor. For more information on Percona’s system requirements see their official documentation. If you decide that you need more or fewer hardware resources after you deploy your app, you can always resize your Linode to a different plan. Required.
Linode Label The name for your Linode, which must be unique between all of the Linodes on your account. This name will be how you identify your server in the Cloud Manager’s Dashboard. Required.
Root Password The primary administrative password for your Linode instance. This password must be provided when you log in to your Linode via SSH. The password must meet the complexity strength validation requirements for a strong password. Your root password can be used to perform any action on your server, so make it long, complex, and unique. Required.

When you’ve provided all required Linode Options, click on the Create button. Your PMM app will complete installation anywhere between 1-5 minutes after your Linode has finished provisioning.

Software Included

The Percona (PMM) One-Click App will install the following required software on your Linode:

Software Description
Docker Docker is used to containerize PMM.
PMM Server PMM Server is the central part of PMM that aggregates collected data and presents it in the form of tables, dashboards, and graphs in a web interface.
Grafana Grafana is the visualization tool used by PMM to provides charts, graphs, and alerts for the databases that are being monitored.
Note
Currently, Linode does not manage software and systems updates for One-Click Apps. It is up to the user to perform routine maintenance on software deployed in this fashion.

Getting Started after Deployment

Access your PMM Server’s Grafana Dashboard

After the PMM Server has finished installing, you will be able to access its Grafana dashboard over http:// and your Linode’s IPv4 address. To find your Linode’s IPv4 address:

  1. Click on the Linodes link in the sidebar. You will see a list of all your Linodes.

  2. Find the Linode you just created when deploying your app and select it.

  3. Navigate to the Networking tab.

  4. Your IPv4 address will be listed under the Address column in the IPv4 table.

  5. Copy and paste the IPv4 address into a browser window. Ensure you are using http://.

  6. You will see the Grafana login screen:

    Grafana Login Screen

  7. Enter the following default values for username and password, then click the Log In button:

    Entry Default Value
    Username admin
    Password admin
  8. Next you will be prompted to configure a new password. Enter a new password, confirm it, then select Save:

    Change Grafana Password Prompt

  9. You will then see the PMM Home Dashboard actively monitoring your server:

    Percona Home Page

Installing the PMM Client

To begin monitoring a database node, you will need to install the PMM Client on the Linode that hosts your database and connect the node to the PMM Server. For instructions on setting up a database on Linode that you can connect to your PMM Server, see our guides on:

Note
The PMM Server deployed with Linode’s Percona (PMM) One-Click App is compatible with PMM Client version 2.
  1. Connect to your database Linode via SSH.

  2. Update your system’s software.

    Debian or Ubuntu:

    sudo apt-get update && apt-get upgrade
    

    CentOS:

    sudo yum update
    
  3. Configure Percona repositories using the percona-release tool. First you’ll need to download and install the official percona-release package from Percona::

    Debian or Ubuntu:

    wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
    sudo dpkg -i percona-release_latest.generic_all.deb
    

    CentOS:

    sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
    
    Note

    If you have previously enabled the experimental or testing Percona repository, don’t forget to disable them and enable the release component of the original repository as follows:

    sudo percona-release disable all
    sudo percona-release enable original release
    
  4. Install the PMM Client (version 2):

    Debian or Ubuntu:

    sudo apt-get update
    sudo apt-get install pmm2-client
    

    CentOS:

    sudo yum install pmm2-client
    
  5. Connect your database node to the PMM Server. Replace admin_password with your PMM Server’s Grafana password, and 192.0.2.0 with your PMM Server’s IPv4 address.

    Note
    Follow the steps in Find Your Linode’s IP Address to retrieve your PMM Server’s IPv4 address.
    pmm-admin \
    config \
    --server-insecure-tls \
    --server-url=https://admin:[email protected]:443
    

    Once complete, you should see a similar output:

      
    Checking local pmm-agent status...
    pmm-agent is running.
    Registering pmm-agent on PMM Server...
    Registered.
    Configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml updated.
    Reloading pmm-agent configuration...
    Configuration reloaded.
    Checking local pmm-agent status...
    pmm-agent is running.
          
    

Monitor a Database Instance

Once your database node and your PMM Server are communicating, the final step is to add your database instance to be monitored by your PMM Server. These steps are completed on your database node.

  1. Connect to your Linode via SSH.

  2. Add your database instance to be monitored by your PMM Server. This command will add a MySQL database instance to be monitored. Replace db_user with your database’s user name, and db_user_password with that user’s password. You can also replace mysql with the database type that your node is hosting (i.e. postgresql or mongodb). See Percona’s Using PMM Client documentation for details.

    pmm-admin \
    add mysql \
    --username=db_user \
    --password=db_user_password
    

    Your Percona dashboard should now be monitoring your MySQL service.

    perconafinal.png

    Note
    You can also add a database remote instance node using the Grafana interface. In order to do this, your node must be configured with a public DNS name. This method of adding a remote database instance will not provide host-level metrics.

Next Steps

The Percona Monitoring Management Tool is very powerful and can be configured to monitor and display various pieces of your database instances. Once you have completed the basic configurations outlined in this guide, you should review Percona’s documentation to learn more about the PMM tool. Here are some suggested topics:

Join our Community

Find answers, ask questions, and help others.

comments powered by Disqus

This guide is published under a CC BY-ND 4.0 license.