无论我如何修改设置yarn-site.xml
即使用以下所有选项
yarn.scheduler.minimum-allocation-vcores
yarn.nodemanager.resource.memory-mb
yarn.nodemanager.resource.cpu-vcores
yarn.scheduler.maximum-allocation-mb
yarn.scheduler.maximum-allocation-vcores
我仍然无法让我的应用程序(即 Spark)利用集群上的所有核心。 Spark 执行器似乎正确地占用了所有可用内存,但每个执行器只占用一个核心,不再占用更多内存。
以下是配置的选项spark-defaults.conf
spark.executor.cores 3
spark.executor.memory 5100m
spark.yarn.executor.memoryOverhead 800
spark.driver.memory 2g
spark.yarn.driver.memoryOverhead 400
spark.executor.instances 28
spark.reducer.maxMbInFlight 120
spark.shuffle.file.buffer.kb 200
请注意spark.executor.cores
设置为3,但是不起作用。
我该如何解决?
问题不在于yarn-site.xml
or spark-defaults.conf
但实际上使用资源计算器将核心分配给执行器,或者在 MapReduce 作业的情况下,分配给 Mappers/Reducer。
默认资源计算器,即org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator
仅使用内存信息来分配容器,默认情况下不启用CPU调度。要同时使用内存和 CPU,资源计算器需要更改为org.apache.hadoop.yarn.util.resource.DominantResourceCalculator
in the capacity-scheduler.xml
file.
这是需要改变的地方。
<property>
<name>yarn.scheduler.capacity.resource-calculator</name>
<value>org.apache.hadoop.yarn.util.resource.DominantResourceCalculator</value>
</property>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)