WSO2 Identity Server作为密钥管理器java.io.IOException:打开的文件太多

时间:2017-12-18 21:22:32

标签: linux wso2 wso2is

我安装的wso2is作为密钥管理器存在问题:

dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: [2017-12-18 21:15:30,855] ERROR {org.apache.tomcat.util.net.NioEndpoint$Acceptor} -  Socket accept failed
dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: java.io.IOException: Too many open files
dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:825)
dic 18 21:15:30 autenticacion.dominio.info wso2server.sh[825]: at java.lang.Thread.run(Thread.java:748)

我已按照WSO2 ESB too many open files ListeningIOReactor encountered a checked exception : Too many open files Exception thrown when try to add documents to the lucene index continuously inside the for loop上的步骤操作,但错误仍然存​​在。

我目前的/etc/security/limits.conf

# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

# End of file

* soft nofile 4096
* hard nofile 65535

* soft nproc 20000
* hard nproc 20000

使用命令ulimit:

[root@autenticacion ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 7283
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 4096
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 20000
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

使用命令ulimit和wso2 user:

[root@autenticacion ~]# su wso2
bash-4.2$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 7283
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 4096
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 4096
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

由于

1 个答案:

答案 0 :(得分:0)

在我的情况下,我在日志中给出了一些错误,如:

ERROR {org.wso2.carbon.metrics.jdbc.reporter.JDBCReporter} - Error when reporting gauges
org.h2.jdbc.JdbcSQLException: IO Exception: "JAVA.net.UnknownHostException: static-ip-1312323.cable.net.co: statict-ip
at org.h2.message.DbException.getJdbcSQLException
... 32 more
Caused by: java.net.UnknownHostException: static-ip-1312323.cable.net.co: static-ip-1312323.cable.net.co:Name or service not know
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)

这个错误没有引起注意,因为从一开始就保持不变,并且提供wso2的服务运行良好。

我已将/ etc / hostname的IP从internet ip更改为本地ip(或主机名)。

实施例: autentication.organization.com(internet ip)到autentication.intranet(intranet ip)

此更改对于服务器配置是可接受的,并为此重新设置限制中断提供了解决方案。显然,这些错误会导致累积连接打开文件,并且永远不会关闭此连接。