prometheus + mysqld_exporter + grafana 实现对mysql db的监控
https://blog.csdn.net/hfut_wowo/article/details/78536022
1、参考这篇博文
2、博主的用的是windows版本 prometheus-2.5.0-rc.2.windows-amd64,mysqld_exporter-0.11.0.windows-amd64
3、prometheus和mysqld_exporter下载地址 https://prometheus.io/download/#mysqld_exporter
下载后mysqld_exporter 没有.my.cnf
手动新建一个内容如下
[client]
host=127.0.0.1
user=root
password=root
4、修改prometheus.yml 文件如下
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s). # Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093 # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml" # A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus' # metrics_path defaults to '/metrics'
# scheme defaults to 'http'. static_configs:
- targets: ['localhost:9090'] - job_name: mysql
static_configs:
- targets: ['localhost:9104']
labels:
instance: mydb
5、其他步骤同上面博文连接所述
6、spring boot集成prometheus
https://dzone.com/articles/creating-visualization-in-grafana
prometheus + mysqld_exporter + grafana 实现对mysql db的监控的更多相关文章
- Java Web学习系列——Maven Web项目中集成使用Spring、MyBatis实现对MySQL的数据访问
本篇内容还是建立在上一篇Java Web学习系列——Maven Web项目中集成使用Spring基础之上,对之前的Maven Web项目进行升级改造,实现对MySQL的数据访问. 添加依赖Jar包 这 ...
- 实现对MySQL数据库进行分库/分表备份(shell脚本)
工作中,往往数据库备份是件非常重要的事情,毕竟数据就是金钱,就是生命!废话不多,下面介绍一下:如何实现对MySQL数据库进行分库备份(shell脚本) Mysq数据库dump备份/还原语法: mysq ...
- 用 Python 脚本实现对 Linux 服务器的监控
目前 Linux 下有一些使用 Python 语言编写的 Linux 系统监控工具 比如 inotify-sync(文件系统安全监控软件).glances(资源监控工具)在实际工作中,Linux 系统 ...
- Python利用Plotly实现对MySQL中的数据可视化
Mysql表数据: demo.sql内容 create table demo( id int ,product varchar(50) ,price decimal(18,2) ,quantity i ...
- Java实现对Mysql的图片存取操作
1.MySQL中的BLOB类型 Mysql中可以存储大文件数据,一般使用的BLOB对象.如图片,视频等等. BLOB是一个二进制大对象,可以容纳可变数量的数据.因为是二进制对象,所以与编码方式无关.有 ...
- 通过innobackupex实现对MySQL的增量备份与还原
备份 增量备份是基于完整备份的,所以我们需要先做一次完整备份: innobackupex --password=test /backup/ 备注:test是我的MySQL服务的root用户的密码,/b ...
- 通过innobackupex实现对MySQL的完整备份与还原
备份 新建一个用于存放备份的目录 mkdir /backup 执行以下命令: innobackupex --password=test /backup/ 执行完后你会看到“completed OK!” ...
- Java如何实现对Mysql数据库的行锁
场景如下: 用户账户有余额,当发生交易时,需要实时更新余额.这里如果发生并发问题,那么会造成用户余额和实际交易的不一致,这对公司和客户来说都是很危险的. 那么如何避免: 网上查了下,有 ...
- c++简单实现对mysql数据库操作
1.连接数据库 #include <mysql.h> #include <iostream> #include<string> #include<vector ...
随机推荐
- Integer一类的比较问题
总体主要分为两个方面 ①比较的是值 一.基本数据类型与引用数据类型进行比较时,引用数据类型会进行拆箱(自动拆装箱需要在jdk1.5以上),然后与基本数据类型进行值的比较 举例: int i = 12; ...
- 535 Encode and Decode TinyURL 编码和解码精简URL地址
详见:https://leetcode.com/problems/encode-and-decode-tinyurl/description/ C++: class Solution { public ...
- Ajax返回数据格式
Ajax中返回数据的格式 Ajax中常见的返回数据的格式有三种:分别为文本,XML和JSON 返回的文本格式我们在上一堂课Ajax基础介绍中已经介绍过了 Ajax.php Form.html:通过 ...
- 使用nginx+tomcat实现静态和动态页面的分离
博主最近在优化一个javaweb项目,该项目之前一直都是使用tomcat处理用户请求的,无论静态还是动态的东西,一律交给tomcat处理.tomcat主要是负责处理servlet的,静态的文件还是交给 ...
- Obj-C Memory Management
Memory management is one of the most important process in any programming language. It is the proces ...
- sql server 2008怎么设置不允许windows身份验证
- iterator与iterable
用Iterator模式实现遍历集合Iterator模式是用于遍历集合类的标准访问方法.它可以把访问逻辑从不同类型的集合类中抽象出来,从而避免向客户端暴露集合的内部结构.例如,如果没有使用Iterato ...
- Luogu P4593 [TJOI2018]教科书般的亵渎
亵渎终于离开标准了,然而铺场快攻也变少了 给一个大力枚举(无任何性质)+艹出自然数幂和的方法,但是复杂度极限是\(O(k^4)\)的,不过跑的好快233 首先简单数学分析可以得出\(k=m+1\),因 ...
- Luogu P5351 Ruri Loves Maschera
先ORZ\(Owen\)一发.感觉是个很套路的题,这里给一个蒟蒻的需要特判数据的伪\(n\log^2 n\)算法,真正的两只\(\log\)的还是去看标算吧(但这个好想好写跑不满啊) 首先这种树上路径 ...
- 兼容IE6\7\8浏览器的html5标签的几个方案
html5大行其道的时代已经到来.如果你还在等待浏览器兼容,说明你已经与web脱节几条街了.当然,这得益于移动客户端的蓬勃发展.如果还在纠结于,是否应该掌握html5和css3技术时,请狠狠的抽自己几 ...