2012-10-11 32 views
0

這是我第一次嘗試使用VPC。cfn-init不能在使用Cloud Formation的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 

從實例中,我可以通過訪問互聯網網頁瀏覽器。

+0

真的嗎?沒有人 ? – dparkar

回答

4

您需要設置一個NAT服務器或給該盒子分配一個彈性IP地址,否則它不能與互聯網通信。

2

這有點舊,但我最近在類似的問題上花了很多時間。 使用cfn-init時,添加NAT或網關是不夠的。還需要添加一個依賴-上運行CFN-初始化實例和網關之間:

"MyInstance1" : { 
    "Type" : "AWS::EC2::Instance",  
    "DependsOn" : "Gateway", 
    .... 
} 
0

我有一個類似的問題試圖運行Active Directory CF模板,但我得到的錯誤是性能稍微不同:

gaierror(11001, 'getaddrinfo failed') 

它發生了它與VPC上設置的DHCP選項有關。

我需要設置的域控制器的域:

Options: 
    domain-name = example.com 
    domain-name-servers = AmazonProvidedDNS 

很顯然,有一次,我建立了我的DC與DNS服務器,我可以在Amazon提供的語句改變我自己的IP地址。

相關問題