prometheus-node-exporter 端口被占用修改默认端口
安装
apt-get install prometheus-node-exporter
查看状态
systemctl status prometheus-node-exporter
# cat /lib/systemd/system/prometheus-node-exporter.service
[Unit]
Description=Prometheus exporter for machine metrics
Documentation=https://github.com/prometheus/node_exporter
[Service]
Restart=always
User=prometheus
EnvironmentFile=/etc/default/prometheus-node-exporter
ExecStart=/usr/bin/prometheus-node-exporter $ARGS
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=20s
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
默认端口9100修改为9200
# cat /etc/default/prometheus-node-exporter | grep "web.listen-address"
# --web.listen-address=":9100"
ARGS=--web.listen-address=":9200"
重载配置 启动
systemctl daemon-reload
systemctl restart prometheus-node-exporter
查看日志
journalctl -fu prometheus-node-exporter