openstack Too many open files错误

oopenstack突然web页面无法打开,页面报500错误,查看httpd日志报如下错误

[Fri Feb  ::36.120854 ] [:error] [pid ] [remote 192.168.14.83:] IOError: [Errno ] Too many open files: '/usr/share/openstack-dashboard/openstack_dashboard/themes/default/templates/500.html'
[Fri Feb ::21.837032 ] [mpm_prefork:notice] [pid ] AH00170: caught SIGWINCH, shutting down gracefully
[Fri Feb ::50.565154 ] [suexec:notice] [pid ] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Feb ::50.579447 ] [auth_digest:notice] [pid ] AH01757: generating secret for digest authentication ...
[Fri Feb ::50.579837 ] [lbmethod_heartbeat:notice] [pid ] AH02282: No slotmem from mod_heartmonitor
[Fri Feb ::50.590593 ] [mpm_prefork:notice] [pid ] AH00163: Apache/2.4. (CentOS) mod_wsgi/3.4 Python/2.7. configured -- resuming normal operations
[Fri Feb ::50.590627 ] [core:notice] [pid ] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Feb ::15.154790 ] [:error] [pid ] WARNING:root:Use of this 'djano.wsgi' file has been deprecated since the Rocky release in favor of 'wsgi.py' in the 'openstack_dashboard' module. This file is a legacy naming from before Django 1.4 and an importable 'wsgi.py' is now the default. This file will be removed in the T release cycle.

突然想起在安装的时候忘记修改操作系统打开的文件数;登录到控制节点执行

[root@ipr-controller httpd]# ulimit -a
core file size (blocks, -c)
data seg size (kbytes, -d) unlimited
scheduling priority (-e)
file size (blocks, -f) unlimited
pending signals (-i)
max locked memory (kbytes, -l)
max memory size (kbytes, -m) unlimited
open files (-n)
pipe size ( bytes, -p)
POSIX message queues (bytes, -q)
real-time priority (-r)
stack size (kbytes, -s)
cpu time (seconds, -t) unlimited
max user processes (-u)
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@ipr-controller httpd]#
[root@ipr-controller httpd]#
[root@ipr-controller httpd]# ulimit -n

查看当前打开文件数,明显超过了1024

[root@ipr-controller httpd]# lsof | wc -l

修改默认值

vim /etc/security/limits.conf  在最后加入如下信息:

*               soft    nofile
* hard nofile

*表示所有用户

修改后重启服务器,配置生效

上一篇:#个人博客作业week3——微软必应词典的使用


下一篇:Riemann映射定理