環(huán)境
系統(tǒng):CentOS 7.5
軟件:node_exporter-0.16.0.linux-amd64.tar.gz
客戶端
下載node_exporter
地址:https://prometheus.io/download/-
安裝
# tar -xzvf node_exporter-0.16.0.linux-amd64.tar.gz # mkdir /usr/local/prometheus # mv node_exporter-0.16.0.linux-amd64 /usr/local/prometheus/node_exporter
-
創(chuàng)建用戶并授權
# useradd prometheus # chown -R prometheus:prometheus /usr/local/prometheus
-
添加啟動服務
# vim /usr/lib/systemd/system/node_exporter.service [Unit] Description=node_exporter After=network.target [Service] Type=simple User=prometheus ExecStart=/usr/local/prometheus/node_exporter/node_exporter Restart=on-failure [Install] WantedBy=multi-user.target
-
啟動
# systemctl enable node_exporter.service # systemctl start node_exporter.service
Prometheus端
-
配置Prometheus
# vim /usr/local/prometheus/prometheus.yml scrape_configs: - job_name: 'linux' static_configs: - targets: ['10.10.10.1:9100']
-
重啟Prometheus
# systemctl restart prometheus
Grafana端
- 添加dashboards
點擊Create
-Import
,輸入dashboards的id(推薦1860)