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 1030 2020 grafana-7.3.1-1.x86_64.rpm
drwxr-xr-x. 2 3434 3434       56 616 2020 node_exporter-1.0.1.linux-amd64
drwxr-xr-x. 6 3434 3434      242 46 20:34 prometheus-2.22.1.linux-amd64
-rw-r--r--. 1 root root  9061204 46 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 &
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐