首页 > 数据库 > MySQL > percona pmm监控--mysql
一、说明:Percona Monitoring and Management (PMM) is an open-source platform for managing and monitoring MySQL and MongoDB performance. It is developed by Percona in collaboration with experts in the field of managed database services, support and consulting.
PMM is a free and open-source solution that you can run in your own environment for maximum security and reliability. It provides thorough time-based analysis for MySQL and MongoDB serv ers to ensure that your data works as efficiently as possible.(更多内容请看官方https://www.percona.com/doc/percona-monitoring-and-management/index.html)
安装配置pmm-server:
环境说明:172.16.11.187 ces1 pmm-server
172.16.11.188 ces2 pmm-admin
centos 6.7
yum -y update
yum --enablerepo=epel -y install docker-io
docker 创建容器 :
docker create -v /opt/prometheus/data -v /opt/consul-data -v /var/lib/mysql --name pmm-data percona/pmm-server:1.2.0 /bin/true
启动:
docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:1.2.0
查看状态:
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d24aae40a2f percona/pmm-server:1.2.0 "/opt/entrypoint.sh" 5 minutes ago Up 5 minutes 0.0.0.0:80->80/tcp, 443/tcp pmm-server
bed28dd58ff8 percona/pmm-server:1.2.0 "/bin/true" 5 minutes ago
在ces2上安装pmm-admin客户端软件:
rpm -ivh 软件名;
在client配置serve
pmm-admin config --server 172.16.11.187
OK, PMM server is alive.
PMM Server | 172.16.11.187
Client Name | ces2
Client Address | 172.16.11.188
添加mysql监控
pmm-admin add mysql --user root --password 123456 --host 127.0.0.1 --port 3306
问题:
1. docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eaacb8341ca1 percona/pmm-server:1.2.0 "/opt/entrypoint.sh" 17 minutes ago Dead 443/tcp, 0.0.0.0:80->80/tcp agitated_mccarth
root@ces1 :~# docker rm -f eaacb8341ca1
Error response from daemon: Cannot destroy container eaacb8341ca1: Driver devicemapper failed to remove root filesystem eaacb8341ca1ea4914086bf1fd3fc47552f466f82662b63a8bd96ed0173333ba: Device is Busy
Error: failed to remove containers: [eaacb8341ca1]
docker rm -f $(docker ps -a -q -f status=Dead)
COMMAND_FAILED: ‘/sbin/iptables -t nat -A Docker -p tcp -d 0/0 –dport 8111 -j DNAT –to-destination 172.17.0.6:8111 ! -i docker0’ failed: iptables: No chain/target/match by that name.
解决方法:
pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
重启docker后解决
service docker restart
三、效果
ip(pmm-server)+端口
图3-1 os 资源
图3-2 mysqlview
图3-3 slow query
图3-4 slave的
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30162734/viewspace-2144190/ ,如需转载,请注明出处,否则将追究法律责任。