# Error on indexing remote es cluster using spark on ES 5 alpha3

**URL:** <https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [June 17, 2016, 2:07pm UTC](https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164 "2016-06-17T14:07:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepakas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deepakas/32/697_2.png) [@deepakas](https://discuss.elastic.co/u/deepakas)\
**Post date:** [June 17, 2016, 2:07pm UTC](https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164/1 "2016-06-17T14:07:16Z")

</div>

Hi ,  
I am getting the following error when I try to index a remote cluster using spark. It works fine locally in my Mac when I try to index on the elasticsearch instance on the Mac.I tried passing the es.nodes.wan.only as true. But still the same error.

executor localhost: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException (Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.only') [duplicate 1]

---

<div class="post-metadata">

**Author:** ![SaurabhM](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@SaurabhM](https://discuss.elastic.co/u/SaurabhM)\
**Post date:** [July 25, 2016, 8:36pm UTC](https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164/2 "2016-07-25T20:36:46Z")

</div>

I am also getting the same error. Will your problem resolved.?

---

<div class="post-metadata">

**Author:** ![Habitats](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/habitats/32/12796_2.png) [@Habitats](https://discuss.elastic.co/u/Habitats)\
**Post date:** [October 28, 2016, 12:00pm UTC](https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164/3 "2016-10-28T12:00:18Z")

</div>

I'm having this issue as well. Did you get it resolved?

---

<div class="post-metadata">

**Author:** ![xiaodong](https://avatars.discourse-cdn.com/v4/letter/x/b5a626/32.png) [@xiaodong](https://discuss.elastic.co/u/xiaodong)\
**Post date:** [March 1, 2017, 6:58am UTC](https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164/4 "2017-03-01T06:58:32Z")

</div>

> [@deepakas](#):
>
> localhost: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException (Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.only') [duplicate

I have the same issue. The version is as follows:  
1.es-hadoop: 5.2.1  
2.spark : 2.1  
3:scala:2.11

scala script:  
import org.apache.spark.SparkConf  
import org.elasticsearch.spark.\_

val conf = new SparkConf()  
conf.set("es.index.auto.create", "true")  
conf.set("es.nodes", "10.10.13.120")  
conf.set("es.nodes.wan.only", "true")  
val numbers = Map("one" -\> 1, "two" -\> 2, "three" -\> 3)  
val airports = Map("OTP" -\> "Otopeni", "SFO" -\> "San Fran")  
sc.makeRDD(Seq(numbers, airports)).saveToEs("spark/docs")

And I had captured packets via strace. I found that no connection was created by the shell(connect function was not invoked).

---

<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:22pm UTC](https://discuss.elastic.co/t/error-on-indexing-remote-es-cluster-using-spark-on-es-5-alpha3/53164/5 "2017-07-06T13:22:27Z")

</div>


