【发布时间】:2021-01-24 15:22:31
【问题描述】:
我无法在 Elastic Beanstalk 上部署新版本。
在我尝试部署一个有很多问题的新版本之前,一切都运行良好(这不是我第一次在这个环境中部署一个新版本,我已经部署了几十个)。当我设法修复所有这些错误时,我得到了这些错误:
Failed to deploy application.During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.Unsuccessful command execution on instance id(s) 'i-...'. Aborting the operation
我重新部署了不起作用的版本。
这是 Elastic Beanstalk 控制台:
Elastic Beanstalk 的请求日志按钮不返回任何内容。 EC2 实例的系统日志显示最后的工作版本日志。
我从 Configuration 导航窗格启用 CloudWatch 日志。它向 CloudWatch 日志中添加了 4 个文件:
-
/var/log/eb-activity.log-> 目前为空 -
/var/log/httpd/access_log-> 目前为空 -
/var/log/httpd/error_log-> 目前为空 -
/environment-health.log->Command is executing on all instances (56 minutes or more elapsed).", "Incorrect application version found on all instances. Expected version \"prod-v1.7.28-0\" (deployment 128).
它是一个 Amazon Linux,t2.medium 实例,以 Apache 作为 Web 服务器
我已经尝试过的:
- 每次将 .zip 的名称更改为与已部署的其他 zip 不同的名称
- 终止实例,loadBalancer 自动创建一个新实例
- 重启实例
- 重建 Elastic Beanstalk 环境
- 部署最简单的代码
我尝试使用以下代码仅部署一个 zip,但我遇到了同样的错误。
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
它总是回到上一个工作版本,当我尝试部署新版本时它不起作用。
在一些帖子中,我看到有人说这可能是因为实例太小,但在它正常工作之前,并且从那时起大小没有改变。
如果您有任何问题或想法,我将不胜感激。 祝你有美好的一天!
答案:
问题出在您所说的日志中。我必须通过 ssh 进入我的 EC2 实例才能联系到他们。错误在文件cfn-init-cmd.log 中。
其中一个命令正在等待输入,因此它超时且没有错误消息。
【问题讨论】:
标签: amazon-web-services amazon-ec2 amazon-elastic-beanstalk amazon-elb