当前位置: 首页 > article >正文

【promethues 9090占用端口】没有网络,如何杀掉9090端口暂用的进程

问题描述
现象:

Prometheus 服务启动失败,systemctl status prometheus.service 显示服务状态为 failed。

错误日志显示:
Unable to start web listener" err="listen tcp 0.0.0.0:9090: bind: address already in use
这表明 9090 端口已被其他进程占用。


[root@kafka3 system]# systemctl status prometheus.service
● prometheus.service - prometheus
   Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2025-01-15 17:20:15 CST; 2min 3s ago
  Process: 10215 ExecStart=/opt/module/prometheus-2.35.0/prometheus --config.file=/opt/module/prometheus-2.35.0/prometheus.yml --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta=2m (code=exited, status=1/FAILURE)
 Main PID: 10215 (code=exited, status=1/FAILURE)

Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.907Z caller=main.go:525 level=info msg="Starting Prometheus" version="(version=2.35.0, branch=HEAD, revision=6656cd29fe6ac92...62ef0f187654)"
Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.907Z caller=main.go:530 level=info build_context="(go=go1.18.1, user=root@cf6852b14d68, date=20220421-09:53:42)"
Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.907Z caller=main.go:531 level=info host_details="(Linux 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 kafka3 (none))"
Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.907Z caller=main.go:532 level=info fd_limits="(soft=1024, hard=4096)"
Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.907Z caller=main.go:533 level=info vm_limits="(soft=unlimited, hard=unlimited)"
Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.909Z caller=web.go:541 level=info component=web msg="Start listening for connections" address=0.0.0.0:9090
Jan 15 17:20:15 kafka3 prometheus[10215]: ts=2025-01-15T09:20:15.910Z caller=main.go:775 level=error msg="Unable to start web listener" err="listen tcp 0.0.0.0:9090: bind: address already in use"
Jan 15 17:20:15 kafka3 systemd[1]: prometheus.service: main process exited, code=exited, status=1/FAILURE
Jan 15 17:20:15 kafka3 systemd[1]: Unit prometheus.service entered failed state.
Jan 15 17:20:15 kafka3 systemd[1]: prometheus.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@kafka3 system]#


9090端口被占用,通过以下命令查找

sudo netstat -tulnp | grep 9090

输出


[root@kafka3 system]# sudo netstat -tulnp | grep 9090
tcp6       0      0 :::9090                 :::*                    LISTEN      7629/./prometheus
[root@kafka3 system]#

说明7629 进程号占用了,我们杀掉即可。

kill -9 7629
[root@kafka3 system]# sudo systemctl restart prometheus.service
[root@kafka3 system]# systemctl status prometheus.service
● prometheus.service - prometheus
   Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2025-01-15 17:24:48 CST; 4s ago
 Main PID: 10247 (prometheus)
   CGroup: /system.slice/prometheus.service
           └─10247 /opt/module/prometheus-2.35.0/prometheus --config.file=/opt/module/prometheus-2.35.0/prometheus.yml --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta...

Jan 15 17:24:48 kafka3 prometheus[10247]: ts=2025-01-15T09:24:48.776Z caller=head.go:542 level=info component=tsdb msg="Replaying WAL, this may take a while"
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.320Z caller=head.go:613 level=info component=tsdb msg="WAL segment loaded" segment=0 maxSegment=2
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.320Z caller=head.go:613 level=info component=tsdb msg="WAL segment loaded" segment=1 maxSegment=2
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.321Z caller=head.go:613 level=info component=tsdb msg="WAL segment loaded" segment=2 maxSegment=2
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.321Z caller=head.go:619 level=info component=tsdb msg="WAL replay completed" checkpoint_replay_duration=28.057µs wal_replay_…ion=544.237555ms
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.325Z caller=main.go:978 level=info fs_type=XFS_SUPER_MAGIC
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.325Z caller=main.go:981 level=info msg="TSDB started"
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.325Z caller=main.go:1162 level=info msg="Loading configuration file" filename=/opt/module/prometheus-2.35.0/prometheus.yml
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.326Z caller=main.go:1199 level=info msg="Completed loading of configuration file" filename=/opt/module/prometheus-2.35.0/prometheus.yml to…µs
Jan 15 17:24:49 kafka3 prometheus[10247]: ts=2025-01-15T09:24:49.326Z caller=main.go:930 level=info msg="Server is ready to receive web requests."
Hint: Some lines were ellipsized, use -l to show in full.
[root@kafka3 system]#

在这里插入图片描述


http://www.kler.cn/a/506782.html

相关文章:

  • 如何异地远程访问本地部署的Web-Check实现团队远程检测与维护本地站点
  • Oracle 批量投入数据方法总结
  • 软件设计大致步骤
  • FLASK创建下载
  • MySQL SQL优化技巧与原理
  • hadoop3.3和hive4.0安装——单节点
  • Android 后台线程
  • 4. 使用springboot做一个音乐播放器软件项目【数据库表的创建】
  • 国产linux系统(银河麒麟,统信uos)使用 PageOffice 实现后台批量生成PDF文档
  • Math Reference Notes: 矩阵性质
  • python管理工具:conda部署+使用
  • 《黄金像凶杀案-再起》V1.2.0+Dlcs官方中文学习版
  • VIVADO FIFO (同步和异步) IP 核详细使用配置步骤
  • GO语言实现KMP算法
  • 代码随想录算法训练营第 9 天(字符串2)| 151.翻转字符串里的单词 卡码网55.右旋转字符串 KMP(跳过) 总结
  • 【Python基础篇】——第3篇:从入门到精通:掌握Python数据类型与数据结构
  • kubernetes第九天
  • 如何解决Outlook无法连接到服务器的问题
  • CentOS 9 Stream 上安装 Node.js 18.20.5
  • 《零基础Go语言算法实战》【题目 5-1】按照给定条件构建二叉树
  • Android SystemUI——车载CarSystemUI加载(八)
  • Gateway怎么实现限流的
  • HTML中最基本的东西
  • .NET概述
  • [Do374]Ansible一键搭建sftp实现用户批量增删
  • 如何设置请求头模拟浏览器访问?