1

If I setup my hosts files such that they reference all other ec2 nodes using the internal ip addresses, will this work or do I have to use the external ip addresses?

Do I need to specify anything in my security group to get internal ip addresses to work?

e.g. /etc/hosts

ip-10-11-12-13.internal  some_node_name

If I do this, can I reference some_node_name anywhere in my scripts where I would have used the ip address previously?

On my puppet agent servers, I have a reference to my puppet master like:

public-ip-here puppet

When I reboot my puppet agent's, syslog shows they couldn't find the master with the message: getaddinfo : name or service not known

I did get it to work by updating /etc/default/puppet

and I added to the options:

--server=public-ip-here

From what I read, puppet will by default try using 'puppet', and I set this in my hosts file so why wouldn't it be picking this up?

2 Answers 2

2

One tip for using puppet in EC2 is to assign an ElasticIP to your puppetmaster, and then create a DNS entry for the ElasticIP CNAME and not an A record for the IP.

AWS DNS servers use dns "views" to vary their response based on if the query came from within the same EC2 region, or exterior. If the CNAME request comes from within a EC2 region, the AWS DNS servers will respond with the internal IP of the CNAME. (Go read about BIND "Views" for conditional DNS responses)

You should use the CNAME in DNS so that when EC2 puppet clients query the AWS DNS servers for the IP of the Puppetmaster, they will receive a response that directs them to the internal IP of the puppetmaster, and not the external IP.

Summary: don't use /etc/hosts to find the puppetmaster in EC2, that internal IP may change, and doesn't work across multiple regions. Use a CNAME record that points to the ElasticIP CNAME stored in DNS.

0

that hosts file is wrong.. If your puppet server has an internal IP of 10.0.1.10. Then each node you want to connect to it is

10.0.1.10 puppet

Then that node will connect just fine with no --server line. If all the nodes are in US-east they have to use the internal IP. If your puppet server is in east and some clients on west.. Those clients on west use public and the east ones still use internal.

3
  • ok so the internal ip, I have to remove the dashes and the suffic .internal?
    – Blankman
    May 30, 2011 at 1:58
  • btw, it works when I use the public IP in the same region, so public ip's do work...thanks!
    – Blankman
    May 30, 2011 at 1:59
  • Removed incorrect line about EC2 public IP connections.
    – Nathan V
    Sep 8, 2015 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .