Could not set limit for ‘nofile’: Operation not permitted的处理方法

简介:

linux 修改用户可打开的文件数特别大的方法//ssh登陆pam_limits(crond:session): Could not set limit for ‘nofile’: Operation not permitted的处理方法

若需要允许用户使用很大的文件资源需要先修改内核的文件资源数限制

修改用户可打开的文件数一般直接修改limits.conf的nofile 即可,但是如果将这个值修改为上百万很有可能导致ssh无法登陆、系统异常

因为很可能用户可打开的文件数量超过了内核可打开的文件数量

 

正确的修改方法如下:

先修改内核可打开文件数量,再修改用户可打开文件数量

内核限制数的具体位置是:

/proc/sys/fs/file-max –系统级别所有进程可打开的文件数

/proc/sys/fs/nr_open –定义了file-max允许被修改的最大值,file-max不可以超过该值

修改/etc/sysctl.conf增加:

fs.file-max =***
fs.nr_open = ***

即可修改内核的配置

 

修改完成后,再修改 /etc/security/limits.conf

目录
相关文章
|
14天前
Invalid bound statement (not found)错误【已解决】
Invalid bound statement (not found)错误【已解决】
14 1
|
8月前
|
编译器
解决Invalid bound statement (not found)错误~
解决Invalid bound statement (not found)错误~
|
11月前
|
Java Go API
译|Don’t just check errors, handle them gracefully(二)
译|Don’t just check errors, handle them gracefully(二)
68 0
|
11月前
|
程序员 Go API
译|Don’t just check errors, handle them gracefully(一)
译|Don’t just check errors, handle them gracefully
58 0
|
SQL Java 数据库连接
Invalid bound statement (not found) 问题处理
您好,我是码农飞哥,感谢您阅读本文!本文将介绍使用MyBatis时出现的一些常见问题。
213 0
|
Java 数据库连接 mybatis
A query was run and no Result Maps were found for the Mapped Statement
A query was run and no Result Maps were found for the Mapped Statement
177 0
|
XML SQL 数据格式
Invalid bound statement (not found)错误的可能原因
Invalid bound statement (not found)错误的可能原因
433 0
How to give query view parameter values in APF
How to give query view parameter values in APF
105 0
How to give query view parameter values in APF
delete in ST05 trace - deletion will also lead to many DB access first
delete in ST05 trace - deletion will also lead to many DB access first
110 0
delete in ST05 trace - deletion will also lead to many DB access first
|
关系型数据库 MySQL 数据安全/隐私保护
Could not obtain connection to query metadata : Public Key Retrieval is not allowed
Could not obtain connection to query metadata : Public Key Retrieval is not allowed
481 0