# Connecting Spark to ES

**URL:** <https://discuss.elastic.co/t/connecting-spark-to-es/73767>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [February 2, 2017, 10:32pm UTC](https://discuss.elastic.co/t/connecting-spark-to-es/73767 "2017-02-02T22:32:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yurik](https://avatars.discourse-cdn.com/v4/letter/y/54ee81/32.png) [@yurik](https://discuss.elastic.co/u/yurik)\
**Post date:** [February 2, 2017, 10:32pm UTC](https://discuss.elastic.co/t/connecting-spark-to-es/73767/1 "2017-02-02T22:32:56Z")

</div>

I am getting the following exception while attempting to read from ES (elasticsearch-5.2.0) into Spark (spark-2.1.0-bin-hadoop2.7) on the local host using ES-to-Hadoop (elasticsearch-hadoop-5.1.2.jar):  
"Cannot find node with id". The single ES master/data node is up (see below). What might cause the problem?

curl -XGET localhost:9200/\_nodes/http  
{"\_nodes":{"total":1,"successful":1,"failed":0},"cluster\_name":"elasticsearch","nodes":{"ltPIKS-wS7CJOxd\_owuUpA":{"name":"ltPIKS-","transport\_address":"127.0.0.1:9300","host":"127.0.0.1","ip":"127.0.0.1","version":"5.2.0","build\_hash":"24e05b9","roles":["master","data","ingest"],"http":{"bound\_address":["[::1]:9200","127.0.0.1:9200"],"publish\_address":"127.0.0.1:9200","max\_content\_length\_in\_bytes":104857600}}}}

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [February 14, 2017, 8:17pm UTC](https://discuss.elastic.co/t/connecting-spark-to-es/73767/2 "2017-02-14T20:17:03Z")

</div>

@yurik Could you please post the full stack trace as well as any logs from the run, and your configuration settings?

---

<div class="post-metadata">

**Author:** ![yurik](https://avatars.discourse-cdn.com/v4/letter/y/54ee81/32.png) [@yurik](https://discuss.elastic.co/u/yurik)\
**Post date:** [February 25, 2017, 7:12pm UTC](https://discuss.elastic.co/t/connecting-spark-to-es/73767/3 "2017-02-25T19:12:16Z")

</div>

The following solves the problem:  
./spark-shell --jars /elasticsearch-hadoop-5.2.0.jar --conf spark.es.nodes="localhost"

---

<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:** [March 25, 2017, 7:12pm UTC](https://discuss.elastic.co/t/connecting-spark-to-es/73767/4 "2017-03-25T19:12:35Z")

</div>

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