Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Memory management org.apache.spark.shuffle.MetadataFetchFailedException的可能原因是什么:缺少shuffle的输出位置?_Memory Management_Apache Spark - Fatal编程技术网

Memory management org.apache.spark.shuffle.MetadataFetchFailedException的可能原因是什么:缺少shuffle的输出位置?

Memory management org.apache.spark.shuffle.MetadataFetchFailedException的可能原因是什么:缺少shuffle的输出位置?,memory-management,apache-spark,Memory Management,Apache Spark,我在EC2集群上部署了一个Spark数据处理作业,该作业对于集群来说很小(16个内核,总共120G RAM),最大的RDD只有76k+行。但是在中间严重倾斜(因此需要重新分区),并且每一行在序列化之后都有大约100K的数据。这项工作总是陷入重新划分的困境。也就是说,作业将不断出现以下错误和重试: org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle org.ap

我在EC2集群上部署了一个Spark数据处理作业,该作业对于集群来说很小(16个内核,总共120G RAM),最大的RDD只有76k+行。但是在中间严重倾斜(因此需要重新分区),并且每一行在序列化之后都有大约100K的数据。这项工作总是陷入重新划分的困境。也就是说,作业将不断出现以下错误和重试:

org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle

org.apache.spark.shuffle.FetchFailedException: Error in opening FileSegmentManagedBuffer

org.apache.spark.shuffle.FetchFailedException: java.io.FileNotFoundException: /tmp/spark-...
我试图找出问题所在,但抛出这些错误的机器的内存和磁盘消耗似乎都低于50%。我还尝试了不同的配置,包括:

let driver/executor memory use 60% of total memory.
let netty to priortize JVM shuffling buffer.
increase shuffling streaming buffer to 128m.
use KryoSerializer and max out all buffers
increase shuffling memoryFraction to 0.4
但它们都不起作用。小作业总是触发相同的一系列错误和最大重试次数(最多1000次)。在这种情况下,如何排除故障


如果您有任何线索,非常感谢。

如果您遇到类似的错误,请查看您的日志

ERROR 2015-05-12 17:29:16,984 Logging.scala:75 - Lost executor 13 on node-xzy: remote Akka client disassociated
每次你出现这个错误都是因为你失去了一个执行者。至于你为什么失去一名遗嘱执行人,那是另一个故事,再次检查你的日志以寻找线索

有一件事可能会扼杀你的工作,如果它认为你使用了“太多的内存”

检查以下内容:

org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl  - Container [<edited>] is running beyond physical memory limits. Current usage: 18.0 GB of 18 GB physical memory used; 19.4 GB of 37.8 GB virtual memory used. Killing container.
org.apache.hadoop.warn.server.nodemanager.containermanager.monitor.ContainerMonitorImpl-Container[]的运行超出了物理内存限制。当前使用:使用18.0 GB的18 GB物理内存;使用了19.4 GB的37.8 GB虚拟内存。杀人容器。
另见:

目前的技术水平正在不断提高 spark.Thread.executor.memoryOverhead,直到作业停止失败。我们有 计划尝试根据内存量自动调整大小 请求,但它仍然只是一个启发


我也犯了一个错误

org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle
在我找到的日志中进一步查找

Container killed on request. Exit code is 143

在搜索退出代码后,我意识到这主要与内存分配有关。所以我检查了为执行器配置的内存量。我发现我错误地将7g配置为driver,而将1g配置为executor。在增加executor的内存后,我的spark作业成功运行。

非常感谢!我的问题是,我只是在使用Spark单机版master。执行器丢失确实是大型洗牌的一个问题,因为每次写入非持久性存储都需要很长时间,一旦丢失就必须重新开始。我正在调查频繁的检查点是否可以解决这个问题。你对此有什么见解吗?我已经通过GC手动重写了我的工作流一些持久化RDD,并用checkpoint()替换其他persist(),以释放更多的内存和空间。它暂时消失了。但考虑到出错时内存/磁盘消耗的情况,它本来就不应该发生。我将在再次遇到此问题时更新