cannot set user id: Resource temporarily unavailable

前阵子,Infra报告无法透过putty以及SecureCRT连接到数据库服务器,提示的错误为Resource temporarily unavailable。由于该服务器上有差不多有20个nstance,应该是超出了系统当前设置的值。关于超出资源限制的事之前有碰到过,只不过不是这个错误,而是open files: cannot modify limit: Operation not permitted。下面描述一下关于Resource temporarily unavailable这个错误及其相关信息。

一、故障现象
[email protected]_02:~> ps -U oracle |wc -l
2015
[email protected]_02:~> lsof | grep oracle|wc -l
83646
[email protected]_02:~> su - oracle
Password:
su: cannot set user id: Resource temporarily unavailable

#从Putty或者SecureCRT连接则会出现如下类似的错误:
Server sent disconnect message
type 2(protocol error):
"fork failed: Resource temporarily unavailable"

#系统日志如下:
Aug 19 09:25:01 linux_02 /usr/sbin/cron[6736]: (oracle) MAIL (mailed 25 bytes of output butgot status 0x0001 )
Aug 19 09:26:29 linux_02 sshd[6864]: Accepted keyboard-interactive/pam for oracle from 192.168.9.1 port 1253 ssh2
Aug 19 09:26:29 linux_02 sshd[6875]: fatal: setresuid 2000: Resource temporarily unavailable
Aug 19 09:27:15 linux_02 sshd[6922]: Accepted keyboard-interactive/pam for oracle from 192.168.9.1 port 1312 ssh2
Aug 19 09:27:15 linux_02 sshd[6985]: fatal: setresuid 2000: Resource temporarily unavailable

二、故障分析
#以下是Metalink上788064.1对Resource temporarily unavailable的错误描述:
The error is different when it  is reaching the limit ‘open files‘ and ‘max user processes‘ in /etc/profile .

A). Error on reaching the limit ‘open files‘:

[[email protected]~]$ssh rac2
  [email protected]‘s password:
  -bash: ulimit: max user processes: cannot modify limit: Operation not permitted
  -bash: /home/oracle/.bash_profile: Too many open files

B). Error on reaching the limit ‘max user processes‘:

[[email protected]~]$ssh [email protected]
  [email protected]‘s password:
  -bash: ulimit: open files: cannot modify limit: Operation not permitted
  -bash: fork: Resource temporarily unavailable

#也就是说我们当前的错误是由于进程数的限制而引起的   #Author : Leshami
#下面检查当前limits.conf配置                   #Blog    : http://blog.csdn.net/leshami
linux_02:/etc/security # grep -v ^# /etc/security/limits.conf

oracle  soft    nproc   2047
oracle  hard    nproc   16384
oracle  soft    nofile  1024
oracle  hard    nofile  65536

#下面是来自Suse官方的Resolution:
The affected user has reached the maximum number of process specified for him into the file /etc/security/limits.conf .

These commands, executed as root, can give you the number of process and of open files for the given user:

ps -U username | wc -l

lsof | grep username | wc -l

To fix the issue increase the NPROC Soft limit according to the user and applications needs; please look at the note below about the /etc/security/limits.conf file.
#上面的描述也是要增加nproc的值,
#从之前的运用的ps以及lsof命令来看,ps命令得到的oracle用户的进程数为2015,从这个值来看,当前的配置符合要求。
#反而是打开文件数超出了设定的hard值,为83682。比较纳闷的是不是文件数错误,而是进程数错误。

#ID 788064.1对此给出的solution 如下:
a). Modify /etc/security/limits.conf manually
Increase the value of ‘soft nofile‘ until it is equal to ‘hard nofile‘ value. Increase the value of ‘soft nproc‘ until it is equal to ‘hard nproc‘ value.
#增加值到soft nofile的值到等于hard nofile的值;增加soft nproc的值到等于hard nproc的值。
#从这个来看的话,应该是系统一旦启动后会分配soft的值,但是最大值不能超过hard值。不管系统是否空闲,都会分配soft值。

b). Install oracle-validated package to modify /etc/security/limits.conf #安装oracle-validated来自动修改limits.conf(RHEL4 to OL5适用)
After install the oracle-validated  package, the content of /etc/security/limits.conf  is modified.

#Metalink ID 1239915.1上对此的描述也是要调整limits.conf

SOLUTION

The file /etc/security/limits.conf controls the resource limits for each user.
The nproc value determines how many processes that user is allowed and the nofile value limits the total number of files which may be opened at once.

Increase both the soft and hard limits for the destination user ("oracle" in our example) and save the file.
Activate The Changed User Limits

These changes take effect only upon login, so out and re-login to activate the changes.

三、故障解决
#根据上面的Solution调整limits.conf文件
linux_02:/etc/security # cp limits.conf limits.conf.bk
linux_02:/etc/security # vi /etc/security/limits.conf
linux_02:/etc/security # grep -v ^# /etc/security/limits.conf
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536

[email protected]_02:/users/oracle> ps -U oracle |wc -l
2714
[email protected]_02:/users/oracle> lsof | grep oracle|wc -l
110694

四、相关参考
ulimit: open files: cannot modify limit: Operation not permittedDocID: 1239915.1
DocID: 788064.1

时间: 2024-09-29 20:31:17

cannot set user id: Resource temporarily unavailable的相关文章

su: cannot set user id: Resource temporarily unavailable

今天R&D所在主机出现su: cannot set user id: Resource temporarily unavailable资源不可用报错,直接通过其他机器ssh [email protected]时,提示 Write failed: Broken pipe. 进行排查发现机器内存使用已经没有了,进行临时的内存回收操作:sync ; sync 将内存数据刷新到磁盘 echo 3 > /proc/sys/vm/drop_caches 内存释放echo 0 > /proc/sys

su切换用户报错cannot set user id: Resource temporarily unavailable

su: cannot set user id: 资源暂时不可用 登录root su - tomcat 报错: cannot set user id: Resource temporarily unavailable tomcat账号突然不可用. 根本原因是:linux操作系统默认最大允许进程数是1024. 随着应用的增加,我们的需求已超过了1024 曾经改过nproc配置: cat >> /etc/security/limits.conf << EOF *           so

关于su: cannot set user id: Resource temporarily unavailable的问题

关于"su:不能切换用户id:资源暂时不可用"的问题 一.问题发生的背景: 在一台测试服务器上搭建一套应用环境,正在做着,当我开启了最后一个程序时,终端突然提示说命令不可用了,无论我做什么动作都直接拒绝.当时以为是这个终端出了问题,于是打算再开一个终端,却再也无法登陆上去了. 我就觉得很奇怪,一开始以为是这台服务器挂了,但是当我去平台查看时发现仍然是正常运转的,只是内存使用率较高.此时登陆的用户是root,而我搭建应用环境用的是普通用户,所以我想通过su命令切换回那个用户,当我执行了这

RAC环境产生大量ons进程,导致用户进程资源耗尽,用户切换提示Resource temporarily unavailable

基本要素(时间.用户.问题) 用户才实施了LINUX5.8+11.2.0.4的RAC环境,使用一段时间后,当切换的grid用户的时候,提示Resource temporarily unavailable,如下: [[email protected] bin]# su- grid su: cannot set userid: Resource temporarily unavailable 但是我们在切换其他用户如oracle用户的时候,却能够正常切换,并且CRS集群使用正常,客户端的连接和用户的

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用.而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况. 解决方法:输入以下命令 sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock 之后再安装想装的包,即可解决 今天玩ubuntu的时候,在弄更新源的时候,突然出现以下错误: [1]+ Stopped                 sudo apt-get update[email pro

Resource temporarily unavailable

数据库版本:5.5.14 操作系统版本:contos 6.3 服务器256G内存,安装90个实例.通过脚本启动90个mysql数据库实例,会有几个实例无法启动,进程启动后直接被杀死.查看mysql日志如下: 140729 10:32:34 [ERROR] Can't create thread to kill server140729 10:46:35 mysqld_safe Starting mysqld daemon with databases from /export/data/mysq

E: 无法获取锁 /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)解决方法

/********************************************************************* * Author  : Samson * Date    : 09/20/2014 * Test platform: *              Linux ubuntu 3.2.0-58-generic-pae *              GNU bash, version 4.2.39 * *****************************

E: 无法获得锁 /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)解决方法

/********************************************************************* * Author  : Samson * Date    : 09/20/2014 * Test platform: *              Linux ubuntu 3.2.0-58-generic-pae *              GNU bash, version 4.2.39 * *****************************

Linux # Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)

參照 http://blog.csdn.net/dengroj2009/article/details/4636456 中方案二,問題解決. 不過,感覺博主記錄問題方式很規範,記錄下. 記錄整個筆記的流程:事件/錯誤/解決方案/步驟/原因總結 Linux # Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable),布布扣,bubuko.com Linux # Cou