【发布时间】:2016-09-15 22:31:48
【问题描述】:
我正在使用 chef_gem "right_aws" version '3.0.5'
https://supermarket.chef.io/cookbooks/aws#changelog
v2.5.0 (2014-10-22)
尝试在 ec2-central-1 区域中使用 aws cookbook 时出现以下错误
WARN: Rightscale::HttpConnection : request failure count: 1, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : request failure count: 2, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : request failure count: 3, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : request failure count: 4, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : re-raising same error: https://eu-central-1.ec2.amazonaws.com:443 temporarily unavailable: (SocketError: getaddrinfo: Name or service not known) -- error count: 4, error age: 0
从这个文档'http://docs.aws.amazon.com/general/latest/gr/rande.html',
端点应该是'ec2.eu-central-1.amazonaws.com'
我尝试在libraries-> ec2.rb 下编辑我的食谱,但它不起作用:
require 'open-uri'
module Opscode
module Aws
module Ec2
...
def ec2
region = instance_availability_zone
region = region[0, region.length-1]
aws_ec2_endpoint = "https://ec2." + region + ".amazonaws.com"
Chef::Log.debug("Using AWS EC2 endpoint: " + aws_ec2_endpoint)
@@ec2 ||= create_aws_interface(RightAws::Ec2)
end
任何人都可以提供任何解决方法?
谢谢!
【问题讨论】:
标签: ruby rubygems chef-infra chef-recipe