# Spark.es.nodes config setting in Spark not getting picked up

**URL:** <https://discuss.elastic.co/t/spark-es-nodes-config-setting-in-spark-not-getting-picked-up/54191>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [June 28, 2016, 6:27pm UTC](https://discuss.elastic.co/t/spark-es-nodes-config-setting-in-spark-not-getting-picked-up/54191 "2016-06-28T18:27:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Kincaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_kincaid/32/2181_2.png) [@David\_Kincaid](https://discuss.elastic.co/u/David_Kincaid)\
**Post date:** [June 28, 2016, 6:27pm UTC](https://discuss.elastic.co/t/spark-es-nodes-config-setting-in-spark-not-getting-picked-up/54191/1 "2016-06-28T18:27:21Z")

</div>

Using Spark 1.6 with pyspark and TargetHolding/pyspark-elastic 0.4.2 and can't figure out how to tell it which ES node to use. The docs for pyspark-elastic say to set `--conf spark.es.nodes=<nodes>` but for some reason it's still using localhost. Here is my command line for launching pyspark:

```auto
/usr/bin/pyspark --packages TargetHolding/pyspark-elastic:0.4.2 --conf spark.es.nodes="172.22.6.41" --conf spark.es.nodes.discovery=false --master yarn-client

```

Here is the error I'm getting the logs. As you can see it's trying to connect to `localhost:9200`

```auto
16/06/28 18:19:53 WARN TaskSetManager: Lost task 77.0 in stage 3.0 (TID 85, ip-172-22-2-229.vet2pet.idexxi.com): org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[localhost:9200]] 
	at org.elasticsearch.hadoop.rest.NetworkClient.execute(NetworkClient.java:142)
	at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:383)
	at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:363)
	at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:367)
	at org.elasticsearch.hadoop.rest.RestClient.get(RestClient.java:121)
	at org.elasticsearch.hadoop.rest.RestClient.esVersion(RestClient.java:513)
	at org.elasticsearch.hadoop.rest.InitializationUtils.discoverEsVersion(InitializationUtils.java:177)
	at org.elasticsearch.hadoop.rest.RestService.createWriter(RestService.java:378)
	at org.elasticsearch.spark.rdd.EsRDDWriter.write(EsRDDWriter.scala:40)
	at org.elasticsearch.spark.rdd.EsSpark$$anonfun$saveToEs$1.apply(EsSpark.scala:67)
	at org.elasticsearch.spark.rdd.EsSpark$$anonfun$saveToEs$1.apply(EsSpark.scala:67)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
	at org.apache.spark.scheduler.Task.run(Task.scala:89)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

```

---

<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:** [June 30, 2016, 7:23pm UTC](https://discuss.elastic.co/t/spark-es-nodes-config-setting-in-spark-not-getting-picked-up/54191/2 "2016-06-30T19:23:45Z")

</div>

You mentioned this is for the [TargetHolding/pyspark-elastic](https://github.com/TargetHolding/pyspark-elastic) which isn't really affiliated with es-hadoop proper. It also seems that you've already opened an [issue with the project](https://github.com/TargetHolding/pyspark-elastic/issues/14#issue-162763887) (Just linking it for completeness). I noticed that it's a fairly young project, but good luck with tracking down a resolution!

---

<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-es-nodes-config-setting-in-spark-not-getting-picked-up/54191/3 "2017-07-06T13:24:07Z")

</div>


