LoginSignup
3
1

More than 5 years have passed since last update.

今まで普通に動いていたApacheが起動に失敗した(No space left on device)

Posted at

状況確認

EC2上で稼働していたhttpdがある日突然起動に失敗した。
エラーログdefault:/var/log/httpd/error_logを確認のところ、次の一文が確認された

No space left on device: AH00023: Couldn't create the watchdog-callback mutex

検索すると、ログローテーション時にセマフォを使い切っていて起動できなかった模様。
現在のセマフォ状況はipcs -sコマンドで確認できる

[root@test-server]# ipcs -s
------ セマフォ配列 --------
キー     semid      所有者  権限     nsems
0x00000000 48365568   apache     600        1
0x00000000 48398337   apache     600        1
0x00000000 48431106   apache     600        1
0x00000000 48463875   apache     600        1
0x00000000 48496644   apache     600        1
0x00000000 48529414   apache     600        1

セマフォの上限はsysctl -aコマンドで確認できる

[root@test-server]# /sbin/sysctl -a | grep sem
kernel.sem = 250        32000   32      128

おそらくセマフォの識別子数が128で、ipcsコマンドの結果が128行に達すると起動に失敗する。

初期対応

service httpd restartでセマフォ数は減って起動するようになったが、翌日また増えている。
どうやらservice httpd gracefulコマンドだったりログローテーションの場合のみ、セマフォが増え続ける模様

調査

以下確認のところ、Apache/2.4.25で発生するバグであった模様
http://forum.directadmin.com/showthread.php?t=54265
https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/CHANGES

恒久対応

バージョン確認すると、ばっちり該当した

[root@test-server]# httpd -v
Server version: Apache/2.4.25 (Amazon)
Server built:   Jan 19 2017 16:55:49

yum update httpdで2.4.27にアップデートし、問題が解消されたことを確認した

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1