prometheus+node_exporter+grafana實踐
介紹:
prometheus:開源監控系統,可參考博客prometheus的搭建與使用
node_exporter:服務器端agent,負責採集服務器基礎監控項
grafana:一個開源的度量分析與可視化套件,常用於展示監控信息
安裝:
安裝node_exporter,啓動後監聽9100端口
-
wget https://github.com/prometheus/node_exporter/releases/download/v0.16.0-rc.3/node_exporter-0.16.0-rc.3.linux-amd64.tar.gz
-
tar -zxvf node_exporter-0.16.0-rc.3.linux-amd64.tar.gz
-
cd node_exporter-0.16.0-rc.3.linux-amd64
-
./node_exporter
安裝grafana,啓動後監聽3000端口
-
yum install grafana
-
service grafana-server start
配置:
1、配置prometheus,修改prometheus.yml配置文件,增加安裝node_exporter的機器,配置完成後重啓
-
scrape_configs:
-
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
-
- job_name: 'node_exporter'
-
# metrics_path defaults to '/metrics'
-
# scheme defaults to 'http'.
-
static_configs:
-
- targets: ['localhost:9100']
2、配置grafana增加data source,訪問localhost:3000,推薦展示樣式選擇Node Exporter Full
效果: