title: How do I set up ElasticSearch nodes on EC2 so they have consistent DNS entries?
body: <p>I have 3 ElasticSearch nodes in a cluster on AWS EC2.  My client apps use connection pooling and have the public IP addresses for all 3 nodes in their config files.</p>
  
  <p>The problem I have is that EC2 seems to occasionally reassign public IP addresses for these instances.  They also change if I stop and restart an instance.</p>
  
  <p>My app will actually stay online since the connection pool will round robin the three known IP addresses, but eventually, all three will change and the app will stop working.</p>
  
  <p>So, how should I be setting up an ElasticSearch cluster on EC2 so that my clients can continue to connect even if the instances change IP addresses?</p>
  
  <ol>
  <li>I could use Elastic IPs, but these are limited to 5 per account and I will eventually have many more than 5 nodes (different environments, dev, staging, test, etc.)  </li>
  <li>I could use Elastic Load Balancers, and put one node behind each ELB, but that seems like a pretty hacky solution and an improper use of load balancers.</li>
  <li>I could create my own DNS entries under my own domain and update the DNS table whenever I notice an IP address has changed, but that seems really error prone if no one is checking the IPs every day.</li>
  </ol>
  
  <p>Is there an option I'm missing?</p>