Percona Monitoring and Management(PMM)部署实录

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Percona Monitoring and Management(PMM)部署实录相关的知识,希望对你有一定的参考价值。

[[email protected] ~]# yum install -y docker-io device-mapper-event-libs


[[email protected] ~]# service docker start

Starting cgconfig service:                                 [  OK  ]

Starting docker:                                           [  OK  ]


[[email protected] ~]# service docker status

docker (pid  1895) is running...


[[email protected] ~]# docker pull percona/pmm-server:1.5.0

latest: Pulling from percona/pmm-server

f381cf8864f4: Pull complete 

a87e93498235: Pull complete 

058d9a649315: Pull complete 

87c15ebb8da8: Pull complete 

944b86b14d6b: Pull complete 

0787ca42fd8b: Pull complete 

8547db2401c4: Pull complete 

23537e1317cd: Pull complete 

5cafc578a7c2: Pull complete 

af1749f48cdc: Pull complete 

7165613acddc: Pull complete 

01417dcd279f: Pull complete 

d837a2732ee5: Pull complete 

a7995647b4d8: Pull complete 

Digest: sha256:322b81881c32a34bd65bbe28a638e4c98fcfe50c69ab53a6e60636c3eb8a68f7

Status: Downloaded newer image for percona/pmm-server:1.5.0


[[email protected] ~]# docker create -v /opt/prometheus/data -v /opt/consul-data -v \

/var/lib/mysql -v /var/lib/grafana --name pmm-data percona/pmm-server:latest /bin/true

ad3dbd3ee7f823a6c061d050c8f7895e1c704f7f06c9bd321a1d9dfab141a761


[[email protected] ~]# docker run -d -e ORCHESTRATOR_ENABLED=true -e METRICS_RETENTION=192h -e \

SERVER_USER=admin -e SERVER_PASSWORD=abcd.1234 -p 80:80 --volumes-from pmm-data percona/pmm-server:latest

110ec5a93240deb8c60e2a43029ef48023b06d804c7e3c48559894f24d72fb36


[[email protected] ~]# netstat -tunlp | grep 80

tcp        0      0 :::80                       :::*                        LISTEN      1744/docker-proxy   


[[email protected] ~]# yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm

[[email protected] ~]# yum install -y pmm-client


[[email protected] ~]# pmm-admin config --server 192.168.1.204 --server-user admin --server-password abcd.1234

OK, PMM server is alive.


PMM Server      | 192.168.1.204 (password-protected)

Client Name     | king01

Client Address  | 192.168.1.201 


[[email protected] ~]# vi /usr/local/percona/pmm-client/pmm.yml

server_address: 192.168.1.204

client_address: 192.168.1.201

bind_address: 192.168.1.201

client_name: king01

server_user: admin

server_password: abcd.1234


[[email protected] ~]# pmm-admin add linux:metrics

OK, now monitoring this system.


[[email protected] ~]# pmm-admin list

pmm-admin 1.7.0


PMM Server      | 192.168.1.204 (password-protected)

Client Name     | king01

Client Address  | 192.168.1.201 

Service Manager | unix-systemv


-------------- ------- ----------- -------- ------------ --------

SERVICE TYPE   NAME    LOCAL PORT  RUNNING  DATA SOURCE  OPTIONS 

-------------- ------- ----------- -------- ------------ --------

linux:metrics  king01  42000       YES      -                    


[[email protected] ~]# pmm-admin add mysql --user root --password abcd.1234 --host localhost

[linux:metrics] OK, already monitoring this system.

[mysql:metrics] OK, now monitoring MySQL metrics using DSN root:***@unix(/tmp/mysql.sock)

[mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN root:***@unix(/tmp/mysql.sock)


[[email protected] ~]# pmm-admin list

pmm-admin 1.7.0


PMM Server      | 192.168.1.204 (password-protected)

Client Name     | king01

Client Address  | 192.168.1.201 

Service Manager | unix-systemv


-------------- ------- ----------- -------- ------------------------------- ------------------------------------------

SERVICE TYPE   NAME    LOCAL PORT  RUNNING  DATA SOURCE                     OPTIONS                                   

-------------- ------- ----------- -------- ------------------------------- ------------------------------------------

mysql:queries  king01  -           YES      root:***@unix(/tmp/mysql.sock)  query_source=slowlog, query_examples=true 

linux:metrics  king01  42000       YES      -                                                                         

mysql:metrics  king01  42002       YES      root:***@unix(/tmp/mysql.sock)    


[[email protected] ~]# pmm-admin check-network

PMM Network Status


Server Address | 192.168.1.204

Client Address | 192.168.1.201 


* System Time

NTP Server (0.pool.ntp.org)         | 2018-02-18 16:36:55 +0800 CST

PMM Server                          | 2018-02-18 08:36:55 +0000 GMT

PMM Client                          | 2018-02-18 16:36:56 +0800 CST

PMM Server Time Drift               | OK

PMM Client Time Drift               | OK

PMM Client to PMM Server Time Drift | OK


* Connection: Client --> Server

-------------------- -------      

SERVER SERVICE       STATUS       

-------------------- -------      

Consul API           OK

Prometheus API       OK

Query Analytics API  OK


Connection duration | 1.514347ms

Request duration    | 1.856833ms

Full round trip     | 3.37118ms



* Connection: Client <-- Server

-------------- ------- -------------------- ------- ---------- ---------

SERVICE TYPE   NAME    REMOTE ENDPOINT      STATUS  HTTPS/TLS  PASSWORD 

-------------- ------- -------------------- ------- ---------- ---------

linux:metrics  king01  192.168.1.201:42000  OK      YES        YES

mysql:metrics  king01  192.168.1.201:42002  OK      YES        YES

                                        





以上是关于Percona Monitoring and Management(PMM)部署实录的主要内容,如果未能解决你的问题,请参考以下文章

Percona Monitoring and Management(PMM)部署实录

Percona Monitoring and Management (PMM) - 快速入门

Zabbix 3 中使用 Percona Monitoring Plugins 监控 MySQL

Percona Monitoring Plugins for Zabbix 安装和配置

(转)zabbix3.4使用percona-monitoring-plugins监控mysql

修正Percona Monitoring Plugins for Zabbix的一处脚本Bug