环境说明
监控机10.0.0.200
服务器10.0.0.201
Prometheus的架构
在被监控服务器10.0.0.201安装exporter
安装node_exporter
wgethttps://github.com/prometheus/node_exporter/releases/download/v0.15.1/node_exporter-0.15.1.linux-amd64.tar.gz
tar zxvf node_exporter-0.15.1.linux-amd64.tar.gz
cd node_exporter-0.15.1.linux-amd64
nohup ./node_exporter &
安装mysqld_exporter
连接mysql授予权限mysql -uroot -p
GRANT REPLICATION CLIENT, PROCESS ON *.* TO'exporter'@'localhost' identified by'123456';
GRANT SELECT ON performance_schema.* TO 'exporter'@'localhost';
flush privileges;
wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.10.0/mysqld_exporter-0.10.0.linux-amd64.tar.gz
tar zxvf mysqld_exporter-0.10.0.linux-amd64
cd mysqld_exporter-0.10.0.linux-amd64
建立配置文件my.cnf
[client]
user=exporter
password=123456
运行mysqld exporter
nohup ./mysqld_exporter -config.my-cnf="my.cnf" &
在监控主机10.0.0.200安装Prometheus
wget https://github.com/prometheus/prometheus/releases/download/v2.0.0/prometheus-2.0.0.linux-amd64.tar.gz
tar zxvf prometheus-2.0.0.linux-amd64.tar.gz
cd prometheus-2.0.0.linux-amd64

prometheus.yml

global:scrape_interval:     5s # By default, scrape targets every 15 seconds.evaluation_interval: 15s# Attach these labels to any time series or alerts when communicating with# external systems (federation, remote storage, Alertmanager).#external_labels:#  monitor: 'codelab-monitor'scrape_configs:- job_name: prometheusstatic_configs:- targets: ['10.0.0.200:9090']labels: instance: prometheus- job_name: linuxstatic_configs:- targets: ['10.0.0.201:9100']labels: instance: db1- job_name: mysqlstatic_configs:- targets: ['10.0.0.201:9104']labels:instance: db1

运行prometheus

nohup prometheus &

打开浏览器访问http://10.0.0.200:9090

查看Status->Target

安装Grafana
yuminstallhttps://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.2-1.x86_64.rpm
yum install fontconfig
yum install freetype*
yum install urw-fonts
Package details
  • Installs binary to /usr/sbin/grafana-server
  • Copies init.d script to /etc/init.d/grafana-server
  • Installs default file (environment vars) to /etc/sysconfig/grafana-server
  • Copies configuration file to /etc/grafana/grafana.ini
  • Installs systemd service (if systemd is available) name grafana-server.service
  • The default configuration uses a log file at /var/log/grafana/grafana.log
  • The default configuration specifies an sqlite3 database at /var/lib/grafana/grafana.db
编辑配置文件/etc/grafana/grafana.ini
找到[dashboards.json]
enabled = true
path = /var/lib/grafana/dashboards
安装dashboards
git clone https://github.com/percona/grafana-dashboards.git
cp -r grafana-dashboards/dashboards /var/lib/grafana/
运行grafana server
systemctl start grafana-server
访问grafana服务器
通过浏览器访问http://10.0.0.200:3000, 默认用户名和密码是admin
建立数据源

查看dashboard

以下展现的是node_exporter采集的数据

以下展现的是mysqld_exporter采集的数据

grafana的图表展现比cacti之类的确实漂亮多了。

参考资料

https://prometheus.io/
https://grafana.com/
https://github.com/percona/grafana-dashboards

EPG组合 (Exporter Prometheus Grafana) 监控MySQL相关推荐

  1. 使用Prometheus+Grafana 监控MySQL/MONGODB

    使用Prometheus+Grafana 监控MySQL/MONGODB 之前就久仰 Prometheus 大名,因为有用zabbix 进行监控,就没去安装它.现在正好用上监控MONGO+MYSQL. ...

  2. Prometheus+Grafana 监控 MySQL

    Prometheus 获取 MySQL 的监控数据,并通过 Grafana 展示的过程.首先来看整体架构图: 1 架构图 如上图,通过 mysql_exporter 获取 MySQL 的监控数据,通过 ...

  3. 使用Prometheus+Grafana监控MySQL

    你还不会监控服务器资源吗?你还不会监控mysql性能吗?但是你看了这篇文章之后我想你应该会了,哈哈哈,就算不会,至少你也知道是个怎么回事,这篇文章就来介绍怎么给自己的服务器系统搭建一个监控平台,要是还 ...

  4. grafana 监控mysql_Prometheus+Grafana监控MySQL性能

    今天来写一篇监控MySQL数据库的的监控方案:Prometheus+Grafana监控mysql性能 1.监控方案介绍 祖传老图修一修: 解释一波:①mysqld_exporter用来收集数据库的性能 ...

  5. grafana 监控mysql_prometheus+grafana监控mysql

    prometheus+grafana监控mysql 1.安装配置MySQL官方的 Yum Repository(有mysql只需设置监控账号即可) [root@localhost ~]# wget - ...

  6. Grafana监控系统之Prometheus+Grafana监控系统搭建

    Grafana监控系统之Prometheus+Grafana监控系统搭建 本文章内容较长,可通过右上角点击目录快速定位想看的内容 => => 一. 概述 1.1 Grafana介绍 Gra ...

  7. 基于Prometheus+Grafana监控SQL Server数据库

    墨墨导读:本文整理了基于Prometheus+Grafana监控SQL Server数据库的全过程,分享至此,希望对大家有帮助. 搭建SQL Server环境 使用容器建立SQL Server环境非常 ...

  8. prometheus+grafana监控以及企业微信告警

    prometheus+grafana监控以及企业微信告警(单机二进制部署) 一.下载部署包,更改其中两个包名称,放到/data下 1.安装包以及解压步骤 grafana-enterprise-8.4. ...

  9. promethues+alertmanager+grafana监控mysql和报警—详细文档

    promethues+alertmanager+grafana监控mysql和报警-详细文档 相关配套软件包网盘下载链接如下: 网盘地址: https://url28.ctfile.com/f/371 ...

最新文章

  1. python打开一个文件夹下所有txt文件-python读取一个目录下所有txt里面的内容方法...
  2. 通过 IDE/Maven 部署 Serverless 应用实践
  3. 他无一纸文凭,何以成为清华教授,被誉为“三百年才出一个的大师”?
  4. Mysql5.1.36 autoinstall.sh
  5. 如何在android模拟器中安装apk
  6. 3-20Pytorch与张量裁剪运算
  7. 一款好看的提示框-------记录一下地址
  8. 错误摘要 HTTP 错误 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容。
  9. VS2010解决闪退的方法
  10. vue.js 多页 php,vue-cli创建的项目,配置多页面的实现方法
  11. nsinteger转float_int、NSInteger、NSNumber和NSString以及相互转换
  12. 一款商城APP开发需要多少钱?
  13. 华科计算机学院新生家长群是多少,关于开通2020级本科和研究生新生群及新生家长群的公告...
  14. 理解-1NF,2NF,3NF
  15. 去哪儿网2015校园招聘前端笔试题
  16. C# .NET想要另存一个项目,sln文件丢了怎么办
  17. Python魔方方法详解
  18. 点投影到平面上的方法总结
  19. HDU 2188 JAVA
  20. SAP ABAP BAPI_MATERIAL_SAVEDATA 物料主数据EAN

热门文章

  1. Fat Jar Eclipse Plug-In Tutorial
  2. java 动态编译源代码
  3. 在一基金慈善年会上面发言
  4. 中石油训练赛 - Racing Gems(最长不下降子序列)
  5. POJ - 1655 Balancing Act(树的重心)
  6. 数据分析与挖掘实战-航空公司客户价值分析
  7. js反序列化html编码,JavaScript实现的反序列化json字符串操作示例
  8. AJAX DELETE
  9. LCM from 1 to n
  10. 关于丢番图方程x^2-dy^2=-1