这是我第一次尝试使用VPC。
我刚刚把我的模板改成了使用VPC。在VPC外启动堆栈时一切正常,但现在它们在VPC内,我无法在使用cfn-init (Ec2Config)包启动实例时从S3下载我的文件。这是一个Windows盒子。
我在cfn-init日志中看到以下日志:
2012-10-11 08:11:40,992 DEBUG Client initialized with endpoint https://cloudformation.us-east-1.amazonaws.com
2012-10-11 08:11:41,523 DEBUG Describing resource LaunchConfigName in stack StackName
2012-10-11 08:12:03,113 ERROR URLError: getaddrinfo returns an empty list
2012-10-11 08:12:03,144 DEBUG Sleeping for 0.921699 seconds before retrying
2012-10-11 08:12:25,109 ERROR URLError: getaddrinfo returns an empty list
2012-10-11 08:12:25,109 DEBUG Sleeping for 1.240427 seconds before retrying
2012-10-11 08:12:47,386 ERROR URLError: getaddrinfo returns an empty list
2012-10-11 08:12:47,386 DEBUG Sleeping for 5.528233 seconds before retrying
2012-10-11 08:13:13,968 ERROR URLError: getaddrinfo returns an empty list
2012-10-11 08:13:13,968 DEBUG Sleeping for 4.688940 seconds before retrying
2012-10-11 08:13:39,677 ERROR URLError: getaddrinfo returns an empty list 我在cfn-hup日志中看到以下日志:
2012-10-11 08:23:06,550 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf
2012-10-11 08:23:06,893 ERROR Error: main section must contain stack option
2012-10-11 08:33:06,089 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf
2012-10-11 08:33:06,370 ERROR Error: main section must contain stack option
2012-10-11 08:43:06,533 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf
2012-10-11 08:43:06,876 ERROR Error: main section must contain stack option
2012-10-11 08:53:06,119 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf
2012-10-11 08:53:06,416 ERROR Error: main section must contain stack option 在该实例中,我可以通过web浏览器访问互联网。
发布于 2012-12-06 00:12:19
您需要设置NAT服务器或为机箱分配弹性IP地址,否则无法与互联网通信。
发布于 2014-11-11 00:32:17
这有点老了,但我最近在类似的问题上花了很多时间。使用cfn-init时,仅添加NAT或网关是不够的。还需要在运行cfn-init的实例和网关之间添加depends:
"MyInstance1" : {
"Type" : "AWS::EC2::Instance",
"DependsOn" : "Gateway",
....
}发布于 2017-09-23 00:49:17
我尝试运行Active Directory CF模板时也遇到了类似的问题,尽管我得到的错误略有不同:
gaierror(11001, 'getaddrinfo failed')结果表明,这与VPC上设置的DHCP选项有关。
我需要设置域控制器的域:
Options:
domain-name = example.com
domain-name-servers = AmazonProvidedDNS显然,一旦我将我的DC设置为DNS服务器,我就可以将Amazon提供的语句更改为我自己的IP。
https://stackoverflow.com/questions/12842963
复制相似问题