Grafana-7.4.0安裝
下載安裝包並安裝
wget https://dl.grafana.com/oss/release/grafana-7.4.0~beta1-1.x86_64.rpm
yum install grafana-7.4.0~beta1-1.x86_64.rpm啟動Grafana
service grafana-server start預設設定檔位置
/etc/grafana/grafana.ini預設log檔位置
 /var/log/grafana/grafana.log預設帳號密碼:admin/admin
安裝influxdb
vim /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key安裝InfluxDB
yum install -y  influxdb啟動influxdb服務
service influxdb start建立資料庫
influx -precision rfc3339建立「帳號」(admin) 和「密碼」(admin) 允許最高權限
CREATE USER "admin" WITH PASSWORD '12345678' WITH ALL PRIVILEGES
CREATE USER "telegraf" WITH PASSWORD 'metrics' WITH ALL PRIVILEGES建立「資料庫」為「grafana」
CREATE DATABASE "grafana"
CREATE DATABASE "telegraf"指定資料庫行InfluxQL語句
USE  <DB_NAME>接下來所有的SQL語句都會針對這個資料庫運行
登入
influx -username 'admin' -password 'passsword1234'預設設定檔位置
編輯「influxdb.conf」允許「透過」Web API 獲取數據。
vim /etc/influxdb/influxdb.conf
[http]
enabled = true
bind-address = ":8086"
auth-enabled = true
log-enabled = true
write-tracing = false
pprof-enabled = false
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"重新啟動influxdb服務
service influxdb restart安裝telegraf
yum -y install telegraf設定telegraf-server IP
vim /etc/telegraf/telegraf.conf
[[outputs.influxdb]]
urls = ["http://telegraf-server-IP:8086"]
database = "telegraf"
username = "telegraf"
password = "metrics"
[[inputs.net]]
[[inputs.netstat]]確認telegraf-server 的 8086 port有通
telnet 52.198.128.184 8086啟動 telegraf
service telegraf start重啟 telegraf
service telegraf restart