prometheus(2):prometheus连接失效,响应时间太长 检查连接 检查代理和防火墙
如果你想让 Prometheus 在。
·
http://192.168.80.151:9090/192.168.80.151 响应时间太长
请尝试:
在 Web 上搜索 192 168 80 151
检查连接
检查代理和防火墙
一 首先前台已经打开了
[root@localhost ~]# cd apps
[root@localhost apps]# ll
总用量 61144
-rw-r--r--. 1 root root 53546325 10月 30 2020 grafana-7.3.1-1.x86_64.rpm
drwxr-xr-x. 2 3434 3434 56 6月 16 2020 node_exporter-1.0.1.linux-amd64
drwxr-xr-x. 6 3434 3434 242 4月 6 20:34 prometheus-2.22.1.linux-amd64
-rw-r--r--. 1 root root 9061204 4月 6 16:00 pushgateway-1.3.0.linux-amd64.tar.gz
[root@localhost apps]# cd prometheus-2.22.1.linux-amd64
[root@localhost prometheus-2.22.1.linux-amd64]# ll
总用量 170560
[root@localhost prometheus-2.22.1.linux-amd64]# ./prometheus
二 关闭防火墙发现可以了
[root@localhost ~]# ps aux | grep prometheus
root 2459 1.7 2.1 934576 81516 pts/0 Sl+ 08:12 0:04 ./prometheus
root 2488 0.0 0.0 112824 980 pts/1 R+ 08:16 0:00 grep --color=auto prometheus
[root@localhost ~]# firewall-cmd --add-port=9090/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success
三 改进,换一种启动方式
[root@localhost prometheus-2.22.1.linux-amd64]# nohup ./prometheus --config.file=prometheus.yml --web.listen-address="0.0.0.0:9090" > prometheus.log 2>&1 &
[1] 2531
[root@localhost prometheus-2.22.1.linux-amd64]# ps
PID TTY TIME CMD
1504 pts/0 00:00:00 bash
2531 pts/0 00:00:00 prometheus
2537 pts/0 00:00:00 ps
如果你想让 Prometheus 在后台运行并持续监听(不会因为你退出终端或关闭 SSH 而中断),你有以下几种方式可以选择:
方式一:使用 & + nohup
nohup ./prometheus --config.file=prometheus.yml --web.listen-address="0.0.0.0:9090" > prometheus.log 2>&1 &
✅ 说明:
nohup:防止退出终端后进程被杀;&:让进程在后台运行;> prometheus.log:将日志输出到文件。
👉 查看运行状态:
ps -ef | grep prometheus
👉 查看日志输出:
tail -f prometheus.log
这个命令很重要
nohup ./prometheus --config.file=prometheus.yml --web.listen-address="0.0.0.0:9090" > prometheus.log 2>&1 &
更多推荐
所有评论(0)