Mengatasi Galat "Address already in use"

Jadi pas mau nulis eh tiba-tiba dapat error

jekyll 3.1.3 | Error:  Address already in use - bind(2) for 127.0.0.1:4000

Dan ternyata cara mengatasinya mudah, pertama cek dulu proses tersebut PID nya berapa dengan cara

$ lsof -wni tcp:4000

Di sini menghasilkan seperti ini

COMMAND  PID   USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
bundle  1610 ariesm   11u  IPv4 27292378      0t0  TCP 127.0.0.1:4000 (LISTEN)
bundle  1610 ariesm   15u  IPv4 27428021      0t0  TCP 127.0.0.1:4000->127.0.0.1:59843 (CLOSE_WAIT)
bundle  1610 ariesm   16u  IPv4 27430267      0t0  TCP 127.0.0.1:4000->127.0.0.1:59893 (CLOSE_WAIT)
bundle  1610 ariesm   17u  IPv4 27428023      0t0  TCP 127.0.0.1:4000->127.0.0.1:59845 (CLOSE_WAIT)
bundle  1610 ariesm   18u  IPv4 27428024      0t0  TCP 127.0.0.1:4000->127.0.0.1:59846 (CLOSE_WAIT)
bundle  1610 ariesm   19u  IPv4 27430995      0t0  TCP 127.0.0.1:4000->127.0.0.1:59895 (CLOSE_WAIT)

PID nya ketemu yaitu 1610, setelah ketahuan PID nya tinggal kill saja proses tersebut

$ kill -9 1610

Dan sekarang bisa lagi aktif.

Referensi :

http://stackoverflow.com/questions/10261477/tcpserver-error-address-already-in-use-bind2

Show Comments