引起該問題的原因可能是/etc/security/limits.d/90-nproc.conf文件中nproc達到了上限,或者上述配置文件只針對特定用戶放開了限制,而其它用戶依然還有限制。
解決方法是修改nproc上限或者修改對應的用戶賬戶,然後重啓系統生效即可。
注:此文件是CentOS 6版本後才後該文件,在CentOS 5.10中沒有
執行步驟如下:
1.cp -a /etc/security/limits.d/90-nproc.conf /etc/security/limits.d/90-nproc.conf.bak
注:此操作是備份文件,避免操作失誤,可以用來還原。
2.vim /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 1024
在此處將1024修改爲更大的數值,根據需求設置即可,例如設置爲:1500
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 1500
如果是針對特定用戶有限制,則修改對應的行內容即可,例如將:
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
mayun soft nproc 1024
* soft nproc 1500
修改爲:
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
mayun soft nproc 2000
* soft nproc 1500
3. init 6
注:重啓系統