use lsof to show a port, but every port return same info…
[kfadmin@master fundrisksys]$ lsof -i:136
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
[kfadmin@master fundrisksys]$ lsof -i:7895
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
I can’t use any port, it shows same info:
Bind for 0.0.0.0:8001 failed: port is already allocated
I try to kill the pid, but the terminal will be killed
2
Answers
Did you try to run a
docker ps -a
?Maybe you have a stopped container that has reserved this port.
Use
netstat -tulpn
orss -tulpn
and look at used ports. Find app and pid that uses this port.