简体   繁体   中英

CHEF Server--Error: Network Error: getaddrinfo: nodename nor servname provided, or not known

I'm trying to update a Chef server that is hosted on a AWS EC2 instance. This is what happens when I'm trying to connect to the server:

$ knife ssl check
Error: Network Error: getaddrinfo: nodename nor servname provided, or not  
known

I can only think of issues w/ the knife configuration. However, all knife functions work within the AWS EC2 instance, while not on my local machine (Macbook+iTerm).

knife.rb on EC2

log_level              :info
log_location           STDOUT
node_name              'jdoe'
client_key             '/home/ec2-user/.chef/jdoe.pem'
validation_client_name   'chef-validator'
validation_key           '/etc/chef-server/chef-validator.pem'
chef_server_url          'https://ip-xx-x-x-xxx.ec2.internal:443'
syntax_check_cache_path  '/home/ec2-user/.chef/syntax_check_cache'    

knife.rb on local machine

log_level                :info
log_location             STDOUT
node_name                'jdoe'
client_key               '/Users/.../.chef/jdoe.pem'
validation_client_name   'chef-validator'
validation_key           '/Users/.../.chef/chef-validator.pem'
chef_server_url          'https://ip-xx-x-x-xxx.ec2.internal:443'       
syntax_check_cache_path  '/Users/yoonsulee/.chef/syntax_check_cache'

# Amazon AWS
knife[:aws_access_key_id]='A...........Q'     # actual access key
knife[:aws_secret_access_key]='Q.............................g'      # actual secret access eky
knife[:aws_ssh_key_id]='xyz-abcd'        # general key name used for AWS access

My AWS security group and ACL are all fine. And I was somehow able to download 'trusted_certs' from:

$ knife ssl fetch

Ultimately, I'm trying to do the following from my Chef repo directory:

$ berks upload <new_cookbook> --force
$ knife role from file ../../roles/*

Looks like the issue is due to you using the internal DNS name of your EC2 instance. Unless you are VPN'd in to your AWS VPC this will not resolve. You should change your workstation's knife.rb to use the Public DNS name if it exists. If you do not wish to create a public endpoint for your instance, you will need to VPN to your VPC to have internal endpoints resolvable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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