我安装的 wso2is 作为 key 管理器有问题:
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
对 wso2 用户使用命令 ulimit:
[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
谢谢
在我的例子中,我在日志中给出了一些错误,例如:
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 从互联网 ip 更改为本地 ip(或主机名)。
例子:autentication.organization.com(公网ip)到autencation.intranet(内网ip)
此更改对于服务器配置来说是可以接受的,并为这种经常性限制突破提供了解决方案。显然,此错误会导致累积连接打开文件并且永远不会关闭此连接。
我是一名优秀的程序员,十分优秀!