# How do I set up ElasticSearch nodes on EC2 so they have consistent DNS entries?

**URL:** <https://discuss.elastic.co/t/how-do-i-set-up-elasticsearch-nodes-on-ec2-so-they-have-consistent-dns-entries/18839>\
**Category:** Elasticsearch\
**Created:** [July 23, 2014, 5:58pm UTC](https://discuss.elastic.co/t/how-do-i-set-up-elasticsearch-nodes-on-ec2-so-they-have-consistent-dns-entries/18839 "2014-07-23T17:58:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_v/32/1376_2.png) [@Ryan\_V](https://discuss.elastic.co/u/Ryan_V)\
**Post date:** [July 23, 2014, 5:58pm UTC](https://discuss.elastic.co/t/how-do-i-set-up-elasticsearch-nodes-on-ec2-so-they-have-consistent-dns-entries/18839/1 "2014-07-23T17:58:56Z")

</div>

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.

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.

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.

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?

1. 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.)
2. 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.
3. 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.

Is there an option I'm missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/56aa0943-23d3-46c7-b5ae-210f08af73f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/56aa0943-23d3-46c7-b5ae-210f08af73f7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:13am UTC](https://discuss.elastic.co/t/how-do-i-set-up-elasticsearch-nodes-on-ec2-so-they-have-consistent-dns-entries/18839/2 "2017-07-06T01:13:48Z")

</div>


