# No route to ElasticSearch from Spark in Standalone mode

**URL:** <https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [April 30, 2017, 6:53pm UTC](https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116 "2017-04-30T18:53:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtrivolli](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mtrivolli](https://discuss.elastic.co/u/mtrivolli)\
**Post date:** [April 30, 2017, 6:53pm UTC](https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116/1 "2017-04-30T18:53:37Z")

</div>

I'm working on some simple tests with Spark (standalone mode) and ElasticSearch. All my tests work fine as long as ElasticSearch is running in the same host as Spark. If I move ElasticSearch to a different node, then I get an exception "org.elasticsearch.hadoop.rest.EsHadoopTransportException: java.net.NoRouteToHostException: ..."

I have discarded any network / firewall issues, since I'm able to connect using kibana to the remote ElasticSearch node.

The test is as simple as this:

```auto
val spark = SparkSession.builder.master("local").appName("testing")
   .config("es.nodes", "remotenode")
   .getOrCreate()

spark.sparkContext.esRDD("radio/artists")
Console.out.println(RDD.count())

```

I'm using Spark 2.11 with elasticSearch-spark-20\_2.11-5.3.2.

Any help?... I don't know what else to try!

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [May 1, 2017, 10:12pm UTC](https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116/2 "2017-05-01T22:12:59Z")

</div>

On your remote ES node run the following:

nslookup remotenode

nslookup ON\_IP\_FROM\_ABOVE

what is the output?

---

<div class="post-metadata">

**Author:** ![mtrivolli](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mtrivolli](https://discuss.elastic.co/u/mtrivolli)\
**Post date:** [May 2, 2017, 8:03am UTC](https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116/3 "2017-05-02T08:03:03Z")

</div>

nslookup:  
Server: 80.58.61.250  
Address: 80.58.61.250#53

\*\* server can't find remotenode: NXDOMAIN```

nslookup:  
Non-authoritative answer:  
250.61.58.80.in-addr.arpa name = [250.red-80-58-61.staticip.rima-tde.net](http://250.red-80-58-61.staticip.rima-tde.net).

Authoritative answers can be found from:  
61.58.80.in-addr.arpa nameserver = [rsdmno1-14.rima-tde.net](http://rsdmno1-14.rima-tde.net).  
61.58.80.in-addr.arpa nameserver = [rsdbgi1-11.rima-tde.net](http://rsdbgi1-11.rima-tde.net).

I don't have a DNS configured for my test network... Shall I?

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [May 2, 2017, 3:45pm UTC](https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116/4 "2017-05-02T15:45:38Z")

</div>

Yes, you should configure DNS if you plan to use hostnames as the problem is it can not resolve what is "es.nodes" = "remotenode" . The alternative is you can always use the IP address , e.g. "es.nodes" = "192.68.1.101:9200"

---

<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:** [May 30, 2017, 3:53pm UTC](https://discuss.elastic.co/t/no-route-to-elasticsearch-from-spark-in-standalone-mode/84116/5 "2017-05-30T15:53:11Z")

</div>

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