当我使用1GB数据集运行解析代码时,它就完成了,没有任何错误。但是,当我一次尝试25 gb的数据时,我会得到以下错误。我正在努力理解如何避免失败。很高兴听到任何建议或想法。
不同的错误,
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
星火提交声明:
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 \
堆栈跟踪之一:
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)
发布于 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将-在我的经验-解决问题。
发布于 2018-04-11 17:40:27
除了上面描述的内存和网络配置问题之外,值得注意的是,对于大型表(例如,这里的几个TB ),由于超时检索洗牌分区,可能会出现org.apache.spark.shuffle.FetchFailedException。要解决此问题,可以设置以下内容:
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;
发布于 2017-02-22 03:37:04
我还通过将Spark spark.network.timeout
增加到一个更大的值,比如800,获得了一些好的结果。默认的120秒将导致大量执行程序在重载时超时。
https://stackoverflow.com/questions/34941410
复制相似问题