首页 技术 正文
技术 2022年11月15日
0 收藏 397 点赞 4,541 浏览 1213 个字

使用到 Grafana+Prometheus+Mysql_exportor

使用Prometheus和Grafana,可以快速的构建我们性能测试的绝大多数的监控模型:数据库监控、服务器监控、Jvm监控、Tomcat监控、Mq监控、Redis监控、Consul监控、Haproxy监控、Nginx监控

….(明天见…)

构建正确和全链路的监控模型,是性能测试工作中必须的工作,也是性能测试的基础。

搭建性能测试Mysql监控模型

效果图

安装Mysqld_exporter

在需要监控的数据库服务器安装

#下载地址
https://prometheus.io/download/#下载
mysqld_exporter
node_exporter#安装
tar -xvf mysqld_exporter-0.12.1.linux-amd64.tar.gz
tar -xvf node_exporter-1.0.0-rc.0.linux-amd64.tar.gz#创建配置文件
cd mysqld_exporter-0.12.1.linux-amd64
vi my.cnf
[client]
user=xxxxxx
password=xxxx
ip=xxxx
port=xxx#启动
nohup ./mysqld_exporter --config.my-cnf=my.cnf & > mysqld_exporter.log 2>&1 &
nohup ./node_exporter > node_exporter.log 2>&1 &

安装Prometheus

#下载地址
https://prometheus.io/download/
#下载
prometheus
#安装
tar -xvf prometheus-2.18.1.linux-amd64.tar.gz
#修改配置文件
vi prometheus.ym
- job_name: 'mysql'
static_configs:
- targets: ['数据库ip:9104']
labels:
instance: 数据库ip
- job_name: 'linux'
static_configs:
- targets: ['数据库ip:9100']
labels:
instance: db
#启动
nohup ./prometheus > prometheus.log 2>&1 &

安装Grafana

#下载地址
https://grafana.com/grafana/download
#安装
rpm -ivh grafana-6.7.3-1.x86_64.rpm
#启动
systemctl start grafana-server
#访问
ip:3000 账号admin/admin

Grafana设置Data source

Grafana设置Dashboards

下载Mysql仪表盘

https://grafana.com/grafana/dashboards/7362

导入Mysql仪表盘

完成。监控包含丰富的计数器,监控指标。

扫一扫,关注我

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,498
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,911
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,745
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,499
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,138
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,302