性能工具之JMeter+InfluxDB+Grafana打造壓測可視化實時監控(centos7環境)

前提條件,已經安裝jmeter並能夠運行python

1.安裝influxdata數據庫

wget et https://dl.influxdata.com/influxdb/releases/influxdb-1.7.7.x86_64.rpmubuntu

sudo yum localinstall influxdb-1.7.7.x86_64.rpmvim

2.修改influxdb配置瀏覽器

vim /etc/influxdb/influxdb.conf    #進入influxdb配置文件,ubuntu默認配置文件地址

在命令模式輸入/graphite,或者輸入?graphite,找到graphite修改相關內容,注意去掉註釋tcp

  

再切換到寫模式(輸入i),把註釋去掉spa

[[graphite]]
  # Determines whether the graphite endpoint is enabled.
    enabled = true
    database = "jmeter"
    retention-policy = ""
    bind-address = ":2003"
    protocol = "tcp"
    consistency-level = "one"

保存配置文件(點擊鍵盤的esc,輸入英文冒號,再輸入wq!,回車)code

4.啓動InfluxDBserver

influxd -config /etc/influxdb/influxdb.conf

 也許會報錯,能夠執行下面的命令/bin/systemctl start influxdb.serviceblog

5.啓動influx,建立數據庫和用戶

# influx
> create database jmeter
> show databases
> use jmeter #切換數據庫
Using database jmeter
> CREATE USER "admin" WITH PASSWORD 'admin' WITH ALL PRIVILEGES # 建立管理員權限的用戶

  

 

 

 6.安裝配置Grafana

官網有安裝教程 https://grafana.com/grafana/download

wget https://dl.grafana.com/oss/release/grafana-6.2.5-1.x86_64.rpm 
sudo yum localinstall grafana-6.2.5-1.x86_64.rpm 

 

7.啓動服務並訪問

service grafana-server start

使用瀏覽器打開 http://IP:3000/login,訪問Grafana主頁,帳號密碼默認是admin

 

 

8.添加數據庫

 

 

 

 8.添加模板

 在官網有不少不錯的模板,咱們直接複製id就能夠用了

 

 

 

 

 

相關文章
相關標籤/搜索