linux处理某端口被占用问题

处理某端口被占用问题

已知被占用端口为8887

1.切换到root用户,这样可以看到所有占用该端口的所有用户进程

root@xxx:xxx# netstat -apn | grep 8887

tcp6     0      0 :::8887      :::*     LISTEN    8849/.pm2)

2.确认一下进程号

root@xxx:xxx# ps -ef | grep pm2

root    3927    3247   0 10:08  pts/2200:00:00  grep  --color=auto pm2

derc   8849    10   8月18 ?  00:25:41  PM2  v2.6.1: God Daemon (/home/xxx/.pm2)

3.杀死该进程

root@xxx:xxx# kill -9 8849

4.验证进程已被杀死

root@xxx:xxx# netstat -apn | grep 8887

root@xxx:xxx#

你可能感兴趣的:(linux处理某端口被占用问题)