问题描述:

  使用ES 2.3.1和Spark streaming 2.1时,出现以上报错信息。

原因:

addOnCompleteCallback方法在spark2.0中移除了

The addOnCompleteCallback method was removed from the TaskContext in Spark 2.0. Spark 2.0 is not binary compatible with previous releases. Because of this we only support Spark 2.0 in es-hadoop version 5.0 and later. Please upgrade to fix the issue.

解决方法:

  

<dependency>
      <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch-spark_2.11</artifactId>
        <version>2.4.4</version>
 </dependency>

替换为
 <dependency> 
          <groupId>org.elasticsearch</groupId> 
          <artifactId>elasticsearch-hadoop</artifactId> 
          <version>5.1.2</version> 
</dependency> 

 参考:https://github.com/elastic/elasticsearch-hadoop/issues/905

相关文章:

  • 2021-08-05
  • 2021-09-19
  • 2021-12-12
  • 2021-08-16
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2021-10-18
  • 2021-07-11
  • 2021-04-17
  • 2022-01-10
  • 2022-01-17
  • 2022-01-22
相关资源
相似解决方案