nfluxDB下載地址:https://portal.influxdata.com/downloads/數據庫
Grafana下載地址:https://grafana.com/grafana/download瀏覽器
打開/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/etc/influxdb/influxdb.conf,修改如下內容tcp
[[graphite]] # Determines whether the graphite endpoint is enabled. enabled = true database = "jmeter" # retention-policy = "" bind-address = ":2003" protocol = "tcp" consistency-level = "one"
[meta]
# Where the metadata/raft database is stored
dir = "/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/var/lib/influxdb/meta
"
# Automatically create a default retention policy when creating a database.
retention-autocreate = true
# If log messages are printed for the meta service
logging-enabled = true
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/var/lib/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/var/lib/influxdb/wal"
還是data下面spa
query-log-enabled = true
[retention]
# Determines whether retention policy enforcement enabled.
enabled = true
# The interval of time when retention policy enforcement checks run.
check-interval = "30m"
[shard-precreation]
# Determines whether shard pre-creation service is enabled.
enabled = true
# The interval of time when the check to pre-create new shards runs.
check-interval = "10m"
# The default period ahead of the endtime of a shard group that its successor
# group is created.
advance-period = "30m"
[monitor]
# Whether to record statistics internally.
store-enabled = true
# The destination database for recorded statistics
store-database = "_internal"
# The interval at which to record statistics
store-interval = "10s"
[http]
# Determines whether HTTP endpoint is enabled.
enabled = true
# Determines whether the Flux query endpoint is enabled.
flux-enabled = false
# Determines whether the Flux query logging is enabled.
# flux-log-enabled = false
# The bind address used by the HTTP service.
bind-address = ":8086"
配置完成後,開始啓動,進入/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/usr/bin,執行命令行
./influxd -config /Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/etc/influxdb/influxdb.conf3d
看到啓動界面,則表示啓動成功code
新打開窗口,打開influxdb的客戶端,進入server
/Users/qiaojiafei/Documents/work/soft/influxdb-1.7.6-1/usr/bin,執行blog
./influxflux
新建數據庫
create database jmeter
jmeter添加Backend Listener,並選擇influxdbMetricsSender
influxdbUrl輸入:http://localhost:8086/write?db=jmeter
啓動jmeter腳本運行,查看結果是否入庫
回到終端命令行,輸入
use jmeter
查看庫裏的數據記錄
select * from jmeter
進入grafana安裝目錄:
/Users/qiaojiafei/Documents/work/soft/grafana-6.1.6/bin,執行
./grafana-server
瀏覽器打開地址:http://localhost:3000/login,帳號密碼均是admin,首次登陸須要修改密碼
登陸成功後,點擊左側的設置,點擊data source
選擇add data source
選擇influxdb
輸入influxdb的信息
添加dashboards
也能夠選擇import,導入,官方的模板可參考:https://grafana.com/dashboards?dataSource=influxdb,搜索框輸入jmeter
點擊進去後,點擊 copy id
粘貼copy的id,點擊load
選擇influxdb的相關信息,點擊import
執行jmeter腳本後,能夠看到加載的信息