我如何在Windows EC2实例执行的UserData内容 [英] How do I execute UserData content in a Windows EC2 instance

查看:680
本文介绍了我如何在Windows EC2实例执行的UserData内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多的麻烦试图让自动缩放正常运行的云的形成模板。我有以下资源:

I'm having a lot of trouble trying to get a Cloud Formation template running correctly with auto scaling. I have the following resource:

"LaunchConfig" : {
  "Type" : "AWS::AutoScaling::LaunchConfiguration",
  "Properties" : {
    "KeyName" : { "Fn::FindInMap" : [ "EnvironmentToKeyName", { "Ref" : "Environment" }, "KeyName" ] },
    "ImageId" : { "Fn::FindInMap" : [ "AWSRegionToAMI", { "Ref" : "AWS::Region" }, "AMI" ] },
    "SecurityGroups" : [ "neat_spi" ],
    "InstanceType" : { "Ref" : "InstanceType" },
    "UserData" : { "Fn::Base64" : {
        "Fn::Join" : ["", [ "<script>", "call c:\\chef\\boot.bat", { "Ref" : "Environment" }, "</script>"]]
      }
    }
  }
}

但它看起来并不像当机器开始这个脚本运行的。我如何确保它运行?或者,我怎么找出它为什么没有运行?

But it doesn't look like this script is running at all when the machine is started. How do I make sure it runs? Or how do I figure out why it isn't running?

我找不到任何记录就怎么看,如果这是运行或没有任何地方。

I can't find any logging anywhere on how to see if this was run or not.

推荐答案

几件事情要寻找...

Couple of things to look for...

    安装
  1. 验证CFN工具
  2. 请在C:\ CFN子目录 - 有一个叫原木漂浮在某处路径 - 复查
  3. 查找在Program Files \亚马逊\ ec2tools - 有一个日志目录在那里。检查以确保它的运行脚本
  4. 在目录上面有一个文件夹,名为脚本 ​​- 你应该看到的东西,看起来像userdata.bat - 试运行,以确认它的工作原理

故障排除CloudFormation和userData是耗时 - 而且可能是昂贵的 - 因为你每次启动和停止实例时间计费了一个小时。一些作品以很大的优势亚马逊。 (每分钟的价格带来请)

Troubleshooting CloudFormation and Userdata is time consuming - and can be costly - because you get billed for an hour every time you start and stop the instance. Something that works to great advantage for Amazon. (Bring on per minute pricing please)

这篇关于我如何在Windows EC2实例执行的UserData内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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