# Spark elasticcloud connection issue

**URL:** <https://discuss.elastic.co/t/spark-elasticcloud-connection-issue/153789>\
**Category:** Elasticsearch\
**Created:** [October 24, 2018, 11:55am UTC](https://discuss.elastic.co/t/spark-elasticcloud-connection-issue/153789 "2018-10-24T11:55:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_sheik](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Mohammed\_sheik](https://discuss.elastic.co/u/Mohammed_sheik)\
**Post date:** [October 24, 2018, 11:55am UTC](https://discuss.elastic.co/t/spark-elasticcloud-connection-issue/153789/1 "2018-10-24T11:55:13Z")

</div>

we are using spark processing to load data to elastic search. we are using elastic cloud and our spark elastic search connection as below:

\<  
val conf = new SparkConf().setAppName("loaduserdata").setMaster("local")  
.set("es.index.auto.create", "true")  
.set("es.nodes","[xxxx.eu-west-1.aws.found.io](http://xxxx.eu-west-1.aws.found.io)")  
.set("es.port","9243")  
.set("es.net.http.auth.user","xxx")  
.set("es.net.http.auth.pass","xxx")  
.set("es.nodes.wan.only","false")  
/\>  
Getting below Error

//  
Exception in thread "main" 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'

at org.elasticsearch.hadoop.rest.InitializationUtils.discoverEsVersion(InitializationUtils.java:327)

at org.elasticsearch.spark.sql.EsSparkSQL$.saveToEs(EsSparkSQL.scala:97)

at org.elasticsearch.spark.sql.EsSparkSQL$.saveToEs(EsSparkSQL.scala:80)

at org.elasticsearch.spark.sql.package$SparkDataFrameFunctions.saveToEs(package.scala:48)

at com.spark.tmmt.loadtoes$.main(loadtoes.scala:37)

at com.spark.tmmt.loadtoes.main(loadtoes.scala)

Caused by: org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[34.253.152.23:9243]]

at org.elasticsearch.hadoop.rest.NetworkClient.execute(NetworkClient.java:152)

at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:398)

at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:362)

at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:366)

at org.elasticsearch.hadoop.rest.RestClient.get(RestClient.java:161)

at org.elasticsearch.hadoop.rest.RestClient.remoteEsVersion(RestClient.java:593)

at org.elasticsearch.hadoop.rest.InitializationUtils.discoverEsVersion(InitializationUtils.java:320)

... 5 more

---

<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:** [November 21, 2018, 11:55am UTC](https://discuss.elastic.co/t/spark-elasticcloud-connection-issue/153789/2 "2018-11-21T11:55:15Z")

</div>

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