java.io.FileNotFoundException: /app/rms/release/web/update/Rmt_krUpfiles.ini (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java(Compiled Code))
at weblogic.utils.classloaders.FileSource.getInputStream(FileSource.java(Compiled Code))
at weblogic.servlet.FileServlet.sendFile(FileServlet.java(Compiled Code))
at weblogic.servlet.FileServlet.service(FileServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java(Inlined Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java(Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java(Inlined Compiled Code))
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java(Compiled Code))
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java(Compiled Code))
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java(Inlined Compiled Code))
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java(Compiled Code))
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java(Compiled Code))
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java(Compiled Code))
####<2008-7-1 10时15分05秒 GMT+08:00> <Info> <HTTP> <sczyapp1> <zyserver01_8621> <ExecuteThread: '3' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-101047> <[ServletContext(id=1250043234,name=wl_management_internal1,context-path=/wl_management_internal1)] LogfileSearch: init>
####<2008-7-1 10时15分06秒 GMT+08:00> <Notice> <WebLogicServer> <sczyapp1> <zyserver01_8621> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000205> <After having failed to listen, the
server is now listening on port 8621.>
####<2008-7-1 10时15分06秒 GMT+08:00> <Critical> <WebLogicServer> <sczyapp1> <zyserver01_8621> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 8621, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
####<2008-7-1 10时15分07秒 GMT+08:00> <Critical> <WebLogicServer> <sczyapp1> <zyserver01_8621> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 8621, failure count: 2, failing for 1 seconds, java.net.SocketException: Too many open files>
####<2008-7-1 10时15分08秒 GMT+08:00> <Notice> <Log Management> <sczyapp1> <zyserver01_8621> <ExecuteThread: '3' for queue: 'weblogic.kernel.Default'> <weblogic> <> <BEA-170020> <Maximum number of messages (500) reached.>"
####<2008-7-1 10时15分08秒 GMT+08:00> <Notice> <Log Management> <sczyapp1> <zyserver01_8621> <ExecuteThread: '3' for queue: 'weblogic.kernel.Default'> <weblogic> <> <BEA-170021> <Search complete.>
####<2008-7-1 10时15分09秒 GMT+08:00> <Notice> <WebLogicServer> <sczyapp1> <zyserver01_8621> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000205> <After having failed to listen, the server is now listening on port 8621.>
####<2008-7-1 10时15分09秒 GMT+08:00> <Critical> <WebLogicServer> <sczyapp1> <zyserver01_8621> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 8621, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files> {
####<2008-7-1 10时15分09秒 GMT+08:00> <Info> <Management> <sczyapp1> <zyserver01_8621> <ExecuteThread: '1' for queue: 'weblogic.admin.RMI'> <<WLS Kernel>> <> <BEA-141080> <A request has been received to force shut down of the server.>
####<2008-7-1 10时15分09秒 GMT+08:00> <Notice> <WebLogicServer> <sczyapp1> <zyserver01_8621> <ExecuteThread: '1' for queue: 'weblogic.admin.RMI'> <<WLS Kernel>> <> <BEA-000365> <Server state changed to SHUTTING_DOWN>"
(Too many open files)
这个问题经过分析,可能是系统打开的文件数超过最大限制造成的.
通过看bea最大打开文件数限制,发现操作系统没有限制(最好修改操作系统也修改weblogic的配置).
[bea@sczyapp1]/bea #ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 41943044
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) unlimited
[bea@sczyapp1]/bea #
------------------------------------
通过查询bea设置发现
/bea/weblogic81/common/bin/commEnv.sh中,设置了
resetFd
所以bea的最大打开文件数为默认的 1024
此问题只要注释掉resetFd,并重启服务器就可以解决.
系统默认的shell中写的是小与,将shell中的逻辑修改一下也可以(就是修改 /bea/weblogic81/common/bin/commEnv.sh 脚本)
检查domain的启动脚本,发现domain启动时首先要执行以下这个脚本,确定一些内存和系统参数配置;
由于内存参数在启动脚本中单独给出,所以才没有暴露出问题。但是没有单独给出打开文件的限制,所以需要在那个脚本当中修改;
不要启用那个过程设置打开文件的限制;
对那一段的结果进行测试,结果印证了此时的限制是1024
#!/bin/sh
echo 'test'
resetFd() {
if [ ! -n "`uname -s |grep -i cygwin || uname -s |grep -i windows_nt || \
uname -s |grep -i HP-UX`" ]
then
maxfiles=`ulimit -H -n`
if [ "$?" = "0" -a "${maxfiles}" != 1024 ]; then
if [ `expr ${maxfiles} : '[0-9][0-9]*$'` -eq 0 ]; then
maxfiles=1025
echo "set 1025"
fi
if [ "${maxfiles}" -lt 1024 ]; then
ulimit -n ${maxfiles}
echo "set to unknow"
else
ulimit -n 1024
echo "set to 1024"
fi
fi
fi
}
resetFd
wlgmais@mzgis-200:/opt/beamais> sh test1.sh
test
set to 1024
--转自