首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >处理大数据集时的FetchFailedException或MetadataFetchFailedException

处理大数据集时的FetchFailedException或MetadataFetchFailedException
EN

Stack Overflow用户
提问于 2016-01-22 07:39:22
回答 5查看 66.1K关注 0票数 51

当我使用1GB数据集运行解析代码时,它就完成了,没有任何错误。但是,当我一次尝试25 gb的数据时,我会得到以下错误。我正在努力理解如何避免失败。很高兴听到任何建议或想法。

不同的错误,

代码语言:javascript
运行
复制
org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle 0

org.apache.spark.shuffle.FetchFailedException: Failed to connect to ip-xxxxxxxx

org.apache.spark.shuffle.FetchFailedException: Error in opening FileSegmentManagedBuffer{file=/mnt/yarn/nm/usercache/xxxx/appcache/application_1450751731124_8446/blockmgr-8a7b17b8-f4c3-45e7-aea8-8b0a7481be55/08/shuffle_0_224_0.data, offset=12329181, length=2104094}

集群详细信息:

纱线:8节 核心总数: 64 内存: 500 GB 火花版本: 1.5

星火提交声明:

代码语言:javascript
运行
复制
spark-submit --master yarn-cluster \
                        --conf spark.dynamicAllocation.enabled=true \
                        --conf spark.shuffle.service.enabled=true \
                        --executor-memory 4g \
                        --driver-memory 16g \
                        --num-executors 50 \
                        --deploy-mode cluster \
                        --executor-cores 1 \
                        --class my.parser \
                        myparser.jar \
                        -input xxx \
                        -output xxxx \

堆栈跟踪之一:

代码语言:javascript
运行
复制
at org.apache.spark.MapOutputTracker$$anonfun$org$apache$spark$MapOutputTracker$$convertMapStatuses$2.apply(MapOutputTracker.scala:460)
at org.apache.spark.MapOutputTracker$$anonfun$org$apache$spark$MapOutputTracker$$convertMapStatuses$2.apply(MapOutputTracker.scala:456)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
at org.apache.spark.MapOutputTracker$.org$apache$spark$MapOutputTracker$$convertMapStatuses(MapOutputTracker.scala:456)
at org.apache.spark.MapOutputTracker.getMapSizesByExecutorId(MapOutputTracker.scala:183)
at org.apache.spark.shuffle.hash.HashShuffleReader.read(HashShuffleReader.scala:47)
at org.apache.spark.rdd.ShuffledRDD.compute(ShuffledRDD.scala:90)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:297)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:264)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:297)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:264)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
at org.apache.spark.scheduler.Task.run(Task.scala:88)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2016-01-22 08:43:16

此错误几乎肯定是由您的执行器上的内存问题引起的。我可以想出几种方法来解决这类问题。

1)您可以尝试使用更多的分区运行(在您的repartition上执行dataframe)。当一个或多个分区包含比内存中更多的数据时,通常会出现内存问题。

2)我注意到您没有显式地设置spark.yarn.executor.memoryOverhead,因此它将默认为max(386, 0.10* executorMemory),在您的情况下它将是400 to。对我来说听起来很低。我会尝试将其增加到1GB (请注意,如果将memoryOverhead增加到1GB,则需要将--executor-memory降低到3GB)。

3)查看失败节点上的日志文件。你想找文字“杀人容器”。如果您看到文本“超出物理内存限制”,增加memoryOverhead将-在我的经验-解决问题。

票数 107
EN

Stack Overflow用户

发布于 2018-04-11 17:40:27

除了上面描述的内存和网络配置问题之外,值得注意的是,对于大型表(例如,这里的几个TB ),由于超时检索洗牌分区,可能会出现org.apache.spark.shuffle.FetchFailedException。要解决此问题,可以设置以下内容:

代码语言:javascript
运行
复制
SET spark.reducer.maxReqsInFlight=1;  -- Only pull one file at a time to use full network bandwidth.
SET spark.shuffle.io.retryWait=60s;  -- Increase the time to wait while retrieving shuffle partitions before retrying. Longer times are necessary for larger files.
SET spark.shuffle.io.maxRetries=10;
票数 18
EN

Stack Overflow用户

发布于 2017-02-22 03:37:04

我还通过将Spark spark.network.timeout增加到一个更大的值,比如800,获得了一些好的结果。默认的120秒将导致大量执行程序在重载时超时。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34941410

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档