JiaHe

相遇即是缘

下载安装

# 官方下载地址:https://prometheus.io/download
tar -zxf node_exporter-1.8.2.linux-amd64.tar.gz -C /opt
mv /opt/node_exporter-1.8.2.linux-amd64/ /opt/node_exporter
ln -s /opt/node_exporter/node_exporter /usr/local/bin/node_exporter

# 配置服务
cat > /usr/lib/systemd/system/node_exporter.service <<EOF
[Unit]
Description=mysql_exporter
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/node_exporter --web.listen-address=":9100"
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl start node_exporter
systemctl enable node_exporter
systemctl status node_exporter

配置Prometheus

修改对应IP

/opt/prometheus/prometheus.yml
- job_name: "LinuxNode:IP"
static_configs:
- targets: ["IP:9100"]
# 重启prometheus
systemctl restart prometheus
systemctl status prometheus

配置Grafana

  1. 新增Dashboard
  2. 填写https://grafana.com/grafana/dashboards/11074
  3. 选择Prometheus
  4. 导入

Node Exporter Dashboard EN 20201010-StarsL.cn