服务器监控搭建完成后涉及默认端口修改,如下
node_exporter 端口修改
#修改启动服务
vi /usr/lib/systemd/system/node-exporter.service
#增加 --web.listen-address=:8002
[Unit]
Description=This is prometheus node exporter
After=node_exporter.service
[Service]
Type=simple
ExecStart=/usr/local/node_exporter/node_exporter --web.listen-address=:8002
ExecReload=/bin/kill -HUP
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
#刷新
systemctl daemon-reload
#重启
systemctl stop node-exporter.service
systemctl start node-exporter.service
prometheus 端口修改
#修改启动服务
vi /usr/lib/systemd/system/prometheusd.service
#增加 --web.listen-address=:8001
[Unit]
Description=Prometheus
[Service]
ExecStart=/usr/local/prometheus/prometheus --web.listen-address=:8001 --web.enable-lifecycle --config.file=/usr/local/prometheus/prometheus.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target
#刷新
systemctl daemon-reload
#重启
systemctl stop prometheusd.service
systemctl start prometheusd.service
grafana默认端口修改
#修改grafana配置文件
vim /etc/grafana/grafana.ini
#修改默认端口3000->8000,
去掉;3000改8000
#重启
systemctl stop grafana-server.service
systemctl start grafana-server.service
可能会涉及到开端口,比如
#开放8000端口
firewall-cmd --add-port=8000/tcp --permanent
#重启防火墙
firewall-cmd --reload