9

手把手教你搭建Windows 搭建Prometheus + Grafana + Jmeter可视化监控平台 - 久曲健

 1 year ago
source link: https://www.cnblogs.com/longronglang/p/17177231.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

下载安装包

  • Prometheus
  • windows_exporter
  • Grafana

下载地址:https://share.weiyun.com/D9sdiWoC

bad43ab93f1f4acaa79e817377b414a9~tplv-k3u1fbpfcp-watermark.image?
  • Exporter 监控工具,获取数据
  • Prometheus 普罗米修斯时序数据库,用来存储和查询监控数据
  • Grafana 仪表盘

1、配置 windows_exporter

  • 启动 windows_exporter
  • 浏览器访问http://localhost:9182/ (默认端口9182)
  • 点击Metrics
  • 看到如下界面Windows_exporter安装成功

37b6480922e0492c925629a26a934fa1~tplv-k3u1fbpfcp-watermark.image?

cab253fc9f37436380021c2e95acdf66~tplv-k3u1fbpfcp-watermark.image?

2、配置 Prometheus

6377905f71c34dc6ab3663ddaaf6bb68~tplv-k3u1fbpfcp-watermark.image?

2b4bfdb98ff646aa87dfaa99157cf342~tplv-k3u1fbpfcp-watermark.image?

bc752530ef3d41c88d89fad74b12712a~tplv-k3u1fbpfcp-watermark.image?

3、配置 Grafana

在bin目录下启动grafana-server.exe

如安装的是安装版,会自行启动,无需手动启动

c19bf877c08f4b7cafde6ae824093f42~tplv-k3u1fbpfcp-watermark.image?

访问 http://localhost:3000

b85c3e9f75eb43afa29dc3d332b80a88~tplv-k3u1fbpfcp-watermark.image?

初始的登陆账户和密码是:admin/admin,登陆进去后可自行修改密码

配置 Grafana 数据源,选择prometheus

576b87bd1b5e451ea25f8c97b704267b~tplv-k3u1fbpfcp-watermark.image?

数据源配置

96891ae8c9964c369888acf0af3caeab~tplv-k3u1fbpfcp-watermark.image?
  • Save&Test

558e46e407504332893a5d6121925385~tplv-k3u1fbpfcp-watermark.image?

输入win - node-export模板:windows系统导入的是10467模板,Linux8919模板,也可以直接导入json文件

4d4ad510e12148cbb14efd43cac94ffc~tplv-k3u1fbpfcp-watermark.image?

点击Load看到监控页面

0e17e8d2bb214288b8858d5f7373c792~tplv-k3u1fbpfcp-watermark.image?

554b6641edf14a7894ffa682e15c8ecf~tplv-k3u1fbpfcp-watermark.image?

4、配置Influxdb + Grafana + Jmeter

配置InfluxDB

修改配置(influxdb.conf)

xml
[http]  
# Determines whether HTTP endpoint is enabled.  
enabled = true

# The bind address used by the HTTP service.

bind-address = ":8086"

f3124bf37a204829bf6e2d00f45139ec~tplv-k3u1fbpfcp-watermark.image?

windows中开启influxd.exe服务

43f74ff4bfd74e0a93865b20bbb1d979~tplv-k3u1fbpfcp-watermark.image?

启动influx.exe【cli客户端】

sql
> create database jmeter #创建名字是jmeter数据库,

> show databases

> use jmeter

> select * from jmeter limit 10

bdc5ec2dd75349f59a8ba6ecc28519e0~tplv-k3u1fbpfcp-watermark.image?

配置Jmeter

数据来源:与jmeter集成使用

  • jmeter做性能测试,产生数据,写入influxdb数据库中
  • 打开jmeter,添加“后端监听器”
  • 后端监听器的实现:选择带有“influxdb”的
  • influxdbUrl:influxdb的数据的Ip地址,默认数据库名称为:jmeter
  • influxdbUrl 对应的值(http://127.0.0.1:8086/write?db=jmeter)

32466246ba97417abbfd57a5bf119099~tplv-k3u1fbpfcp-watermark.image?

Grafana添加模板

  • 启动服务 grafana-server.exe
  • 启动后访问:http://127.0.0.1:3000,默认账号/密码:admin/admin
  • 配置 Grafana 数据源
  • 选择InfluxDB
  • HTTP配置:http://127.0.0.1:8086
  • InfluxDB Details配置:Database:jmeter
  • 导入 jmeter Dashboard
  • Dashboard ID: 5496

c2e34445b73c42068c89f007af5d635f~tplv-k3u1fbpfcp-watermark.image?

57b7cf37835e4c329f42c29c234f0fb0~tplv-k3u1fbpfcp-watermark.image?

__EOF__

本文作者: 久曲健的测试窝 本文链接: https://www.cnblogs.com/longronglang/p/17177231.html 关于博主: 评论和私信会在第一时间回复。或者直接私信我。 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处! 声援博主: 如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK