# Connecting remote elasticsearch cluster from the java api

**URL:** <https://discuss.elastic.co/t/connecting-remote-elasticsearch-cluster-from-the-java-api/6231>\
**Category:** Elasticsearch\
**Created:** [December 23, 2011, 1:24pm UTC](https://discuss.elastic.co/t/connecting-remote-elasticsearch-cluster-from-the-java-api/6231 "2011-12-23T13:24:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![es\_newbie](https://avatars.discourse-cdn.com/v4/letter/e/59ef9b/32.png) [@es\_newbie](https://discuss.elastic.co/u/es_newbie)\
**Post date:** [December 23, 2011, 1:24pm UTC](https://discuss.elastic.co/t/connecting-remote-elasticsearch-cluster-from-the-java-api/6231/1 "2011-12-23T13:24:31Z")

</div>

Hi, I have to connect a remote elasticsearch cluster from the java api. I can connect the node from curl. Everything works fine. Now I have to do this from my java code.

1. No, I don't want to use the transport client.
2. No, I don't want to create a local node. I want to connect a remote server.

Where I should to put my remote server domain and ip? I don't see the node client can do this.

Does anybody know a good code snippet to do this?

I need analogous functionality to ruby/tire.

Thanks.

---

<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, 3:44am UTC](https://discuss.elastic.co/t/connecting-remote-elasticsearch-cluster-from-the-java-api/6231/2 "2017-07-06T03:44:27Z")

</div>


