前言:MySQL监控也用过好多产品,包括zabbix、Lepus、PMM,想比较而言,PMM监控更加全面,安装配置也更加简单。

一、Server端安装

server端安装非常简单,我们采用docker的方式来部署。

1.拉取镜像

docker pull percona/pmm-server:latest

2.创建PMM数据容器

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

3.创建PMM服务器容器

docker run -d -p 80:80 \

--volumes-from pmm-data \

--name pmm-server \

-e SERVER_USER=test \

-e SERVER_PASSWORD=test \

-e ORCHESTRATOR_ENABLED=true \

--restart always \

percona/pmm-server:latest

4.查看服务启动

[root@db-monitor-01 tmp]# ps -ef|grep docker

root 8531 1 0 10:38 ? 00:00:05 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --seccomp-profile=/etc/docker/seccomp.json --selinux-enabled --log-driver=journald --signature-verification=false --storage-driver overlay2

root 8538 8531 0 10:38 ? 00:00:03 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc --runtime-args --systemd-cgroup=true

root 9095 8531 0 10:56 ? 00:00:00 /usr/libexec/docker/docker-proxy-current -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.17.0.2 -container-port 80

root 9100 8538 0 10:56 ? 00:00:00 /usr/bin/docker-containerd-shim-current 7c5656534fed82420cba57ec9ab3f929b242802dae2dcf3fbb400859d2517b6d /var/run/docker/libcontainerd/7c5656534fed82420cba57ec9ab3f929b242802dae2dcf3fbb400859d2517b6d /usr/libexec/docker/docker-runc-current

root 9660 2640 0 11:25 pts/1 00:00:00 grep --color=auto docker

二、Client安装

1.安装rpm包

rpm -ivh pmm-client-1.9.1-1.el7.x86_64.rpm

2.连接server

pmm-admin config --server server_ip --bind-address=client_ip --client-address=client_ip --server-user=admin --server-password=xxx --client-name=xxx

3.收集数据

pmm-admin add mysql --user=pmm --password=xxxx --port=3306

三、常用操作命令

PMM Client相关

[root@Mariadb-04 tmp]# pmm-admin --help

Usage:

pmm-admin [flags]

pmm-admin [command]

Available Commands:

config Configure PMM Client. 配置PMM客户端

add Add service to monitoring. 增加监控

remove Remove service from monitoring. 删除监控服务

list List monitoring services for this system. 列出监控服务

info Display PMM Client information (works offline). 打印PMM客户端信息

check-network Check network connectivity between client and server. 检查网络

ping Check if PMM server is alive. ping server端

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.删除PMM server端监控信息

repair Repair installation.重新安装

uninstall Removes all monitoring services with the best effort.删除所有服务

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

--verbose verbose output

-v, --version show version

Use "pmm-admin [command] --help" for more information about a command.

Docker相关

[root@db-monitor-01 tmp]# docker --help

Usage: docker COMMAND

A self-sufficient runtime for containers

Options:

--config string Location of client config files (default "/root/.docker")

-D, --debug Enable debug mode

--help Print usage

-H, --host list Daemon socket(s) to connect to (default [])

-l, --log-level string Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info")

--tls Use TLS; implied by --tlsverify

--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")

--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")

--tlskey string Path to TLS key file (default "/root/.docker/key.pem")

--tlsverify Use TLS and verify the remote

-v, --version Print version information and quit

Management Commands:

container Manage containers

image Manage images

network Manage networks

node Manage Swarm nodes

plugin Manage plugins

secret Manage Docker secrets

service Manage services

stack Manage Docker stacks

swarm Manage Swarm

system Manage Docker

volume Manage volumes

Commands:

attach Attach to a running container

build Build an image from a Dockerfile

commit Create a new image from a container's changes

cp Copy files/folders between a container and the local filesystem

create Create a new container

diff Inspect changes on a container's filesystem

events Get real time events from the server

exec Run a command in a running container

export Export a container's filesystem as a tar archive

history Show the history of an image

images List images

import Import the contents from a tarball to create a filesystem image

info Display system-wide information

inspect Return low-level information on Docker objects

kill Kill one or more running containers

load Load an image from a tar archive or STDIN

login Log in to a Docker registry

logout Log out from a Docker registry

logs Fetch the logs of a container

pause Pause all processes within one or more containers

port List port mappings or a specific mapping for the container

ps List containers

pull Pull an image or a repository from a registry

push Push an image or a repository to a registry

rename Rename a container

restart Restart one or more containers

rm Remove one or more containers

rmi Remove one or more images

run Run a command in a new container

save Save one or more images to a tar archive (streamed to STDOUT by default)

search Search the Docker Hub for images

start Start one or more stopped containers

stats Display a live stream of container(s) resource usage statistics

stop Stop one or more running containers

tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

top Display the running processes of a container

unpause Unpause all processes within one or more containers

update Update configuration of one or more containers

version Show the Docker version information

wait Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

四、监控界面

MySQL总览

MySQL innodb监控

MySQL 复制监控

OS CPU监控

OS disk监控

五、排错

Aug 17 21:07:24 localhost dockerd: time="2016-08-17T21:07:24.864612251+08:00" level=error msg="Attempting next endpoint for push after error: Get https://192.168.41.80:5001/v2/: dial tcp 192.168.41.80:5001: getsockopt: connection refused"

Aug 17 21:07:24 localhost dockerd: time="2016-08-17T21:07:24.864884008+08:00" level=error msg="Attempting next endpoint for push after error: Get https://192.168.41.80:5001/v1/_ping: dial tcp 192.168.41.80:5001: getsockopt: connection refused"

类似于如上错误解决方法:

vim /etc/docker/daemon.json

{ "insecure-registries":["myregistry.example.com:5000"] }

Restart docker daemon

systemctl restart docker.service

centos mysql pmm_【MySQL】MySQL监控利器PMM相关推荐

  1. MySQL 的实时性能监控利器

    操作系统及MySQL数据库的实时性能状态数据尤为重要,特别是在有性能抖动的时候,这些实时的性能数据可以快速帮助你定位系统或MySQL数据库的性能瓶颈,就像你在Linux系统上使用「top,sar,io ...

  2. mysql数据库监控程序_mysql数据库监控利器lepus天兔工具安装和部署

    需要的核心包如下: 以下软件包只需要部署在监控机即可.被监控机无需部署. 1.MySQL 5.0及以上(必须,用来存储监控系统采集的数据) 2.Apache 2.2及以上 (必须,WEB服务器运行服务 ...

  3. zabbix获取mysql主从状态_zabbix监控MySQL主从状态

    首先需要拥有zabbix环境及MySQL主从环境 搭建zabbix环境可参考:https://www.cnblogs.com/tyk3201/p/12033456.html 需要用到三台虚拟机 一:1 ...

  4. RHEL5(CentOS)下nginx+php+mysql+tomcat+memchached配置全过程(转)

    RHEL5(CentOS)下nginx+php+mysql+tomcat+memchached配置全过程 一.准备工作:SSH,telnet终端中文显示乱码解决办法vi /etc/sysconfig/ ...

  5. mysql 主从复制 性能_zabbix监控mysql各项性能,主从复制

    ###################################################### 监控mysql(默认监控模板不能用,再agentd.conf开启自定义key,自己编写脚本 ...

  6. Centos 6.4下MySQL备份及还原详情介绍

    我们前面文中中介绍了centos 6.4下MySQL的安装及配置,安装后为了保证数据的安全性所以我们同样也要学会备份及还原,备份及还原操作在我们的真实工作环境中是必不可少的,由于是对数据库数据备份,所 ...

  7. centos 默认mysql_centos改变mysql默认目录

    centos改变mysql默认目录 查看SELinux状态:如果未关闭,则要关闭 1./usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态 ...

  8. 简单分析MySQL 一则慢日志监控误报问题

    这篇文章主要介绍了MySQL 一则慢日志监控误报的问题分析与解决,帮助大家更好的理解和使用MySQL,感兴趣的朋友可以了解下 之前因为各种原因,有些报警没有引起重视,最近放假马上排除了一些潜在的人为原 ...

  9. mysql linux centos 安装_Linux centos 下在线安装mysql

    1,查看是否有安装过mysql: #rpm -qa | grep mysql 如果无结果返回,说明没有安装Mysql,可以全新安装. 2,查看在线服务器提供的Mysql相关的安装包有哪些: #yum ...

最新文章

  1. 解决不同浏览器的css兼容问题
  2. linux中chmod与chown两个命令详解
  3. 简述如何书写工程化的简单代码
  4. 数据结构与算法--解决问题的方法- 二叉树的的镜像
  5. POJ2411-Mondriaan's Dream【状态压缩dp】
  6. 【温故而知新-Javascript】窗口效果 (全屏显示窗口、定时关闭窗口)
  7. leetcode题解279-完全平方数
  8. 学会用感情营销是最高的智慧
  9. java追加到文件末尾_Java追加到文件
  10. 从企业角度看:网站设计的关键是了解与沟通
  11. 机器人操作系统 ROS 大全
  12. Antd 修改 Table 悬浮颜色、表头背景色
  13. Odoo Excel报表的设计及实现
  14. 3269: 万水千山粽是情
  15. 微信 发送图片 服务器上,公安提醒:微信发照片,千万别传原图”!5个步骤教你隐藏位置信息...
  16. 《ZigBee开发笔记》第五部分 外设篇 - 协议栈实验 第4章 CC2530热释电红外传感器
  17. 《R语言入门与实践》学习笔记二(chapter4~6)
  18. 小刚明白锻炼的重要性,每天坚持走10000步。这一天,他已经走了一些步,想知道还要走多少步才能完成这一天的锻炼任务。请你帮帮他。
  19. LOL召唤师信息查询工具(可查服务器、段位、胜点,隐藏分、战斗力)
  20. Android -- 每日一问:在项目中使用AsyncTask会有什么问题吗?

热门文章

  1. nginx处理http(http变量篇)
  2. 分支管理---分支管理策略
  3. Zookeeper01_必看
  4. leetcode 85. Maximal Rectangle | 85. 最大矩形(单调栈)
  5. leetcode 91. Decode Ways | 91. 解码方法(动态规划)
  6. 高并发负载均衡(二):LVS 的 DR,TUN,NAT 网络模型推导
  7. 算法设计与分析【第七周】贪心算法 最优装载问题
  8. BoltDB 源码分析
  9. 初学Linux应掌握的Shell命令
  10. python安装后在哪里找_python安装后的目录在哪里