Grafana、InfluxDB、Telegraf 快速安裝
wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.9.x86_64.rpm sudo yum localinstall influxdb2-2.0.9.x86_64.rpm
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.21.1-1.x86_64.rpm sudo yum localinstall telegraf-1.21.1-1.x86_64.rpm
wget https://dl.grafana.com/oss/release/grafana-8.3.3-1.x86_64.rpm
sudo yum localinstall grafana-8.3.3-1.x86_64.rpm
Setting Telegraf to InfluxDB v2
vim /etc/telegraf/telegraf.conf
預設 telegraf 會抓取基本的 cpu, mem, net, diskio 等,務必要將 influxdb v1
註解,並開啟 influxdb v2
Add InfluxDB datasource in Grafana
這次以 InfluxDB2 為 Datasource,所以 Query Language 務必選
Flux,如此下面設定驗證的地方,才會變為 2.0 版的參數
Create a dashboard panel
我們可以透過 Flux 語法,建立 panel,並新增至 Dashboard 中。