简体   繁体   English

java.net.BindException:无法分配请求的地址,java.io.IOException:打开的文件太多

[英]java.net.BindException: Cannot assign requested address, java.io.IOException: Too many open files

I am getting exception java.net.BindException: Cannot assign requested address, and if this exception occurred I try to bind it again with the same port and host. 我收到异常java.net.BindException:无法分配请求的地址,如果发生此异常,我尝试再次使用相同的端口和主机绑定它。 But after some attempt of bind I am getting java.io.IOException: Too many open files. 但是在尝试绑定之后我得到java.io.IOException:打开的文件太多了。

Stack Trace: 堆栈跟踪:

    java.net.BindException: Cannot assign requested address
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.SctpServerChannelImpl.bind(SctpServerChannelImpl.java:109)
    at com.sun.nio.sctp.SctpServerChannel.bind(SctpServerChannel.java:184).

and after some failure: 一些失败后:

    java.io.IOException: Too many open files
    at sun.nio.ch.IOUtil.makePipe(Native Method)
    at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:65)
    at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:36)
    at java.nio.channels.Selector.open(Selector.java:227)

Is it possible that FD remains open when java.net.BindException: Cannot assign requested address ? 当java.net.BindException:无法分配请求的地址时,FD是否可能保持打开状态?

This is usually an OS level issue. 这通常是操作系统级别的问题。 Look into bumping up the number of files that can be open. 查看可以打开的文件数量。 On linux the setting is in /etc/security/limits.conf: 在linux上,设置在/etc/security/limits.conf中:

UID soft nofile 4096 UID hard nofile 10240 UID soft nofile 4096 UID hard nofile 10240

Is it possible that FD remains open when java.net.BindException: Cannot assign requested add? 当java.net.BindException:无法分配请求的添加时,FD是否可能保持打开状态?

Yes. 是。 You have to close the socket yourself. 你必须自己关闭插座。 Clearly you have a socket leak. 显然你有套接字泄漏。

I don't see the point of retrying the bind. 我没有看到重试绑定的重点。 It will still fail. 它仍然会失败。 Probably the original bind problem is also due to a socket leak. 可能原始绑定问题也是由于套接字泄漏造成的。

也许ip问题到了/ etc / hosts并将其更改为

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.net.BindException:打开太多连接时无法分配请求的地址 - java.net.BindException: Cannot assign requested address when opening too many connections java.net.BindException:无法在Heroku上分配请求的地址 - java.net.BindException: Cannot assign requested address on Heroku 遇到 java.net.bindexception 的问题无法分配请求的地址 - Problem running into java.net.bindexception cannot assign requested address java.net.BindException:无法分配请求的地址 - java.net.BindException: Cannot assign requested address 异常:java.net.BindException:无法分配请求的地址 - Exception : java.net.BindException: Cannot assign requested address Java Maven Heroku App 中的“java.io.IOException: java.net.BindException: 地址已在使用中” - "java.io.IOException: java.net.BindException: Address already in use" in Java Maven Heroku App 创建FlumeDStream java.net.BindException时,在Yarn错误上发生Spark流式传输:无法分配请求的地址 - Spark streaming on Yarn Error while creating FlumeDStream java.net.BindException: Cannot assign requested address tomcat 错误:java.net.BindException:无法分配请求的地址(绑定失败) - tomcat error: java.net.BindException: Cannot assign requested address (Bind failed) java.net.BindException:绑定失败:EADDRNOTAVAIL(无法分配请求的地址) - java.net.BindException: bind failed: EADDRNOTAVAIL (Cannot assign requested address) GNetLib-java.net.BindException:无法分配请求的地址:JVM_Bind - GNetLib - java.net.BindException: Cannot assign requested address: JVM_Bind
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM