To see if the port is being used and kill the related process, you can follow the steps below:
- Open the pagoda panel and enter the server management page.
- Select "Tools" in the left navigation bar, and then select "Terminal" to enter the Pagoda terminal interface.
- Enter the following command to view the port usage:
If there is a process listening on the port, you will see relevant output information.netstat -tuln | grep 7003
- According to the process ID (PID) in the output information, use the following command to kill the relevant process:
Replacekill <PID>
<PID>
with the actual process ID.
Please note that before executing the operation of killing a process, please make sure you understand the purpose of the process to avoid unnecessary impact.
Please execute the following command to kill the process occupying port 7003:
sudo killall -9 <进程名或进程ID>
If you don't know the exact name or process ID of the process, run the following command to find it:
sudo lsof -i :7003
This command will display information about the process occupying port 7003, from which you can get the name or PID of the process. Then <进程名或进程ID>
replace with the actual value, using sudo
the command requires administrator privileges. Make sure you understand what process you're terminating to avoid causing
[root@iZ2ze6f5nwk3plpz9ihi0nZ erp]# sudo lsof -i :7003
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 2289811 root 28u IPv6 22940491 0t0 TCP *:afs3-vlserver (LISTEN)
[root@iZ2ze6f5nwk3plpz9ihi0nZ erp]#
According to the output information you provided, the process name is java
and the process ID is 2289811
. To kill the process, execute the following command:
sudo kill -9 2289811
This will forcefully terminate the process java
. Note that sudo
administrator privileges are required to use the command. Make sure you understand what process is being killed to avoid unwanted effects.