问题描述:Weblogic服务器各Server服务及部署的Web应用运行正常,但用户却无法链接访问网页。
Server服务运行正常
部署应用运行正常
查看服务器日志:
####
<> <> <> <1500625927388>
#### <> <> <> <1500625927391>
#### <> <> <> <1500625928517>
#### <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625928572> <[ ServletContext@5587472[app:expense_app module:webRoot path:/expense spec-version:null]] Root cause of ServletException.>
#### <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625928573> <[ ServletContext@5587472[app:expense_app module:webRoot path:/expense spec-version:null]] Problem occurred while serving the error page.>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625928936> <[ ServletContext@5587472[app:expense_app module:webRoot path:/expense spec-version:null]] Root cause of ServletException.>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625928937> <[ ServletContext@5587472[app:expense_app module:webRoot path:/expense spec-version:null]] Problem occurred while serving the error page.>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625929846> <[ ServletContext@5587472[app:expense_app module:webRoot path:/expense spec-version:null]] Root cause of ServletException.>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625929847> <[ ServletContext@5587472[app:expense_app module:webRoot path:/expense spec-version:null]] Problem occurred while serving the error page.>
#### <> <> <> <1500625930520> Too many open files>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931751>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931751>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931752>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931752>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931753>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931753>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931753>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931754>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931754>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931755>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931755>
#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1500625931755>
综上对问题进行分析:系统对打开文件数的限制导致SocketException,致使WebLogic不能正常服务。在unix系统中,socket连接是以文件的形式存在的,所以socket连接受到系统对打开文件数的限制。当前,unix系统对程序打开文件的限制数是1024,且WebLogic的日志记录方式是无限增长,随着日志文件的日益增多,WebLogic打开的文件数越来越多,当文件打开总数达到1024时,系统不再允许WebLogic打开文件(包括socket连接),就出现了上面的问题。出现无法打开文件的情况,是unix打开文件数量设置受限,将参数调整,修改open file的设置,作如下调整,
在/etc/ security/ limits.conf文件末添加:
* soft nofile 4096
* hard nofile 4096
问题解决!