# Using elasticsearch-spark to write data to elasticsearch throws exception

**URL:** <https://discuss.elastic.co/t/using-elasticsearch-spark-to-write-data-to-elasticsearch-throws-exception/113600>\
**Category:** Elasticsearch\
**Created:** [December 29, 2017, 3:22pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-to-write-data-to-elasticsearch-throws-exception/113600 "2017-12-29T15:22:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanbj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanbj/32/24677_2.png) [@hanbj](https://discuss.elastic.co/u/hanbj)\
**Post date:** [December 29, 2017, 3:22pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-to-write-data-to-elasticsearch-throws-exception/113600/1 "2017-12-29T15:22:18Z")

</div>

Hi, all.  
Using elasticsearch-spark to write data to elasticsearch throws exception: There are 8 nodes in my cluster. Through monitoring, we see that the pressure of the cluster is not large and the machine load is good.

The exception information is as follows:

Job aborted due to stage failure: Task 7 in stage 0.0 failed 4 times, most recent failure: Lost task 7.3 in stage 0.0 (TID 32, [slave777-prd3.sss.com](http://slave777-prd3.sss.com), executor 10): org.apache.spark.util.TaskCompletionListenerException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[10.247.24.51:9100, 10.101.10.131:9100, 10.247.24.52:9100, 10.101.10.130:9100, 10.247.24.55:9100, 10.247.24.54:9100, 10.101.10.132:9100, 10.247.24.53:9100]] +details  
Job aborted due to stage failure: Task 7 in stage 0.0 failed 4 times, most recent failure: Lost task 7.3 in stage 0.0 (TID 32, [slave777-prd3.sss.com](http://slave777-prd3.sss.com), executor 10): org.apache.spark.util.TaskCompletionListenerException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[10.0.2.51:9100, 10.0.10.13:9100, 10.0.2.3:9100, 10.1.10.130:9100]]  
at org.apache.spark.TaskContextImpl.markTaskCompleted(TaskContextImpl.scala:105)  
at org.apache.spark.scheduler.Task.run(Task.scala:112)  
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)  
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)

Driver stacktrace:

---

<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:** [January 26, 2018, 3:23pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-to-write-data-to-elasticsearch-throws-exception/113600/2 "2018-01-26T15:23:09Z")

</div>

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