由于"HEALTH_CONSTRAINTS",AWS部署失败 [英] AWS Deployment Failed due to "HEALTH_CONSTRAINTS"

查看:158
本文介绍了由于"HEALTH_CONSTRAINTS",AWS部署失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个场景,在该场景中,我需要将代码从GIT存储库推送到AWS Instance.为此,我使用了 AWS CodeDeploy 功能.但是在部署代码的过程的最后一步,我收到以下错误.

I am working on a scenario, where I need to push the code from a GIT repository to AWS Instance. To achieve this I am using AWS CodeDeploy feature. But in the final step of the process to deploy the code, I am receiving the below error.

部署失败 总体部署失败,因为有太多的单个实例部署失败,可供部署的运行状况良好的实例太少,或者部署组中的某些实例遇到了问题. (错误代码:HEALTH_CONSTRAINTS)

Deployment Failed The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. (Error code: HEALTH_CONSTRAINTS)

推荐答案

如果EC2实例没有正确的IAM角色,则可以看到此错误.使用策略"AmazonEC2RoleforAWSCodeDeploy"创建一个IAM角色.您不能将IAM角色添加到现有实例,因此必须启动一个新实例.

You can see this error if the EC2 instance does not have the correct IAM role. Create an IAM role with the policy "AmazonEC2RoleforAWSCodeDeploy". You can't add an IAM role to an existing instance, so you'll have to launch a fresh one.

还要确保已为正确的区域安装了CodeDeploy代理,例如对于us-east-1:

Also make sure you've installed the CodeDeploy agent for the correct region, e.g. for us-east-1:

apt-get -y install awscli ruby2.0
aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1
chmod +x ./install
./install auto

http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-set-up-new-instance.html

这篇关于由于"HEALTH_CONSTRAINTS",AWS部署失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆