该进程已成功终止,但该端口仍处于“FIN_WAIT1”状态.它没有出来,它的超时似乎被设置为“十年”.
我发现释放端口的唯一方法是重启整个机器,这是我不想做的事情.
$netstat -tulnap | grep FIN_WAIT1 tcp 0 13937 10.0.0.153:4000 10.0.2.46:2572 FIN_WAIT1 -
有没有人知道如何在不重新启动的情况下解锁此端口?
解决方法# record what tcp_max_orphans's current valueoriginal_value=$(cat /proc/sys/net/ipv4/tcp_max_orphans)#set the tcp_max_orphans to 0 temporarilyecho 0 > /proc/sys/net/ipv4/tcp_max_orphans# watch /var/log/messages# it will split out "kernel: TCP: too many of orphaned sockets"# it won't take long for the connections to be killed# restore the value of tcp_max_orphans whatever it was before. echo $original_value > /proc/sys/net/ipv4/tcp_max_orphans# verify with netstat -an|grep FIN_WAIT1总结
以上是内存溢出为你收集整理的linux – 如何摆脱FIN_WAIT1状态的套接字?全部内容,希望文章能够帮你解决linux – 如何摆脱FIN_WAIT1状态的套接字?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)