Spark 작업이 org.apache.spark.shuffle.MetadataFetchFailedException으로 실패하는 이유 : 추측 모드에서 셔플 0의 출력 위치가 누락 되었습니까?
추측 모드에서 Spark 작업을 실행하고 있습니다. 약 500 개의 작업과 약 500 개의 1GB gz 파일이 압축되어 있습니다. 1 ~ 2 개의 작업에 대해 계속해서 각 작업에 들어갑니다. 첨부 된 오류는 나중에 수십 번 다시 실행됩니다 (작업 완료 방지).
org.apache.spark.shuffle.MetadataFetchFailedException : 셔플 0에 대한 출력 위치 누락
문제의 의미가 무엇이며 어떻게 극복해야하는지 아십니까?
org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle 0
at org.apache.spark.MapOutputTracker$$anonfun$org$apache$spark$MapOutputTracker$$convertMapStatuses$1.apply(MapOutputTracker.scala:384)
at org.apache.spark.MapOutputTracker$$anonfun$org$apache$spark$MapOutputTracker$$convertMapStatuses$1.apply(MapOutputTracker.scala:381)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:108)
at org.apache.spark.MapOutputTracker$.org$apache$spark$MapOutputTracker$$convertMapStatuses(MapOutputTracker.scala:380)
at org.apache.spark.MapOutputTracker.getServerStatuses(MapOutputTracker.scala:176)
at org.apache.spark.shuffle.hash.BlockStoreShuffleFetcher$.fetch(BlockStoreShuffleFetcher.scala:42)
at org.apache.spark.shuffle.hash.HashShuffleReader.read(HashShuffleReader.scala:40)
at org.apache.spark.rdd.ShuffledRDD.compute(ShuffledRDD.scala:92)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:263)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:230)
at org.apache.spark.rdd.MappedRDD.compute(MappedRDD.scala:31)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:263)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:230)
at org.apache.spark.rdd.FlatMappedRDD.compute(FlatMappedRDD.scala:33)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:263)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:230)
at org.apache.spark.rdd.MappedRDD.compute(MappedRDD.scala:31)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:263)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:230)
at org.apache.spark.rdd.MappedRDD.compute(MappedRDD.scala:31)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:263)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:230)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61)
at org.apache.spark.scheduler.Task.run(Task.scala:56)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:196)
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:722)
이것은 작업자 노드에있는 것보다 더 많은 메모리를 부여했을 때 발생했습니다. 스왑이 없었기 때문에 더 이상 메모리가 남아 있지 않은 상태에서 셔플을 위해 개체를 저장하려고 시도하는 동안 Spark가 충돌했습니다.
해결책은 스왑을 추가하거나 작업자 / 실행기를 구성하여 메모리를 더 적게 사용하도록 구성하고 여러 지속성에 대해 MEMORY_AND_DISK 저장소 수준을 사용하는 것입니다.
Spark에서도 비슷한 오류가 발생했지만 문제와 관련된 것인지 잘 모르겠습니다.
우리는 JavaPairRDD.repartitionAndSortWithinPartitions
100GB 데이터를 사용 했으며 앱과 유사하게 계속 실패했습니다. 그런 다음 특정 노드의 Yarn 로그를 살펴보고 일종의 메모리 부족 문제가 있음을 발견하여 Yarn이 실행을 중단했습니다. 우리의 솔루션은 변경 / 추가이었다 spark.shuffle.memoryFraction 0
에서 .../spark/conf/spark-defaults.conf
. 이를 통해 훨씬 더 많은 (그러나 불행히도 무한하지 않은) 양의 데이터를 이러한 방식으로 처리 할 수있었습니다.
3 컴퓨터 YARN 클러스터에서 동일한 문제가 발생했습니다. RAM을 계속 변경했지만 문제는 계속되었습니다. 마지막으로 로그에서 다음 메시지를 확인했습니다.
17/02/20 13:11:02 WARN spark.HeartbeatReceiver: Removing executor 2 with no recent heartbeats: 1006275 ms exceeds timeout 1000000 ms
17/02/20 13:11:02 ERROR cluster.YarnScheduler: Lost executor 2 on 1worker.com: Executor heartbeat timed out after 1006275 ms
그 후 다음과 같은 메시지가있었습니다.
org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle 67
I modified the properties in spark-defaults.conf as follows:
spark.yarn.scheduler.heartbeat.interval-ms 7200000
spark.executor.heartbeatInterval 7200000
spark.network.timeout 7200000
That's it! My job completed successfully after this.
For me, I was doing some windowing on large data (about 50B rows) and getting a boat load of
ExternalAppendOnlyUnsafeRowArray:54
- Reached spill threshold of 4096 rows, switching toorg.apache.spark.util.collection.unsafe.sort.UnsafeExternalSorter
In my logs. Obviously 4096 can be small on such data size... this led me to the following JIRA:
https://issues.apache.org/jira/browse/SPARK-21595
And ultimately to the following two config options:
spark.sql.windowExec.buffer.spill.threshold
spark.sql.windowExec.buffer.in.memory.threshold
Both default to 4096; I raised them much higher (2097152) and things now seem to do well. I'm not 100% sure this is the same as the issue raised here, but it's another thing to try.
I solved this error increasing the allocated memory in executorMemory and driverMemory. You can do this in HUE selecting the Spark Program which is causing the problem and in properties -> Option list you can add something like this:
--driver-memory 10G --executor-memory 10G --num-executors 50 --executor-cores 2
Of course the values of the parameters will vary depending on you cluster's size and your needs.
In my case (standalone cluster) the exception was thrown because the file system of some Spark slaves was filled 100%. Deleting everything in the spark/work
folders of the slaves solved the issue.
I got the same problem, but I searched many answers which can not solve my problem. eventually, I debug my code step by step. I find the problem that caused by the data size is not balanced for each partition , leaded to MetadataFetchFailedException
that in map
stage not reduce
stage . just do df_rdd.repartition(nums)
before reduceByKey()
'Nice programing' 카테고리의 다른 글
iOS Private API 문서 (0) | 2020.10.27 |
---|---|
템플릿 매개 변수 팩을 확장하지 않고 "저장"할 수 있습니까? (0) | 2020.10.27 |
Phonegap으로 Android 서비스를 만드시나요? (0) | 2020.10.27 |
Visual Studio 코드 분석 대 StyleCop + FxCop (0) | 2020.10.27 |
문서 디렉토리에 이미지 저장 및 이메일 첨부 파일 검색 (0) | 2020.10.27 |