首页 > 解决方案 > 与 Spark num executor、executor core 和 executor memory 相关的问题

问题描述

集群矩阵详细信息 - 节点 = 1,vcores = 8,内存 = 25 GB

调度程序矩阵- 最小分配 = 内存 1024, vCores:1 ;最大分配 = 内存 3072,vCores:2

在 spark-defaults.conf 文件中 spark.dynamicAllocation.enabled=true

我尝试了命令:

pyspark --master yarn --num-executors 2 --executor-cores 4 --executor-memory 3G

我对 Spark 很陌生。所以,我只是想了解如何分配内存和任务。我在cloudera集群中试过了。但我收到如下错误:

Required execution memory (3072), overhead (384), and PySpark memory (0 MB) is above the max threshold 
(3072 MB) of the cluster! Please check the values of 'yarn.scheduler.maximum-allocation-mb' and/or
'yarn.nodemanager.memory-mb'.

当我尝试使用以下命令时,它正在工作:

pyspark --master yarn --num-executors 2 --executor-cores 2 --executor-memory 1G
pyspark --master yarn --num-executors 2 --executor-cores 2 --executor-memory 2G

我尝试了以下命令:

pyspark --master yarn --num-executors 2 --executor-cores 2 --executor-memory 3G 

它也不起作用。

那么,这是我无法跨越调度程序的最大分配(内存3072,在这种情况下为vCores:2)的原因吗?谁能解释一下。

标签: apache-sparkhadoop-yarn

解决方案


推荐阅读