# ElasticSearch: Allow only local requests

**URL:** <https://discuss.elastic.co/t/elasticsearch-allow-only-local-requests/11217>\
**Category:** Elasticsearch\
**Created:** [March 20, 2013, 8:36am UTC](https://discuss.elastic.co/t/elasticsearch-allow-only-local-requests/11217 "2013-03-20T08:36:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srikanth\_gone](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Srikanth\_gone](https://discuss.elastic.co/u/Srikanth_gone)\
**Post date:** [March 20, 2013, 8:36am UTC](https://discuss.elastic.co/t/elasticsearch-allow-only-local-requests/11217/1 "2013-03-20T08:36:56Z")

</div>

Hi All,

i am trying search data from remote server using Elastic search java api

i have made changes in elasticsearch.yml

network.host: "10.0.0.12" .. (remote server ip )

and in java

Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("192.168.10.2",  
9300))  
.addTransportAddress(new InetSocketTransportAddress("10.0.0.12",  
9300));

SearchResponse response = null;  
response =  
client.prepareSearch().setQuery(QueryBuilders.queryString("_"+searchText+"_").field("userName").field("firstName").field("displayName").field("lastName").field("email").field("phoneNumber").field("alternativeContact").field("office").field("practice").field("role").field("additionalFields").field("createdBy").field("modifiedBy")).setFrom(0).setSize(25).setIndices("dc\_user\_idx")  
.setTypes("DC\_USER").execute().actionGet();

for (SearchHit hit : results) {  
result.put(""+count, hit.getSource()); // the retrieved document  
list.add(hit.getSource());  
}

i am getting node not available exception

is there anything missing  
please can any one help me..

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 20, 2013, 9:02am UTC](https://discuss.elastic.co/t/elasticsearch-allow-only-local-requests/11217/2 "2013-03-20T09:02:00Z")

</div>

I'm just wondering why you don't follow Igor's advices?  
Why are you opening new threads again and again with the same question, with the same code?

Don't repeat yourself.

Igor's advice was: "You need to specify cluster name when you create transport client. See the second example in the Transport Client section on this page [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)"

So please, read this page carefully and you should find how to connect to your running node.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 20 mars 2013 à 09:36, srikanth gone [srikanthg93@gmail.com](mailto:srikanthg93@gmail.com) a écrit :

> Hi All,
> 
> i am trying search data from remote server using Elastic search java api
> 
> i have made changes in elasticsearch.yml
> 
> network.host: "10.0.0.12" .. (remote server ip )
> 
> and in java
> 
> Client client = new TransportClient()  
> .addTransportAddress(new InetSocketTransportAddress("192.168.10.2", 9300))  
> .addTransportAddress(new InetSocketTransportAddress("10.0.0.12", 9300));
> 
> SearchResponse response = null;  
> response = client.prepareSearch().setQuery(QueryBuilders.queryString("_"+searchText+"_").field("userName").field("firstName").field("displayName").field("lastName").field("email").field("phoneNumber").field("alternativeContact").field("office").field("practice").field("role").field("additionalFields").field("createdBy").field("modifiedBy")).setFrom(0).setSize(25).setIndices("dc\_user\_idx")  
> .setTypes("DC\_USER").execute().actionGet();
> 
> for (SearchHit hit : results) {  
> result.put(""+count, hit.getSource()); // the retrieved document  
> list.add(hit.getSource());  
> }
> 
> i am getting node not available exception
> 
> is there anything missing  
> please can any one help me..
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:45am UTC](https://discuss.elastic.co/t/elasticsearch-allow-only-local-requests/11217/3 "2017-07-06T02:45:39Z")

</div>


