查看端口被哪个进程占用
lsof -i:8000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
myserver 17997 SPREADTRUM\justin.wu 3u IPv4 593177169 0t0 TCP *:8000 (LISTEN)
myserver 17997 SPREADTRUM\justin.wu 4u IPv4 593177170 0t0 TCP localhost:8889->localhost:51258 (CLOSE_WAIT)

3)杀掉占用端口的进程 根据pid杀掉
kill -9 进程id