django - Elastic Beanstalk 环境的运行状况严重:以下服务未运行:发布
问题描述
我将 Django 应用程序部署到 Elastic Beanstalk (EB) Amazon Linux 2 Python 3.7 平台,一切似乎都运行良好。然而,环境的健康状况很严重,我不知道为什么。
EB 给我的唯一信息如下:
总体状态:降级 - 所有实例上的服务受损。
(只有一个实例在运行)
实例状态:严重 - 以下服务未运行:发布。
我没有找到有关“发布”服务是什么的信息。
从完整日志中,我看到的唯一错误如下:
守护进程日志:
F, [2020-11-07T04:03:03.891398 #5022] FATAL -- : /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/launcher.rb:432:in `block in setup_signals': SIGTERM (SignalException)
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/single.rb:117:in `join'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/single.rb:117:in `run'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/launcher.rb:172:in `run'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/cli.rb:80:in `run'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/healthd-1.0.6/bin/healthd:112:in `block in <top (required)>'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/healthd-1.0.6/bin/healthd:19:in `chdir'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/healthd-1.0.6/bin/healthd:19:in `<top (required)>'
from /opt/elasticbeanstalk/lib/ruby/bin/healthd:23:in `load'
from /opt/elasticbeanstalk/lib/ruby/bin/healthd:23:in `<main>'
从我在这里读到的内容来看,这个 SignalException 被抛出以关闭一个进程,所以我认为它是正常的。
任何其他日志中都没有其他错误。如此处所述,关闭增强的运行状况检查将是简单的“解决方案”,但我想继续使用它们。
很感谢任何形式的帮助。
解决方案
.config 命令:
container_commands:
01_migrate:
command: "source $(find /var/app/venv/ -name activate) && export $(sudo egrep -v '^#' /opt/elasticbeanstalk/deployment/env | xargs) && python manage.py migrate --noinput"
leader_only: true
02_static:
command: "source $(find /var/app/venv/ -name activate) && export $(sudo egrep -v '^#' /opt/elasticbeanstalk/deployment/env | xargs) && python manage.py collectstatic --noinput"
leader_only: true
推荐阅读
- flutter - BottomAppBar 浮动操作按钮缺口/插图不透明
- c# - Office 365 API 中的电子邮件回复通知
- android - 领域/君主制:将项目标题添加到分页列表
- javascript - 使用 autoNumeric.js 更新输入字段
- sql - NonUniqueResult 但实际上是一行
- android - 为什么 ScrollView 会自动滚动到屏幕底部?
- angular - 仅使用 html 元素引用禁用 p-dropdown
- python - pythons lambda可以用来改变另一个函数的内部工作吗?
- azure - 如何在不创建 DHL 或 Fedex 帐户的情况下将日志文件生成到天蓝色?
- apache - Apache 虚拟主机无法连接