官網下載地址: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