jboss-portal-2.7.2 部署阶段出现错误“java.net.SocketException: Too many open files”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14607356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error "java.net.SocketException: Too many open files" at deployment phase in jboss-portal-2.7.2
提问by abg
When start the jboss-portal-2.7.2 at some point in the log message:
在日志消息中的某个时间点启动 jboss-portal-2.7.2 时:
2013-01-30 20:32:02,541 ERROR [org.apache.tomcat.util.net.JIoEndpoint] Socket accept failed
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
at java.net.ServerSocket.accept(ServerSocket.java:430)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:309)
at java.lang.Thread.run(Thread.java:662)
In the deploy folder a total of 20. war modules. Any solutions?
在deploy文件夹中一共有20个.war模块。任何解决方案?
回答by onlykalu
Increase ulimit on your server for the user running tomcat.
为运行 tomcat 的用户增加服务器上的 ulimit。
To check ulimit:
要检查 ulimit:
ulimit -n
To increase for current session:
增加当前会话:
ulimit -n 102400
You can make permanent changes by editing /etc/security/limits.conf
.
您可以通过编辑进行永久性更改/etc/security/limits.conf
。
回答by CoolBeans
This message basically implies that you have reached the limit of maximum number of files that you can have open as set by your OS.
此消息基本上意味着您已达到操作系统设置的可以打开的最大文件数限制。
The proper way to solve this is by diagnosing the output from lsof -p <jboss_java_pid>
and finding out what is contributing to these many files being open. Then proceed accordingly for a solution.
解决这个问题的正确方法是诊断输出lsof -p <jboss_java_pid>
并找出导致这些许多文件被打开的原因。然后相应地进行解决。
A quick fix solution could be to increase the global maximum file limit on your OS or increase the file limit for the user or both. In Fedora for example this can be set in /proc/sys/file-max
file for the global file max limit and /etc/security/limits.conf
for user limit.
快速修复解决方案可能是增加操作系统上的全局最大文件限制或增加用户的文件限制,或两者兼而有之。例如在 Fedora 中,可以在/proc/sys/file-max
文件中设置全局文件最大限制和/etc/security/limits.conf
用户限制。