报错信息如下:显示listen tcp :9100: bind: address already in use 9100端口被占用,那么如何杀掉9100端口的进程呢?

[root@mysql node_exporter-1.3.1.linux-amd64]# systemctl status  node_exporter
● node_exporter.service - node_exporter
   Loaded: loaded (/etc/systemd/system/node_exporter.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2023-02-08 14:21:40 CST; 8s ago
  Process: 32897 ExecStart=/opt/module/node_exporter-1.3.1.linux-amd64/node_exporter (code=exited, status=1/FAILURE)
 Main PID: 32897 (code=exited, status=1/FAILURE)

Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:115 level=info collector=timex
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:115 level=info collector=udp_queues
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:115 level=info collector=uname
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:115 level=info collector=vmstat
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:115 level=info collector=xfs
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:115 level=info collector=zfs
Feb 08 14:21:40 mysql systemd[1]: Unit node_exporter.service entered failed state.
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:199 level=info msg="Listening on" address=:9100
Feb 08 14:21:40 mysql node_exporter[32897]: ts=2023-02-08T06:21:40.435Z caller=node_exporter.go:202 level=error err="listen tcp :9100: bind: address already in use"
Feb 08 14:21:40 mysql systemd[1]: node_exporter.service failed.

打开linux系统 , 在linux的桌面的空白处右击 。
2、在弹出的下拉选项里 , 点击打开终端 。
3、在终端窗口中输入netstat -tln | grep 被占用的端口命令 。
4、输入lsof -i : 被占端口命令 , 回车后可查看端口被哪个进程占用 。
5、输入kill -9 进程id命令 , 回车后即可杀死占用端口的进程 。

解决方案

yum install lsof
lsof -i:9100
kill -9 pid进程号

systemctl start node_exporter
Logo

更多推荐