之前已经写过一篇在windows下的搭建过程,这次写一个在linux下,其实都差不多,大同小异。
Centos7+Jmeter5.2.1+Grafana7.1.3+InfluxDB1.8.1
一 Grafana下载安装,有两种方式,一从以yum存存储库中安装,二是yum手动安装,这里介绍yum手动安装。
2. 找到CentOS,按照文档上写的一一安装即可。
3. 启动程序
systemctl daemon-reload #重新加载配置文件
systemctl start grafana-server #启动服务
systemctl stop grafana-server #停止服务
systemctl enable grafana-server.service #设置开机启动
systemctl disable grafana-server.service #设置开机不启动
systemctl status grafana-server #查询服务状态
4. 在浏览器输入IP:3000即可(如果访问不了请查看端口是否开放哦)
二 InfluxDB下载安装
2. 通过查看源码下载1.8.1,由于我是在centos下安装,因此找到以下照着输入即可:
3. 修改配置文件:vim /etc/influxdb/influxdb.conf
修改HTTP端口信息
[http]
# Determines whether HTTP endpoint is enabled.
enabled = true
# The bind address used by the HTTP service.
bind-address = ":8086"
4. 启动程序
service influxdb start/systemctl start influxdb
5. 输入:influx就可以看到是否启动并进入influxdb命令,可以查询数据库创建数据库等操作;输入quit即退出influx
6. 创建数据库jmeter,具体命令我在windows下搭建那片写到了,可以去查看或者去查询influxdb的官方文档哈。
注意:8086是influxdb数据库端口哦,grafana就是通过这个端口查询数据的;2003是jmeter软件向influxdb数据发送数据的端口
三 Jmeter配置
添加监听器->后端监听器org.apache.jmeter.visualizers.backend.influxdb.Influx'dbBackendListenerClient
按照自己的influxdb配置添加数据库地址和数据库名称即可,具体在windows下搭建的也写到了。
以上的Grafana和Influxdb是安装在linux上的,而jmeter是我本地的windows上的。