【发布时间】:2019-10-20 02:07:28
【问题描述】:
我正在尝试在 elasticbeanstalk 上部署一个 django 应用程序。它一直工作正常,然后突然停止,我不知道为什么。
当我做eb deploy 我得到
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
INFO: New application version was deployed to running EC2 instances.
INFO: Environment update completed successfully.
Alert: An update to the EB CLI is available. Run "pip install --upgrade awsebcli" to get the latest version.
INFO: Attempting to open port 22.
INFO: SSH port 22 open.
INFO: Running ssh -i /home/ubuntu/.ssh/web-cdi_011017.pem ec2-user@54.188.214.227 if ! grep -q 'WSGIApplicationGroup %{GLOBAL}' /etc/httpd/conf.d/wsgi.conf ; then echo -e 'WSGIApplicationGroup %{GLOBAL}' | sudo tee -a /etc/httpd/conf.d/wsgi.conf; fi;
INFO: Attempting to open port 22.
INFO: SSH port 22 open.
INFO: Running ssh -i /home/ubuntu/.ssh/web-cdi_011017.pem ec2-user@54.188.214.227 sudo /etc/init.d/httpd reload
Reloading httpd: [ OK ]
当我运行eb health 时,我得到了
在所有实例上发现不正确的应用程序版本。预期版本 “app-c56a-190604_135423”(部署 300)。
如果我 eb ssh 并查看 /opt/python/current 那里什么都没有,所以没有任何东西被复制
我认为.elasticbeanstalk/config.yml 可能有问题。不知何故,该目录被删除并重新设置。这是config.yml
branch-defaults:
master:
environment: app-prod
scoring-dev:
environment: app-dev
environment-defaults:
app-prod:
branch: null
repository: null
global:
application_name: my-app
default_ec2_keyname: am-app_011017
default_platform: arn:aws:elasticbeanstalk:us-west-2::platform/Python 2.7 running
on 64bit Amazon Linux/2.3.1
default_region: us-west-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: null
sc: git
workspace_type: Application
请问您有什么解决问题的方法吗?
【问题讨论】:
-
我时不时地在弹性豆茎上遇到这个问题,没有明显的原因。有时我必须部署 3 或 4 次才能成功。但我也会在您部署时跟踪
/var/log/eb-activity.log,并确保没有其他错误发生。 -
@littleforest 在部署时如何跟踪日志?
-
您需要在开始部署之前通过 ssh 进入该框。然后运行:
tail -f /var/log/eb-activity.log。在部署时观察日志。如果没有错误,那么只需尝试部署几次。最终它应该工作。如果您设置了自动缩放,那么您也可以终止实例并让它启动一个新实例。然后再次尝试部署。有时这会有所帮助。 -
我试过了,没有任何改变
标签: django amazon-elastic-beanstalk