如何解决Docker容器启动后的某个时间出现错误503
我有一个docker compose文件,该文件创建了节点js,php容器和一个MySql DB。一切正常,容器已装好。但是,当我尝试检查网站状态时,一会儿出现错误503。网站在大约5分钟后启动。我在Docker日志中没有看到任何错误。附加了docker stats命令输出。内存分配看起来不错。
应用docker日志,您看到那里有4分钟的时间。
AH00558: apache2: Could not reliably determine the server's fully qualified domain name,using 172.*.*.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name,using 172.*.*.2. Set the 'ServerName' directive globally to suppress this message
[Wed Aug 19 13:22:09.190559 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.18 configured -- resuming normal operations
[Wed Aug 19 13:22:09.190694 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
172.*.*.* - - [19/Aug/2020:13:26:53 -0400] "GET / HTTP/1.1" 200 2327 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/80.0.3987.149 Safari/537.36"
172.*.*.* - - [19/Aug/2020:13:26:54 -0400] "GET /static/js/main.0c1fa848.chunk.js HTTP/1.1" 200 9534 "https://example.ai/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/80.0.39.149 Safari/537.36"
解决方法
Docker日志不能保证网站正常运行,它可以检查服务状态,但是网站可能需要一些时间才能启动。尝试找出手动启动所有服务后需要花费多少时间。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。