我有两个独立的 WordPress 节点,前面有一个 Haproxy 负载均衡器。在我设置、测试并运行基础设施后,几个小时后,整个基础设施都瘫痪了,我得到的只是 503。当然,最初我以为是流量过大,但在我重新启动每个 WordPress 节点后,我意识到了一个问题。在我的任何 WordPress 节点上,如果我运行
wget http://127.0.0.1:80 -O -
结果是
--2017-04-07 04:17:34-- http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response...
大约 4 秒后,它返回
503 Service Unavailable
2017-04-07 04:17:36 ERROR 503: Service Unavailable.
显然,localhost 的响应时间为 4 秒,这足以说明服务器出了问题。但是,CPU 和 RAM 使用率正常,运行sudo apache2ctl status
结果正确,apache2 配置文件良好,等等。
我很困惑,之前一切都还正常,突然整个基础设施就崩溃了。我想不出是什么原因导致了这种行为的发生。下面附上了其中一个节点的 Apache 错误日志文件,虽然看起来没什么不对劲,但我只进行了手动重启。有什么想法吗?
[Thu Apr 06 21:27:19.583583 2017] [mpm_prefork:notice] [pid 1694] AH00169: caught SIGTERM, shutting down
[Thu Apr 06 21:27:20.603065 2017] [mpm_prefork:notice] [pid 8384] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Apr 06 21:27:20.603220 2017] [core:notice] [pid 8384] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 06 22:03:45.892434 2017] [mpm_prefork:notice] [pid 8384] AH00169: caught SIGTERM, shutting down
[Thu Apr 06 22:03:47.070402 2017] [mpm_prefork:notice] [pid 9535] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Apr 06 22:03:47.070532 2017] [core:notice] [pid 9535] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 07 03:09:33.930486 2017] [mpm_prefork:notice] [pid 9535] AH00173: SIGHUP received. Attempting to restart
[Fri Apr 07 03:09:34.055213 2017] [mpm_prefork:notice] [pid 9535] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 07 03:09:34.055362 2017] [core:notice] [pid 9535] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 07 03:49:01.465024 2017] [mpm_prefork:notice] [pid 9535] AH00173: SIGHUP received. Attempting to restart
[Fri Apr 07 03:49:01.577496 2017] [mpm_prefork:notice] [pid 9535] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 07 03:49:01.577628 2017] [core:notice] [pid 9535] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 07 04:06:50.129119 2017] [mpm_prefork:notice] [pid 9535] AH00171: Graceful restart requested, doing restart
[Fri Apr 07 04:06:50.255452 2017] [mpm_prefork:notice] [pid 9535] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 07 04:06:50.255480 2017] [core:notice] [pid 9535] AH00094: Command line: '/usr/sbin/apache2'