Solution to CentOS system Port occupation

Source: Internet
Author: User

Solution to CentOS system Port occupation

Sometimes, when the software is disabled, the background process will die, causing the port to be occupied. The following describes how to solve the problem by taking TOMCAT port 8060 as an example.

Solution:

1. Find the occupied port

  1. Netstat-tln
  2. Netstat-tln | grep8060

Netstat-tln is used to view port usage, while netstat-tln | grep 8060 is used to view port 8060 only.

2. Check which program the port belongs? Which process occupies the port?

Lsof-I: 8060

Command pid user fd type device size/OFF NODE NAME

Java 20804 root 36u IPv6 35452317 0t0 TCP *: pcsync-https (LISTEN)

3. Kill the process that occupies the port and kill it based on the pid.

Kill-9 process id

Kill-9 20804

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.