确认机器网络可用,DNS配置也没问题,nslookup发现提示错误
isc_socket_bind: address in use
进一步确认发现系统中存在过多JAVA进程的UDP会话,系统可用内存不足,新会话无法创建
#还有一种可能是因为系统文件句柄数占用过多,通过 lsof|awk '{print $2}'|wc -l 查看当前占用情况,ulimit -n 查看当前用户句柄数配置
# ss -s
Total: 31331 (kernel 31535)
TCP: 3622 (estab 2601, closed 624, orphaned 61, synrecv 0, timewait 568/0), ports 1351
Transport Total IP IPv6
* 31535 - -
RAW 0 0 0
UDP 28233 28233 0
TCP 2998 2998 0
INET 31231 31231 0
FRAG 0 0 0
ulimit -n是设置当前shell的当前用户所有进程能打开的最大文件数量,但是一个用户可能会同时通过多个shell连接到系统,所以还有一个针对用户的限制,通过修改 /etc/security/limits.conf实现,例如,往limits.conf输入以下内容: root soft nofile 1000 root hard nofile 1200 soft nofile表示软限制,hard nofile表示硬限制,软限制要小于等于硬限制。上面两行语句表示,root用户的软限制为1000,硬限制为1200,即表示root用户能打开的最大文件数量为1000,不管它开启多少个shell。
系统级限制 修改cat /proc/sys/fs/file-max