# Issue with AWS Load Balancer when using Java API 2.3.5

**URL:** <https://discuss.elastic.co/t/issue-with-aws-load-balancer-when-using-java-api-2-3-5/71405>\
**Category:** Elasticsearch\
**Created:** [January 12, 2017, 4:04pm UTC](https://discuss.elastic.co/t/issue-with-aws-load-balancer-when-using-java-api-2-3-5/71405 "2017-01-12T16:04:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![qreul](https://avatars.discourse-cdn.com/v4/letter/q/4491bb/32.png) [@qreul](https://discuss.elastic.co/u/qreul)\
**Post date:** [January 12, 2017, 4:04pm UTC](https://discuss.elastic.co/t/issue-with-aws-load-balancer-when-using-java-api-2-3-5/71405/1 "2017-01-12T16:04:15Z")

</div>

We have deployed Elasticsearch 2.1.2 on a AWS server. We have developed a service that communicate to elasticsearch using the Java API 2.3.5. For security reason, we have placed Elasticsearch behind a load balancer. We are encountering some issues when the IP of the load balancer is changing. Is there a known issue with the Java API caching the IP for requests?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 16, 2017, 3:14am UTC](https://discuss.elastic.co/t/issue-with-aws-load-balancer-when-using-java-api-2-3-5/71405/2 "2017-01-16T03:14:52Z")

</div>

What issues?

However there was a problem (fixed in 2.4.2) where DNS entries were not correctly refreshed.

---

<div class="post-metadata">

**Author:** ![qreul](https://avatars.discourse-cdn.com/v4/letter/q/4491bb/32.png) [@qreul](https://discuss.elastic.co/u/qreul)\
**Post date:** [January 20, 2017, 2:57pm UTC](https://discuss.elastic.co/t/issue-with-aws-load-balancer-when-using-java-api-2-3-5/71405/3 "2017-01-20T14:57:24Z")

</div>

It seems that the IP is cached through the Java API and queries are failing when AWS is creating a new IP as the code still uses the old IP. In our case, we use DNS to refer to the elasticsearch endpoint. Looking at the [release notes for 2.4.2](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/release-notes-2.4.2.html), I don't see any references to any resolutions to issue related to DNS.

---

<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:** [February 17, 2017, 2:57pm UTC](https://discuss.elastic.co/t/issue-with-aws-load-balancer-when-using-java-api-2-3-5/71405/4 "2017-02-17T14:57:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
