1. 程式人生 > >Percona Monitoring and Management(PMM)部署實錄

Percona Monitoring and Management(PMM)部署實錄

linu caf rip ive https -name slow mapper proxy

[root@king04 ~]# yum install -y docker-io device-mapper-event-libs


[root@king04 ~]# service docker start

Starting cgconfig service: [ OK ]

Starting docker: [ OK ]


[root@king04 ~]# service docker status

docker (pid 1895) is running...


[root@king04 ~]# 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


[root@king04 ~]# 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


[root@king04 ~]# 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


[root@king04 ~]# netstat -tunlp | grep 80

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


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

[root@king01 ~]# yum install -y pmm-client


[root@king01 ~]# 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


[root@king01 ~]# 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


[root@king01 ~]# pmm-admin add linux:metrics

OK, now monitoring this system.


[root@king01 ~]# 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 -


[root@king01 ~]# 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)


[root@king01 ~]# 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)


[root@king01 ~]# 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)部署實錄