Percona: PMM

by Mark Nielsen
Copyright 2022


This is for MySQL monitoring on premises.
  1. Links
  2. What PMM can do
  3. Install Docker
  4. Install PMM

Links



What PMM can do



Install Docker

  sudo apt-get update
  sudo apt-get install ca-certificates curl gnupg lsb-release

  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

  echo  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu     $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

  sudo apt-get update
  sudo apt-get install docker-ce docker-ce-cli containerd.io

  sudo docker run hello-world
  


Install pmm server

  sudo  docker create -v /srv --name pmm-data percona/pmm-server:2 /bin/true


  # We changed the port forward from 80 to 8000 because we already had apache running.
  # You could use apache rewrite to allow connections from 80 to go to 8000, but
  # that is another article. 
  sudo  docker run -d -p 8000:80 -p 443:443 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2

  ## Use a browser to go to your pmm interface
#  https://IP Address or hostname of your Percona Monitoring and Management Server:8000/
  # For me
  http://10.214.159.206:8000

  # user = admin. password=mark1234
  # Change the password. 



Install pmm client Ubuntu

  wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb

  wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb

  sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb

  sudo apt-get update

  sudo apt-get install pmm2-client

  # Choose a password to register the server. 
#  sudo pmm-admin config --server-insecure-tls --server-url=https://admin:<password>@pmm.example.com
  # for me
  sudo pmm-admin config --server-insecure-tls --server-url=http://admin:mark1234@10.214.159.206

Add this account to mysql, since it is 5.7, and then issue the last command.

    CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'badpassword' WITH MAX_USER_CONNECTIONS 10;
    GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';
    Register the server for monitoring

    # for me

    CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'badpassword' WITH MAX_USER_CONNECTIONS 10;
    GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';
    Register the server for monitoring
    
      

The last command in bash. Use the same password you registered the service to pmm.


 #   sudo pmm-admin add mysql --username=pmm --password=<password> --query-source=perfschema
 # for me
 sudo pmm-admin add mysql --username=pmm --password=badpassword --query-source=perfschema


Install pmm client Centos

  sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
  sudo yum install pmm2-client
  sudo pmm-admin config --server-insecure-tls --server-url=http://admin:mark1234@10.214.159.206:8000

In mysql

CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'badpassword' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';

CREATE USER 'pmm'@'127.0.0.1' IDENTIFIED BY 'badpassword' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'127.0.0.1';

sudo pmm-admin add mysql --username=pmm --password=badpassword --query-source=perfschema