apache无法启动报错No space left on device

故障现象:apache无法启动ipcs信号量很多

# service httpd start
Starting httpd : [Failed]

当达到极限信号量:

# ipcs -s | wc -l
32004

而:

# cat /proc/sys/kernel/msgmni
32000

# cat /proc/sys/kernel/sem
250 24000 32 1024

原因
这些错误意味着有缺乏在系统内处理的通信资源,例如信号量或共享存储器段。

解析度
登录到通过服务器的SSH。

增加的限制sysctl 配置:

# mkdir -p /etc/sysctl.d/
# touch /etc/sysctl.d/99-zz_plesk_semaphores.conf
# chmod 755 /etc/sysctl.d/ /etc/sysctl.d/99-zz_plesk_semaphores.conf
# chown root:root /etc/sysctl.d/ /etc/sysctl.d/99-zz_plesk_semaphores.conf

这样的 /etc/sysctl.d/99-zz_plesk_semaphores.conf配置文件必须包含:

kernel.msgmni = 64000
kernel.sem = 250 256000 32 1024

负荷了新的sysctl设置 sysctl

# sysctl -p

检查哪些用户用尽信号灯:

# ipcs -s | awk ‘{print $3}‘ | uniq -c
4 root
33 httpd
234 somesoftware

阿帕奇保持清洁信号灯:

# for i in `ipcs -s | awk ‘/httpd/ {print $2}‘`; do (ipcrm -s $i); done

在某些情况下,其他软件滥用严重限制信号,禁用该软件,清理作进一步调查其信号量和接触软件供应商:

# for i in `ipcs -s | awk ‘/httpd/ {print $2}‘`; do (ipcrm -s $i); done

for i in `ipcs -s | awk ‘/httpd/{ next; } {print $2}‘`; do (ipcrm -s $i); done

执行清理后问题依旧,反复执行也无效

[[email protected]:~]# ipcs -s

------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 0 root 600 1
0x00000000 65537 root 600 1
0x00000000 131074 apache 600 1
0x00000000 163843 apache 600 1
0x7a004a4e 196612 zabbix 600 13
0x00000000 229381 apache 600 1
0x00000000 262150 apache 600 1
0x00000000 294919 apache 600 1
0x00000000 327688 apache 600 1

[[email protected]:~]# ipcs -s | grep apache | perl -e ‘while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}‘

resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted

for i in `ipcs -s | awk ‘/httpd/{ next; } {print $2}‘`; do (ipcrm -s $i); done
[[email protected]:~]# ipcs -s

------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 0 root 600 1
0x00000000 65537 root 600 1
0x7a004a4e 196612 zabbix 600 13

日志:

[[email protected]:~]# tail -f /var/log/messages
Dec 4 04:47:36 server nrpe[36326]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:47:36 server nrpe[36328]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:47:36 server nrpe[36330]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:47:36 server nrpe[36332]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:47:36 server nrpe[36334]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:48:07 server nrpe[36711]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:48:07 server nrpe[36713]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:48:07 server nrpe[36715]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:49:04 server nrpe[37324]: Host 192.168.254.63 is not allowed to talk to us!
Dec 4 04:49:04 server nrpe[37333]: Host 192.168.254.63 is not allowed to talk to us!

# 原因是因为切分、监控等程序造成的,全部kill就可以了
[[email protected]:~]# ps -ef|grep apache|grep -v grep
root 18475 18474 0 16:50 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 18477 18475 0 16:50 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 26621 26618 0 17:00 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 26623 26621 0 17:00 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 34354 34352 0 17:10 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 34355 34354 0 17:10 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 41177 41175 0 17:20 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 41178 41177 0 17:20 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 47964 47962 0 17:30 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 47965 47964 0 17:30 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 49905 49904 0 14:20 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 49907 49905 0 14:20 ? 00:00:03 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 54555 54554 0 17:40 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 54557 54555 0 17:40 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 56774 56773 0 14:30 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 56775 56774 0 14:30 ? 00:00:03 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 61962 61960 0 17:50 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 61963 61962 0 17:50 ? 00:00:00 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 70159 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/error/error.log.%Y-%m-%d 86400
root 70160 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/error/i-job.chinasoft.com_error.log.%Y-%m-%d 86400
root 70161 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/error/support.chinasoft.com.old_error.log.%Y-%m-%d 86400
root 70162 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/error/dlcbs.chinasoft.com_error.log.%Y-%m-%d 86400
root 70163 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/access/access.log.%Y-%m-%d 86400
root 70164 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/access/i-job.chinasoft.com_access.log.%Y-%m-%d 86400
root 70165 70158 0 17:57 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/access/dlcbs.chinasoft.com_access.log.%Y-%m-%d 86400
apache 70166 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70167 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70168 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70169 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70170 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70171 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70172 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70173 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70174 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70175 70158 0 17:57 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
root 84551 84548 0 06:00 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 84553 84551 0 06:00 ? 00:00:23 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 97069 97068 0 15:30 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 97071 97069 0 15:30 ? 00:00:01 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 109607 109605 0 15:50 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 109608 109607 0 15:50 ? 00:00:01 /bin/bash /usr/local/worksh/monitor_apache_thread.sh
root 115643 115642 0 16:00 ? 00:00:00 /bin/sh -c /bin/bash /usr/local/worksh/monitor_apache_thread.sh > /dev/null 2>&1
root 115645 115643 0 16:00 ? 00:00:01 /bin/bash /usr/local/worksh/monitor_apache_thread.sh

[[email protected]:~]# ps -ef|grep apache|grep -v grep|awk ‘{print $2}‘|xargs kill -9
[root:~]# ps -ef|grep apache
root 70590 70566 0 17:58 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/access/access.log.%Y-%m-%d 86400
root 70591 70566 0 17:58 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/access/i-job.chinasoft.com_access.log.%Y-%m-%d 86400
root 70592 70566 0 17:58 ? 00:00:00 /usr/local/apache2/bin/rotatelogs -l /data/www/logs/apache_log/access/dlcbs.chinasoft.com_access.log.%Y-%m-%d 86400
apache 70608 70566 0 17:58 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70609 70566 0 17:58 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
apache 70610 70566 0 17:58 ? 00:00:00 /usr/local/httpd-2.2.26/bin/httpd -k start
root 70612 35669 0 17:58 pts/0 00:00:00 grep apache

[root:~]# killall httpd

[root:~]# ipcs -s

------ Semaphore Arrays --------
key semid owner perms nsems

# 删除信号

for i in `ipcs -s | awk ‘/httpd/{ next; } {print $2}‘`; do (ipcrm -s $i); done

原文地址:https://www.cnblogs.com/reblue520/p/10337890.html

时间: 2024-08-29 13:46:45

apache无法启动报错No space left on device的相关文章

Apache无法启动报错

Apache无法启动报错:Name or service not known: mod_unique_id: unable to find IPv4 address of "xxxx"   解决方案: 修改 /etc/hosts,添加添加自己的主机名 127.0.0.1    主机名

WAMP APACHE无法启动报错误码1

今天遇到这个问题是片面的但是,按照这样的解决思路是可行的. 首先通过wamp启动mysql apache 发现Apache起不来. 启动时报错: --------------------------------------------------------------------------------------------- 这样的错误是给非开发人员看的,极其不具体的.百度一搜,各种各样的错误都可能造成这样的报错. 然后我查了一下Apache错误日志,居然没有记录错误日志:空的.放弃; 找

Apache启动报错 undefined symbol: apr_array_clear

Apache服务启动报错 [[email protected] ]# service httpd start httpd: Syntax error on line 162 of /etc/httpd.conf/httpd.conf: Cannot load modules/mod_dir.so into server: /usr/local/apache2/modules/mod_dir.so: undefined symbol: apr_array_clear 解决办法:将./configu

Tomcat启动报错[org.apache.struts2.dispatcher.Dispatcher]Dispatcher initialization failed

Tomcat启动报错: [org.apache.struts2.dispatcher.Dispatcher]Dispatcher initialization failed Unable to load configuration. - bean - jar:file:/E:/SoftwareDevelopment/Software/Eclipse4.3/eclipse-jee-kepler-SR1-win32-x86_64/Workspace/.metadata/.plugins/org.ec

转 : Apache启动报错:could not bind to address [::]:443 解决办法

转:Apache启动报错:could not bind to address [::]:443 解决办法 安装Apache服务器的时候,报如下错误: Installing the 'apache' service The 'apache' service is successfully installed.Testing httpd.conf....Errors reported here must be corrected before the service can be started.(

DRP问题集结(一)-Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

问题一:  Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory 问题二:[Error]JavaWeb: 严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] 问题三:The APR based Apache Tomcat Native library which a

tomcat启动报错:java.net.BindException: Permission denied &lt;null&gt;:80

1,启动报错显示 [org.springframework.web.servlet.DispatcherServlet]FrameworkServlet 'springMvc': initialization completed in 382 ms Jun 01, 2015 6:39:06 PM org.apache.coyote.http11.Http11Protocol start SEVERE: Error starting endpoint java.net.BindException:

JBOSS启动报错Failed to start service jboss.web.deployment.default-host.

14:10:01,487 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.web.deployment.default-host./: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./: Failed to start serv

Tomcat启动报错java.net.AbstractPlainSocketImpl(java/net/AbstractPlainSocketImpl.java:178:-1)Struts在网络复杂情况下启动报错解决办法

SSH项目 在网络复杂的情况(具体规律未知)下,Tomcat启动时,报如下错误: [ERROR] 2014-08-12 14:52:58,484 [org.apache.struts2.dispatcher.Dispatcher :27] - Dispatcher initialization failedUnable to load configuration. - Class: java.net.AbstractPlainSocketImplFile: AbstractPlainSocket