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、最大响应时间

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

相关推荐
马立杰1 小时前
H3CNE-33-BGP
运维·网络·h3cne
Mason Lin1 小时前
2025年1月22日(网络编程 udp)
网络·python·udp
字节全栈_rJF2 小时前
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步
网络·智能路由器·php
EchoToMe2 小时前
电信传输基本理论/5G网络层次架构——超三万字详解:适用期末考试/考研/工作
网络·5g·架构
doubt。2 小时前
8.攻防世界Web_php_wrong_nginx_config
网络·安全·web安全·网络安全
没有名字的小羊3 小时前
Cyber Security 101-Build Your Cyber Security Career-Security Principles(安全原则)
运维·网络·安全
m0_465215793 小时前
TCP & UDP Service Model
服务器·网络·tcp/ip
esmember3 小时前
电路研究9.2.6——合宙Air780EP中HTTP——HTTP GET 相关命令使用方法研究
网络·网络协议·http·at指令
xianwu5434 小时前
反向代理模块jmh
开发语言·网络·数据库·c++·mysql
杨浦老苏5 小时前
面向npm的实时仪表板Dashly
网络·docker·群晖·导航