First, the environment:
10.1.16.65 CentOS7.2 (PMM Server)
10.1.16.52 CentOS7.2 MySQL 5.7.16-master (PMM Client)
10.1.16.53 CentOS7.2 MySQL 5.7.16-slave (PMM Client)
Ii. preparatory work
Check the iptables of the three servers to see if SELinux is closed or in permissive
Third, installation
1. Install PMM Server on 10.1.16.65:
At present official PMM only Docker mirror, so need to deploy first Docker
Yum Install Docker
Considering that late monitoring data collection may occupy a certain disk, you want to put the Docker data store from the system disk to the Mount disk/data directory
Docker info
The default Docker storage location is under/var/lib
Cd/var/lib
CP Docker DOCKER.BKP
MV Docker/data
Ln-s/data/docker Docker
Start the Docker service
Systemctl Start Docker.service
1) Creating Data containers
Docker create \
-v/opt/prometheus/data \
-v/opt/consul-data \
-v/var/lib/mysql \
-v/var/lib/grafana \
--name pmm-data \
Percona/pmm-server:1.0.7/bin/true
2) Create PMM server container
Docker run-d \
-P 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \ percona/pmm-server:1.0.7
3 Browser Input Server ip:http://10.1.16.65
Query analytics into the analysis page
Metrics monitor into the monitoring page
The default logon username and password are admin
2. Install PMM Client on 10.1.16.52 and 10.1.16.53
1) Install PMM Client
Yum Install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
Yum Install Pmm-client
2) Connect PMM Server
Executed on the client server,
Pmm-admin config--server 10.1.16.65
The client name defaults to the host name, or it can define--client-name dummy_name
Client address default is native IP
Can perform pmm-admin config--help view Help
3) Add data collection Policy
Execute first on Master
Pmm-admin add MySQL--user=root--password=12345678--socket=/data/mysql/3306/mysql.sock--create-user-- Create-user-password= "pmm&2017"
Pmm-admin command
Add added
MySQL monitoring type (includes system metrics, MySQL metrics, and query analytics, you can also specify specific linux:metrics or mysql:metrics)
You can add the name of the monitor server after the monitoring type without adding the default is hostname
can perform pmm-admin add--help view Help
Removing: pmm-admin remove MySQL
After execution, create a default user PMM, and grant certain permission to collect information
3) executed on the slave
Pmm-admin add MySQL--user=pmm--password=pmm&2017--socket=/data/mysql/3306/mysql.sock
The user and password here were previously created by master, synchronized to Slave, so slave to collect information through the same users
3. Login Monitor Page
Browser input Server ip:http://10.1.16.65
Enter the default username password: admin
Official Installation Documentation: Https://www.percona.com/doc/percona-monitoring-and-management/install.html