转载:http://dbaplus.cn/news-21-1074-1.html @H_403_1@
转载:http://www.jb51.cc/article/p-dmoxfoss-rv.html @H_403_1@
@H_403_1@
简介:@H_403_1@
PMM是一款管理和监控MysqL,MongoDB性能的开源平台。其由percona公司开发,支持和咨询。@H_403_1@
PMM是免费和开源的解决方案,分为server端和client端,server端安装在监控服务器上,client端安装在被监控服务器上。@H_403_1@
部署:@H_403_1@
1、Docker安装@H_403_1@
# yum install docker -y@H_403_1@
启动docker:@H_403_1@
# service docker start@H_403_1@
2、配置 Docker 加速器@H_403_1@
网址:https://dashboard.daocloud.io/@H_403_1@
@H_403_1@
点击“加速器”@H_403_1@
@H_403_1@
执行上图生成的脚本,该脚本可以将 --registry-mirror 加入到你的 Docker 配置文件/etc/docker/daemon.json中,这个配置是为了下一步顺利进行的,使用Docker pull 镜像这个超级慢,因为docker的hub是在国外的,所以是特别慢的,DaoCloud在国内提供了首个Docker Hub镜像服务,所以这个配置可以大大加速这个过程,为了PMM安装做好准备。@H_403_1@
@H_403_1@
3、PMM Server安装@H_403_1@
(1)下载PMM Server Docker镜像@H_403_1@
# docker create \@H_403_1@
-v /opt/prometheus/data \@H_403_1@
-v /opt/consul-data \@H_403_1@
-v /var/lib/grafana \@H_403_1@
--name pmm-data \@H_403_1@
percona/pmm-server:1.1.1 /bin/true@H_403_1@
(2)启动@H_403_1@
# docker run -d \@H_403_1@
-p 80:80 \@H_403_1@
--volumes-from pmm-data \@H_403_1@
--name pmm-server \@H_403_1@
--restart always \@H_403_1@
percona/pmm-server:1.1.1@H_403_1@
(3)查看docker运行状态@H_403_1@
#dockerps CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES e0d1950b33ffpercona/pmm-server:1.1.1"/opt/entrypoint.sh"3minutesagoUp3minutes0.0.0.0:80->80/tcp,443/tcppmm-server
@H_403_1@
(4)打开浏览器http://ip地址@H_403_1@
@H_403_1@
@H_403_1@
@H_403_1@
Component@H_403_1@ |
URL@H_403_1@ |
http://yourip@H_403_1@ |
|
Query Analytics (慢日志分析)@H_403_1@ |
http://yourip/qan/@H_403_1@ |
Metrics Monitor (Grafana)@H_403_1@ |
http://yourip/graph/@H_403_1@ user name:admin@H_403_1@ password:admin@H_403_1@ |
Orchestrator@H_403_1@ |
http://yourip/orchestrator@H_403_1@
|
3、PMM Client安装@H_403_1@
@H_403_1@
(1)下载安装@H_403_1@
@H_403_1@
#wget https://www.percona.com/downloads/pmm-client/pmm-client-1.1.1/binary/tarball/pmm-client-1.1.1.tar.gz@H_403_1@ #tar -zxvf pmm-client-1.1.1.tar.gz@H_403_1@ #cd pmm-client-1.1.1/@H_403_1@ #./install@H_403_1@ |
(2)连接PMM Server@H_403_1@
@H_403_1@
pmm-admin config --server 192.168.75.21 |
(3)增加MysqL监控服务(我的client和server在一台机器上)@H_403_1@
@H_403_1@
pmm-admin add MysqL --user admin --password 123456 --host 192.168.75.21 |
(4)查看@H_403_1@
@H_403_1@
#pmm-adminlist pmm-admin1.1.1 PMMServer|192.168.75.21 ClientName|mariadb10 ClientAddress|192.168.75.21 ServiceManager|linux-systemd -------------------------------------------------------------------------------------------------- SERVICETYPENAMELOCALPORTRUNNINGDATASOURCEOPTIONS -------------------------------------------------------------------------------------------------- MysqL:queriesmariadb10-YESadmin:***@tcp(192.168.75.21:3306)query_source=slowlog linux:metricsmariadb1042000YES- MysqL:metricsmariadb1042002YESadmin:***@tcp(192.168.75.21:3306)
4、使用:
@H_403_1@
@H_403_1@
@H_403_1@ 原文链接:https://www.f2er.com/centos/378633.html