詳細(xì)的部署信息請參考官方文檔:
創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站設(shè)計、網(wǎng)站建設(shè)與策劃設(shè)計,鐘山網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:鐘山等地區(qū)。鐘山做網(wǎng)站價格咨詢:028-86922220
https://www.percona.com/doc/percona-monitoring-and-management/deploy/server/docker.setting-up.html#pmm-server-docker-image-pulling
一、server端部署:
1.監(jiān)控機器安裝docker:
ip:192.168.56.101
操作系統(tǒng)版本:
[root@my-mm ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
安裝:
yum install -y docker
啟動:
systemctl start docker
systemctl enable docker
2.拉取PMM服務(wù)器映像:
docker pull percona/pmm-server:latest
[root@my-mm ~]# docker pull percona/pmm-server:latest
Trying to pull repository docker.io/percona/pmm-server ...
latest: Pulling from docker.io/percona/pmm-server
aeb7866da422: Pull complete
904d1ed4e1e3: Pull complete
Digest: sha256:5eb0fe89d2e93198e7070e92f22cdd95fcef5db257f70a3e05071685f2503a56
Status: Downloaded newer image for docker.io/percona/pmm-server:latest
3.創(chuàng)建一個PMM數(shù)據(jù)容器:
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
[root@my-mm ~]# 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
8448b22b99f7d667f6bfa9dcc78a4e662aed57a4d36473061d2533afa6c3e515
4.創(chuàng)建和運行 PMM Server Container:
docker run -d -p 80:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:latest
[root@my-mm ~]# docker run -d -p 80:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:latest
56372ece726b9e61f29d2f0dd1e72a5353237015997f2e7637a7164b05f38727
檢查docker狀態(tài):
[root@my-mm ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
56372ece726b percona/pmm-server:latest "/opt/entrypoint.sh" 28 seconds ago Up 27 seconds 0.0.0.0:80->80/tcp, 443/tcp pmm-server
5.登錄:
http://192.168.56.101
默認(rèn)登錄信息如下,可以自行修改:
username:admin password:admin
登錄界面:
二、客戶端部署:
6.客戶端部署軟件,在需要被監(jiān)控MySQL服務(wù)端安裝pmm-client:
客戶端信息(192.168.56.102)
添加yum源(或者下載安裝包):
rpm -ivh https://www.percona.com/redir/downloads/percona-release/redhat/latest/percona-release-0.1-6.noarch.rpm
安裝pmm-client:
yum install pmm-client –y
卸載軟件:
yum remove pmm-client -y
6.添加監(jiān)控:
客戶端連接pmm server,配置監(jiān)控服務(wù)器:
pmm-admin config --server 192.168.56.101
添加操作系統(tǒng)監(jiān)控:
[root@my2 ~]# pmm-admin add linux:metrics
OK, now monitoring this system.
在需要監(jiān)控的數(shù)據(jù)庫上面創(chuàng)建用戶:
GRANT ALL PRIVILEGES ON *.* TO 'pmm-monitor'@'%' IDENTIFIED BY 'pmm-monitor';
flush privileges;
添加mysql監(jiān)控:
pmm-admin add mysql --user pmm-monitor --password pmm-monitor --host 192.168.56.102 --port 3306
[root@my2 ~]# pmm-admin add mysql --user pmm-monitor --password pmm-monitor --host 192.168.56.102 --port 3306
[linux:metrics] OK, already monitoring this system.
[mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm-monitor:***@tcp(192.168.56.102:3306)
[mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN pmm-monitor:***@tcp(192.168.56.102:3306)
web頁面查看添加的mysql監(jiān)控信息:
客戶端查看監(jiān)控信息:
[root@my2 ~]# pmm-admin list
pmm-admin 1.16.0
PMM Server | 192.168.56.101
Client Name | my2.ml.com
Client Address | 192.168.56.102
Service Manager | linux-upstart
-------------- ----------- ----------- -------- ----------------------------------------- --------------------------------------------------------------------------------------
SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS
-------------- ----------- ----------- -------- ----------------------------------------- --------------------------------------------------------------------------------------
mysql:queries my2.ml.com - YES pmm-monitor:***@tcp(192.168.56.102:3306) query_source=slowlog, query_examples=true, slow_log_rotation=true, retain_slow_logs=1
linux:metrics my2.ml.com 42000 YES -
mysql:metrics my2.ml.com 42002 YES pmm-monitor:***@tcp(192.168.56.102:3306)
默認(rèn)監(jiān)控顯示是以主機名字顯示,如果機器上面部署多個mysql或者需要指定顯示的主機名:
pmm-admin config --server 192.168.56.101 client-name #client-name是指定監(jiān)控顯示名稱client-name
例如:
pmm-admin add mysql --user pmm-monitor --password 'pmm-monitor' --socket=/data/mysql_3317/data/mysql.sock mysql-3307
清除監(jiān)控數(shù)據(jù):
pmm-admin purge 會提示幫助信息,示例如下:
pmm-admin purge linux:metrics my2.ml.com
pmm-admin purge mysql:metrics my2.ml.com
刪除添加的監(jiān)控項:
pmm-admin remove mysql:metrics my2.ml.com
直接輸入pmm-admin會顯示所有的幫助信息:
[root@my2 ~]# pmm-admin
Usage:
pmm-admin [flags]
pmm-admin [command]
Available Commands:
config Configure PMM Client.
add Add service to monitoring.
annotate Annotate application events.
remove Remove service from monitoring.
list List monitoring services for this system.
info Display PMM Client information (works offline).
check-network Check network connectivity between client and server.
ping Check if PMM server is alive.
start Start monitoring service.
stop Stop monitoring service.
restart Restart monitoring service.
show-passwords Show PMM Client password information (works offline).
purge Purge metrics data on PMM server.
repair Repair installation.
uninstall Removes all monitoring services with the best effort.
summary Fetch system data for diagnostics.
help Help about any command
Flags:
-c, --config-file string PMM config file (default "/usr/local/percona/pmm-client/pmm.yml")
-h, --help help for pmm-admin
--skip-root skip UID check (experimental)
--timeout duration timeout (default 5s)
--verbose verbose output
-v, --version show version
Use "pmm-admin [command] --help" for more information about a command.
文章名稱:pmm部署監(jiān)控mysql數(shù)據(jù)庫
文章URL:http://www.rwnh.cn/article32/jiecsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、用戶體驗、、企業(yè)網(wǎng)站制作、網(wǎng)站導(dǎo)航、品牌網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)