无法使用AWS Code Deployment进行部署:可用于部署的健康实例太少

时间:2018-08-19 11:53:21

标签: amazon-web-services aws-code-deploy

我正在尝试将应用程序从s3 bucket部署到ec2 instace中。我创建了具有所需s3权限的实例,还创建了具有所需ec2权限的代码部署应用程序

当我尝试部署思想时,我会得到:

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实例来检查代码部署日志,这就是我得到的:

2018-08-18 20:52:11 INFO  [codedeploy-agent(2704)]: On Premises config file does not exist or not readable
2018-08-18 20:52:11 ERROR [codedeploy-agent(2704)]: booting child: error during start or run: Errno::ENETUNREACH - Network is unreachable - connect(2) - /usr/share/ruby/net/http.rb:878:in `initialize'

我尝试更改权限,重新启动代码部署代理,创建全新的codeDEploy应用程序。似乎没有任何作用。

1 个答案:

答案 0 :(得分:1)

为了使代理能够从CodeDeploy中提取命令,您的主机需要具有对Internet的网络访问权限,这可能受到EC2安全组,VPC,主机上的配置等的限制。访问,请尝试ping CodeDeploy端点:

ping codedeploy.us-west-2.amazonaws.com

尽管您应将端点用于主机所在的区域-请参见here

如果您已将代理配置为使用代理配置,则可能必须像here这样重新启动代理。