telegraf、influxdb、grafana安装配置及后端监听器操作

InfluxDB(时序数据库),常用的一种使用场景:监控数据统计。

grafana,用作监控页面的前端展示。

telegraf,数据采集器。

ITG及快捷启动百度网盘:百度网盘

链接: 提取码: 0000

其他地址链接:https://repos.influxdata.com/rhel/7/x86_64/stable/

一、Influxdb安装及配置

下载:wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.9.x86_64.rpm

解压:yum localinstall influxdb-1.7.9.x86_64.rpm

启动:systemctl start influxd

查看开启状态和端口号:

默认情况下,InfluxDB会使用如下的端口:

  • TCP8086端口是服务器监听端口,对HTTP API响应
  • TCP8088端口是RPC服务端口,用于数据备份和保存
bash 复制代码
systemctl status influxd  
netstat -tnlp

创建 Influxdb 数据库:

bash 复制代码
influx
create database telegraf  或者 create database jmeter
show databases
exit

默认端口是 8086

二、Telegraf安装及配置

  1. 下载与安装
bash 复制代码
wget http://get.influxdb.org/telegraf/telegraf-0.12.1-1.x86_64.rpm
yum localinstall telegraf-0.12.1-1.x86_64.rpm

Tips:如果上面没反应或者报错,使用百度云盘先上传到所在服务器中

链接: telegraf 百度云盘

提取码: 0000

在使用命令安装(有y按y)

bash 复制代码
yum localinstall telegraf-1.7.3-1.x86_64.rpm
  1. 配置
bash 复制代码
vi /etc/telegraf/telegraf.conf

输入 /urls

输入 i

修改内容如下

urls = "http://localhost:8086" #infulxdb 地址

database = "telegraf" #数据库

retention_policy = "" 必须设置为空

输入 :wq

  1. 启动 Telegraf

    systemctl restart telegraf

  2. 检查 Telegraf 配置,出现如下running代表配置成功

    service telegraf status

三、grafana导入模板是 5496

Name可以更改为: RT_TPS_ERROR

用来展示并监控聚合报告的数据,点击Import

四、Grafana安装与配置参考之前博文

  1. grafana安装参考:https://blog.csdn.net/m0_44974332/article/details/138510220?spm=1001.2014.3001.5502

启动/停止/状态

systemctl start influxd

systemctl start telegraf

systemctl start grafana-server

systemctl stop influxd

systemctl stop telegraf

systemctl stop grafana-server

systemctl status influxd

systemctl status telegraf

systemctl status grafana-server

常用命令

firewall-cmd --state ##查看防火墙运行状态,是否是 running

firewall-cmd --reload ##重新载入配置,比如添加规则之后,需要执行此命令

firewall-cmd --list-ports ##列出开放的端口

firewall-cmd --add-port=3000/tcp --permanent ##永久添加 3000 端口

systemctl stop firewalld ##关闭防火墙

systemctl start firewalld ##开启防火墙

systemctl status firewalld ##查看防火墙状态

systemctl restart firewalld ##重启防火墙

systemctl disable firewalld ##开机关闭防火墙,即永久关闭

第二种方法:

如果启动telegraf、influxdb后grafanf一直统计不到数据

排查原因:

  1. 把8086端口加入防火墙
    firewall-cmd --add-port=8086/tcp --permanent
    firewall-cmd --reload
  2. 先卸载之前的telegraf、influxdb,通过
bash 复制代码
whereis telegraf
whereis influxdb

找到的所有数据通过:rm -rf 路径 删除

  1. 更改telegraf、influxdb版本
bash 复制代码
wget https://repos.influxdata.com/rhel/7/x86_64/stable/influxdb-1.8.2.x86_64.rpm
wget https://repos.influxdata.com/rhel/7/x86_64/stable/telegraf-1.0.0.x86_64.rpm

安装

bash 复制代码
sudo yum localinstall influxdb-1.8.2.x86_64.rpm
sudo yum localinstall telegraf-1.0.0.x86_64.rpm
  1. 不需要更改配置文件,直接启动这两个服务
bash 复制代码
systemctl start influxd
systemctl start telegraf
systemctl start grafana-server    //如果grafana没启动页顺便启动

jmeter添加后端监听器


grafana配置,然后导入模板和上面配置一致

查看压测结果

主要查看吞吐量和响应时间

Throughout:单接口压测也可以更改为QPS,会依QPS为指标。混合场景压测更改为TPS,会依TPS为指标

Response Times:响应时间,从右侧可以查看出平均、90、96、99、最大响应时间

其他指标比如错误率等也可以关注

相关推荐
对空六课31 分钟前
两个统计平台数据不同:用同一时间窗和事件样本做差异定位
大数据·前端·网络·数据库
User_芊芊君子37 分钟前
【JavaEE初阶 - 网络原理】网络分几层?从自定义协议聊到 DNS
java·网络·java-ee
2603_969579288 小时前
备份最常用的三个软件是什么软件
网络
缓慢更新9 小时前
表单引擎的存储建模:宽表与文档库的取舍
运维·服务器·网络·数据库·低代码·oracle·适配器模式
Data_Journal10 小时前
如何绕过 Cloudflare:网页抓取的最佳方法
网络·python
续写烂尾10 小时前
贴片 SD NAND、eMMC、TF 卡规格怎么定?硬件工程师选型清单
运维·服务器·网络
重生之高冷汉堡包10 小时前
移动代理 VS 住宅代理IP:性能成本对比与选择
网络
迪康妍妍10 小时前
终端管控实操:封堵网盘与IM外发通道的落地思路
运维·网络·安全·架构·安全性测试
科技小E10 小时前
监控设备品牌杂乱无法互通?EasyGBS打通孤岛,统一汇聚视频
服务器·网络·音视频
YH_Analytics10 小时前
2026-2032 食品吸液垫行业市场规模与增长预测
大数据·网络·人工智能