Linux问题备忘录

1. ssh无法正常访问

1.1 错误信息

-bash: fork: retry: Resource temporarily unavailable

1.2 解决办法

# ulimit -u 10000

2. ssh无法登陆

2.1 错误信息

# su otheruser
su: cannot set user id: Resource temporarily unavailable

2.2 问题查找

# lsof | grep otheruser

2.3异常信息

java      22452   otheruser  206u     IPv6           66845952        0t0        TCP localhost:35068->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  207u     IPv6           66845953        0t0        TCP localhost:35069->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  208u     IPv6           66845954        0t0        TCP localhost:35070->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  209u     IPv6           66845955        0t0        TCP localhost:35071->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  210u     IPv6           66845956        0t0        TCP localhost:35072->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  211u     IPv6           66845957        0t0        TCP localhost:35073->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  212u     IPv6           66845958        0t0        TCP localhost:35074->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  213u     IPv6           66845959        0t0        TCP localhost:35075->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  214u     IPv6           66845977        0t0        TCP localhost:35078->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  215u     IPv6           66845979        0t0        TCP localhost:35079->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  216u     IPv6           66845980        0t0        TCP localhost:35080->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  217u     IPv6           66845981        0t0        TCP localhost:35081->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  218u     IPv6           66845982        0t0        TCP localhost:35082->42.120.181.22:http (CLOSE_WAIT)
java      22452   otheruser  219u     IPv6           66845986        0t0        TCP localhost:35083->42.120.181.22:http (CLOSE_WAIT)

 2.4 临时解决

#kill -9 22452

 2.5 解决办法

 2.5.1 打开文件

# vi /etc/security/limits.conf

 2.5.2 添加内容

* soft nofile 4096
* hard nofile 4096

猜你喜欢

转载自feticoolo.iteye.com/blog/2147804