node_exporter的安装及部署
下载安装
- 下载 wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
- 解压 tar -xvf node_exporter-0.18.1.linux-amd64.tar.gz
- 修改目录名 mv node_exporter-0.18.1.linux-amd64 node_exporter
- 移动目录 mv node_exporter /usr/local/bin
添加node_exporter为系统服务
- 命令 vi /etc/systemd/system/node_exporter.service
- 修改文件
[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target
[Service]
ExecStart=/usr/local/bin/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
- 重新加载 systemctl daemon-reload && systemctl
- 启动 systemctl start node_exporter
- 设定为开机启动 systemctl enable node_exporter