软件下载
https://prometheus.io/download/
安装
groupadd prometheus
useradd -g prometheus -m -d /usr/local/node_exporter/ -s /sbin/nologin prometheus
tar zvxf node_exporter-1.3.1.linux-amd64.tar.gz -c /usr/local
cd /usr/local
mv node_exporter-1.3.1.linux-amd64 node_exporter
vim node_exporter.service
[Unit]
Description=node_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
chown prometheus:prometheus /usr/lib/systemd/system/node_exporter.service
chown -R prometheus:prometheus /usr/local/node_exporter*
systemctl daemon-reload
systemctl enable node_exporter.service
systemctl start node_exporter.service
systemctl status node_exporter.service