# Spark cannot connect to Elastic Cloud with Shield enabled

**URL:** <https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [March 11, 2016, 2:55am UTC](https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103 "2016-03-11T02:55:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pham\_Khanh](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@Pham\_Khanh](https://discuss.elastic.co/u/Pham_Khanh)\
**Post date:** [March 11, 2016, 2:55am UTC](https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103/1 "2016-03-11T02:55:58Z")

</div>

Hi all,  
I tried to connect my Spark code with Elastic Cloud without success. Following this post [https://www.elastic.co/guide/en/cloud/current/shield.html](https://www.elastic.co/guide/en/cloud/current/shield.html), I have a configuration as follow:  
es.http.timeout=5m  
es.index.auto.create=true  
es.net.http.auth.pass= mypass  
es.net.http.auth.user= myuser  
es.net.ssl=true  
es.net.ssl.cert.allow.self.signed=true  
es.net.ssl.protocol=true  
es.nodes=46\*\*\*\*.us-east-1.aws.found.io  
es.nodes.wan.only=true  
es.port=9343  
es.scroll.size=50

- Im using Spark 1.6.0, trial version of Elastic Cloud - Elasticsearch 2.2.0, es-hadoop connector elasticsearch-spark\_2.10-2.2.0-rc1 =\> with this setup I can connect to AWS Elasticsearch cluster ( without authentication).
- Here is the error with above configuration:  
org.elasticsearch.hadoop.EsHadoopIllegalStateException: Cannot instantiate SSL
- Here is the error without SSL enable:  
org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[23.23.98.74:9343]]
- I have tried with different port: 9200, 9243, 9343, 80, 443 with and without SSL enable but cannot connect. Could you please point out the configuration to connect from Spark to Elastic Cloud with Shield. Any help is appreciate !!

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [March 12, 2016, 2:22pm UTC](https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103/2 "2016-03-12T14:22:39Z")

</div>

> [@Pham\_Khanh](#):
>
> es.net.ssl.protocol=true

Where do folks come up with this setting? It's the second time this month and I have no idea where folks copy this incorrect configuration; in case the name is not clear enough, the docs clearly [state](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html#_ssl):

> SSL protocol to be used

"true" is not a valid protocol - anything wrong with the default "TLS"?

Instead of overriding the defaults (`es.scroll.size` or the timeout), reading the docs and only configuring the nodes and _maybe_ the port is a much better time investment,.

---

<div class="post-metadata">

**Author:** ![Pham\_Khanh](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@Pham\_Khanh](https://discuss.elastic.co/u/Pham_Khanh)\
**Post date:** [March 14, 2016, 7:30am UTC](https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103/3 "2016-03-14T07:30:12Z")

</div>

Thanks a lot for your help, Costin ! I have kept the es.net.ssl.protocol as default and tried with different port configurations : 9200, 9243, 9343, 443, 80 with no success. I have read through :[Apache Hadoop with Shield](https://www.elastic.co/guide/en/shield/current/hadoop.html) , [es-hadoop configuration](https://www.elastic.co/guide/en/elasticsearch/hadoop/master/configuration.html) and [es-hadoop security](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/security.html) but still cannot figure out what should be the right configuration 😕 . Tried to find in the documentation of Elastic Cloud as well but the closest configuration available is :[Java Transport Client](https://www.elastic.co/guide/en/cloud/current/shield.html#shield-transport) . Do u have any experience connecting es-hadoop with Elastic Cloud ( Found) or any configuration could be derive similarly to the Java Transport Client ?

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [March 21, 2016, 9:21am UTC](https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103/4 "2016-03-21T09:21:13Z")

</div>

What is the error that you are getting? And what is your ES-Cloud configuration?  
If you need help with the cloud setup, I recommend the dedicated forum [here](https://discuss.elastic.co/c/cloud).

---

<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:24pm UTC](https://discuss.elastic.co/t/spark-cannot-connect-to-elastic-cloud-with-shield-enabled/44103/6 "2017-07-06T13:24:12Z")

</div>


