Get the App
SLTechnology News&Howtos  ›  Servers  › 

The solution to the problem of Port occupation in Linux Centos7 system

Shulou Source: shulou.com Published: 2022-06-02 04:53:52 10月02日 Update

Preface

The server is the Linux-Centos7 system, yesterday there was a very strange situation, tomcat has been closed, still shows that its port 8080 is occupied, and finally located to occupy the port of the process, to solve the problem, the following words do not say much, let's take a look at the detailed introduction.

1. View the processes occupying the port netstat-lnp | grep 8080

[root@izbp109iqt20o2h73tpcuvz java] # netstat-lnp | grep 8080tcp6 0 0: 8080: * LISTEN 4486/java

As you can see, it is 4486 of a java process that occupies port 8080.

two。 View process information ps 4486

[root@izbp109iqt20o2h73tpcuvz java] # ps 4486 PID TTY STAT TIME COMMAND 4486? Sl 1:16 / usr/local/java/jdk1.8.0_152/jre/bin/java-Djava.util.logging.config.file=/usr/local/j

Log-related programs

3. Forced killing process kill-9 4486

[root@izbp109iqt20o2h73tpcuvz java] # kill-9 4486 [root@izbp109iqt20o2h73tpcuvz java] # netstat-lnp | grep 8080 [root@izbp109iqt20o2h73tpcuvz java] #

After killing the process, check the port occupancy again and find that there is no port occupancy. The problem is solved.

The complete operation record is as follows:

[root@izbp109iqt20o2h73tpcuvz java] # netstat-lnp | grep 8080tcp6 0 0:: 8080: * LISTEN 4486/java [root@izbp109iqt20o2h73tpcuvz java] # ps 4486 PID TTY STAT TIME COMMAND 4486? Sl 1:16 / usr/local/java/jdk1.8.0_152/jre/bin/java-Djava.util.logging.config.file=/usr/local/j [root@izbp109iqt20o2h73tpcuvz java] # kill-9 4486 [root@izbp109iqt20o2h73tpcuvz java] # netstat-lnp | grep 8080 [root@izbp109iqt20o2h73tpcuvz java] #

Summary

The above is the whole content of this article, I hope that the content of this article has a certain reference and learning value for your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.

Tags: Port process problem content situation learning system weirdness value information again preface that is log server question program article communication reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Shulou Tech Info Linux macOS