centos7使用yum方式安装node_exporter
官网下载地址:https://prometheus.io/download/
选择对应的系统版本
官网提供的是压缩包,点击旁边的github地址
github页面显示的有yum安装和docker安装,这里选择“RHEL/CentOS/Fedora”
进入到yum方式安装页面
根据系统版本下载repo文件,我这里是centos7
# curl -Lo /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo
# yum makecache
# yum install node_exporter -y
常用命令
# systemctl start node_exporter.service
# systemctl status node_exporter.service
# systemctl enable node_exporter.service
# curl -Lo /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo
# yum makecache && yum install node_exporter -y
修改一下启动文件
# vim /usr/lib/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
[Service]
User=node_exporter
EnvironmentFile=/etc/sysconfig/node_exporter
ExecStart=/usr/sbin/node_exporter --collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) $OPTIONS
Restart=always
[Install]
WantedBy=multi-user.target
# systemctl daemon-reload && systemctl start node_exporter.service && systemctl enable node_exporter.service && systemctl status node_exporter.service