且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何修复"org.apache.spark.shuffle.FetchFailedException:连接失败"在NetworkWordCount Spark Streaming应用程序中?

更新时间:2023-11-18 14:53:52

解决方案是将 StorageLevel.MEMORY_ONLY_SER 添加到 socketTextStream 方法中,更改 spark-defaults.conf (如下所示)并增加 yarn-site.xml 文件中的硬件资源.

The solution was to add StorageLevel.MEMORY_ONLY_SER to socketTextStream method, change spark-defaults.conf (as below) and increase hardware resources in yarn-site.xml file.

spark-defaults.conf

spark.core.connection.ack.wait.timeout 600s
spark.default.parallelism 4
spark.driver.memory 6g
spark.executor.memory 10g
spark.cores.max 4
spark.executor.cores 2