# Access to es nodes from a proxy not working using hadoop-elasticsearch

**URL:** <https://discuss.elastic.co/t/access-to-es-nodes-from-a-proxy-not-working-using-hadoop-elasticsearch/55355>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [July 12, 2016, 9:56pm UTC](https://discuss.elastic.co/t/access-to-es-nodes-from-a-proxy-not-working-using-hadoop-elasticsearch/55355 "2016-07-12T21:56:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satyajit](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@Satyajit](https://discuss.elastic.co/u/Satyajit)\
**Post date:** [July 12, 2016, 9:56pm UTC](https://discuss.elastic.co/t/access-to-es-nodes-from-a-proxy-not-working-using-hadoop-elasticsearch/55355/1 "2016-07-12T21:56:04Z")

</div>

I am trying to connect to our production amazon ES cluster through a proxy machine, which only has permissions to the nodes to access es data.

PFB configs set,

```
sparkConf.set("spark.driver.allowMultipleContexts", "true")
sparkConf.set("es.index.auto.create", "true")
sparkConf.set("es.nodes.discovery", "true")
//sparkConf.set("es.nodes", "es_hostname:19200")
System.setProperty("http.proxyHost", "----");
System.setProperty("http.proxyPort", "9201");
sparkConf.set("es.nodes","----")
sparkConf.set("es.port","9200")
sparkConf.set("java.net.useSystemProxies","true")

```

So i have tried both ways of using proxy settings , other way as below,  
sparkConf.set("es.net.proxy.https.host","----")  
sparkConf.set("es.net.proxy.https.port","9201")

by using the first set of config the get the below exception,  
Exception in thread "main" org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest: [HEAD] on [logstash-listing\_lifecycle\_monitor-2016.06.14/] failed; server[\<ip-of one of the machine in the es cluster,but not proxy hostname \>:9200] returned [405|Method Not Allowed:]  
not sure if this means that the request has been made to one of the nodes in the es cluster.

by settings as below,  
sparkConf.set("es.net.proxy.https.host","----")  
sparkConf.set("es.net.proxy.https.port","9201")  
it tries connecting and throws connection exception.

Appreciate any kind of inpust on resolving the issue.

---

<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:23pm UTC](https://discuss.elastic.co/t/access-to-es-nodes-from-a-proxy-not-working-using-hadoop-elasticsearch/55355/2 "2017-07-06T13:23:58Z")

</div>


