【发布时间】:2018-02-06 03:27:52
【问题描述】:
在 yarn 上使用 spark 时,spark executor 和 yarn 容器有什么关系?
比如我设置executor-memory = 20G,yarn container memory = 10G,1个executor包含2个container吗?
【问题讨论】:
在 yarn 上使用 spark 时,spark executor 和 yarn 容器有什么关系?
比如我设置executor-memory = 20G,yarn container memory = 10G,1个executor包含2个container吗?
【问题讨论】:
Spark Executor 在纱线容器中运行。纱线容器由资源管理器按需提供。一个 Yarn 容器可以有 1 个或多个 Spark Executor。 Spark-Executors 是运行任务的那个。 Spark Executor 将在 Worker Node(DataNode) 上启动
当你设置 executor-memory = 20G -> 这意味着你要求一个大小为 20GB 的容器,你的 Executors 将在其中运行。现在您可能有 1 个或多个 Executors 使用这 20GB 的内存并且这是每个 Worker 节点。
例如,如果您有一个包含 8 个节点的集群,那么您的作业将有 8 * 20 GB 的总内存。
以下是 yarn-site.xml 中可用的 3 个配置选项,您可以使用它们来查看差异。
yarn.scheduler.minimum-allocation-mb
yarn.scheduler.maximum-allocation-mb
yarn.nodemanager.resource.memory-mb
【讨论】:
在 YARN 上运行 Spark 时,每个 Spark 执行器都作为一个 YARN 容器运行,这意味着容器的数量将始终与 Spark 应用程序创建的执行器数量相同,例如通过 spark-submit 中的 --num-executors 参数。
【讨论】:
在 YARN 模式下,每个 executor 在一个容器中运行。 executor 的数量与 YARN 分配的容器数量相同(集群模式除外,它将分配另一个容器来运行驱动程序)。
【讨论】:
Required executor memory (XXX MB) is above the max threshold (YYY MB) of this cluster! Please check the values of 'yarn.scheduler.maximum-allocation-mb' and/or 'yarn.nodemanager.resource.memory-mb'的错误