# Unable to write to remote Elasticsearch node with ES Spark

**URL:** <https://discuss.elastic.co/t/unable-to-write-to-remote-elasticsearch-node-with-es-spark/48871>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [April 30, 2016, 6:10pm UTC](https://discuss.elastic.co/t/unable-to-write-to-remote-elasticsearch-node-with-es-spark/48871 "2016-04-30T18:10:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olalekan\_Elesin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olalekan_elesin/32/827_2.png) [@Olalekan\_Elesin](https://discuss.elastic.co/u/Olalekan_Elesin)\
**Post date:** [April 30, 2016, 6:10pm UTC](https://discuss.elastic.co/t/unable-to-write-to-remote-elasticsearch-node-with-es-spark/48871/1 "2016-04-30T18:10:59Z")

</div>

I tried writing to my local version es and it works fine, but when connecting to a remote host, no document is written to the index. Although the index was automatically created.

What could be wrong?  
`EsSpark.saveToEs(userTweetRDD, "twitter/test", Map("es.nodes" -> "xx.xx.xx.xxx", "es.cluster.name" -> xxxx-xxxxx"))`

Can anyone tell me what I am doing wrong?

Thanks in advance...

---

<div class="post-metadata">

**Author:** ![Olalekan\_Elesin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olalekan_elesin/32/827_2.png) [@Olalekan\_Elesin](https://discuss.elastic.co/u/Olalekan_Elesin)\
**Post date:** [May 7, 2016, 5:57am UTC](https://discuss.elastic.co/t/unable-to-write-to-remote-elasticsearch-node-with-es-spark/48871/2 "2016-05-07T05:57:49Z")

</div>

Was able to solve by setting this:  
`"es.nodes.discovery" -> "false"` Hope this helps someone

---

<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/unable-to-write-to-remote-elasticsearch-node-with-es-spark/48871/3 "2017-07-06T13:24:48Z")

</div>


