简体   繁体   English

示例AWS EC2容器服务云形成模板失败

[英]sample aws ec2 container services cloud formation template fails

I am trying to setup a stack from the sample provided by aws http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ecs.html 我正在尝试从AWS http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ecs.html提供的示例中设置堆栈

The stack starts creates a cluser/service/task etc fine except it doest register the ec2 container to my cluster and stack creation eventually fails. 堆栈开始会创建cluser / service / task等,但是它没有将ec2容器注册到我的集群中,并且堆栈创建最终失败。

digging into the /var/log/cloud-init-ouput.log I find this 深入研究/var/log/cloud-init-ouput.log我发现了这个

+ yum install -y aws-cfn-bootstrap
Loaded plugins: priorities, update-motd, upgrade-helper


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: amzn-main/latest
Could not retrieve mirrorlist http://repo.ap-southeast-2.amazonaws.com/latest/main/mirror.list error was
12: Timeout on http://repo.ap-southeast-2.amazonaws.com/latest/main/mirror.list: (28, 'Connection timed out after 10001 milliseconds')

It seems that while the stack is being deployed, it cannot access the network to do a yum install. 似乎在部署堆栈时,它无法访问网络以执行yum安装。 Connecting to the box via ssh and running 通过ssh连接到盒子并运行

yum install -y aws-cfn-bootstrap

works just fine. 效果很好。

Any clue whats stopping the stack from accessing the network while its being deployed? 有什么线索阻止堆栈在部署时访问网络?

Figured it out. 弄清楚了。 just incase someone else falls down this rabbit hole, I did not have a public ip on my subnet. 以防万一其他人掉进这个兔子洞,我的子网上没有公共IP。 Hence it couldnt connect to the internet 因此,它无法连接到互联网

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM