apache 无法启动故障排查
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://coolerfeng.blog.51cto.com/133059/81814 |
今天在F5上逛,发现某个ip下面的机器的80和443端口down了。
于是手动重启,结果发现apachectl start,可以正常启动,apachectl startssl却不行
查看log [Wed Apr 16 08:54:52 2008] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Fri Jun 13 11:59:24 2008] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName semget: 设备上没有空间 网上查了半天也无解。试图删除/usr/local/apache/logs/httpd.pid再重启也不行。 问同事才知道 使用ipcs查看系统的信号量,发现是信号量sem已经满了,所以导致startssl无法启动。
据说是如果apache没有正常Stop掉的话,它的信号量是不会自动清除的,导致其一直滞留在内存中
于是,用以下命令清除sem信号量后,apache就可以正常启动了:
for i in `ipcs | grep nobody | awk '{print $2}'`; do ipcrm -s $i; done 看来,以后我们需要慎用killall -9 httpd,尽量使apache能正常的stop [root@l_192_168_131_164 log]# ipcs ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 7143424 root 600 184324 74 dest ------ Semaphore Arrays -------- key semid owner perms nsems 0x00000000 0 nobody 600 1 0x00000000 32769 nobody 600 1 0x00000000 65538 nobody 600 1 。。。。。。。。。 。。。。。。。。。 0x00000000 98307 nobody 600 1 ------ Message Queues -------- key msqid owner perms used-bytes messages 清除了就可以了 for i in `ipcs | grep nobody | awk '{print $2}'`; do ipcrm -s $i; done 然后再查看
[root@l_192_168_132_089 /root]# ipcs ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 8552448 root 600 184324 74 dest ------ Semaphore Arrays -------- key semid owner perms nsems 0x00000000 8486912 nobody 600 1 ------ Message Queues -------- key msqid owner perms used-bytes messages 再重新启动apache,这次正常启动了
另外一个问题,就是日志是用中文输出的,对应的错误提示在网上无法搜到,而对应的英文
semget: 设备上没有空间 semget: No space left on device 在google上很容易找到结果。看来以后要把服务器的默认语言设置为英文才行。
#export LC_ALL=en_US #locale 本文出自 “风吹云动” 博客,请务必保留此出处http://coolerfeng.blog.51cto.com/133059/81814 本文出自 51CTO.COM技术博客 |



coolerfeng
博客统计信息
热门文章
最新评论
友情链接

