简体   繁体   English

VPC和自动调用的Windows实例的AWS Cloudformation问题

[英]AWS Cloudformation trouble with VPC and Autoscalled Windows instances

I am trying to combine the Cloud formation template multi-tier-web-app-in-vpc.template with the cloudformation template used by viusal studio to create Load Balanced instances. 我正在尝试将Cloud形成模板multi-tier-web-app-in-vpc.template与viusal studio使用的cloudformation模板结合起来以创建负载均衡实例。 The goal is to create 2 application servers within a private subnet of a VPC. 目标是在VPC的专用子网内创建2个应用服务器。 The template works fine but when I start plugging in windows instances they just fail. 该模板可以正常工作,但是当我开始插入Windows实例时,它们只会失败。 Error Message CREATE_FAILED WaitCondition timed out. 错误消息CREATE_FAILED WaitCondition超时。 Received 0 conditions when expecting 1 The following resource(s) failed to create: [FrontendWaitCondition]. 预期为1时收到0个条件以下资源创建失败:[FrontendWaitCondition]。 . Rollback requested by user. 用户请求的回滚。

Template used to create the cloud formation https://s3.amazonaws.com/hg-optimise/Windows-Multi-Tier.template 用于创建云形成的模板https://s3.amazonaws.com/hg-optimise/Windows-Multi-Tier.template

I am trying to use the following Amazon templates as guides. 我正在尝试使用以下Amazon模板作为指南。

Amazon Visual Studio Template https://s3.amazonaws.com/hg-optimise/Visual-Studio.template 亚马逊Visual Studio模板https://s3.amazonaws.com/hg-optimise/Visual-Studio.template

Amazon Multi-tier Web Sample - http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ https://s3.amazonaws.com/cloudformation-templates-us-east-1/multi-tier-web-app-in-vpc.template 亚马逊多层网络样本-http : //aws.amazon.com/cloudformation/aws-cloudformation-templates/ https://s3.amazonaws.com/cloudformation-templates-us-east-1/multi-tier-web -app功能于vpc.template

It looks like you are taking on too much, trying to get everything working all at once. 您似乎承担了太多的工作,试图使所有功能一次全部生效。 I would try to take it one step at a time. 我会尝试一次迈出一步。 Create a template that gets one instance up, then add auto scaling, then load balancer, then subnet, routing, etc. The problem that presents itself now is likely because you have not signaled success for the wait condition. 创建一个可以启动一个实例的模板,然后添加自动缩放比例,然后添加负载均衡器,子网,路由等。现在出现的问题很可能是因为您没有表示等待条件成功。

Below is the Properties section of an Instance resource. 以下是实例资源的“属性”部分。 This snipet was taken from an AWS documentation page . 此摘录摘自AWS 文档页面 Note that the "UserData" section has a call to cfn-init.exe in order to perform the actions specified in the Instance's Cloud Formation section, and has a call to cfn-signal.exe to signal to the WaitCondition that the instance is up. 请注意,“ UserData”部分具有对cfn-init.exe的调用以便执行在“实例的云形成”部分中指定的操作,并且具有对cfn-signal.exe的调用以向WaitCondition发出实例已启动的信号。

"Properties": {
  "InstanceType" : { "Ref" : "InstanceType" },
  "ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" },
                { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] },
  "SecurityGroups" : [ {"Ref" : "SharePointFoundationSecurityGroup"} ],
  "KeyName" : { "Ref" : "KeyPairName" },
  "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
    "<script>\n",

    "cfn-init.exe -v -s ", { "Ref" : "AWS::StackName" },
    " -r SharePointFoundation",
    " --region ", { "Ref" : "AWS::Region" }, "\n",

    "cfn-signal.exe -e %ERRORLEVEL% ", { "Fn::Base64" : { "Ref" : "SharePointFoundationWaitHandle" }}, "\n",

    "</script>"
    ]]}}
  }

You have set the front end wait condition to basically wait until your FrontendFleet is up and running. 您已将前端等待条件设置为基本上等待直到FrontendFleet启动并运行。 You should set a desired capacity for your front end fleet. 您应该为前端机队设置所需的容量。

When you get this error, what is the state of your autoscaling group FrontendFleet? 收到此错误时,自动伸缩组FrontendFleet的状态是什么? If this is still bringing up instances, then your timeout is simply to short. 如果仍然在启动实例,那么您的超时就很短。

I honestly wouldn't worry about the waitcondtions unless you really need them. 老实说,除非您真的需要它们,否则我不会担心这些等待条件。

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

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