我是 Hadoop 新手。当我运行一个作业时,我看到该作业的总资源分配为 251248654 MB 秒,24462 vcore 秒。但是,当我找到有关集群的详细信息时,它显示总共有 888 Vcores 和 15.90 TB Memory-total。谁能告诉我这有什么关系? MB-second 和 Vcore-seconds 指的是什么。
网上有资料可以了解这些吗?我试过冲浪,但没有得到正确的答案
最佳答案
VCores-Total: Indicates the total number of VCores available in the cluster
Memory-Total: Indicates the total memory available in the cluster.
例如我有一个单节点集群,其中,我将每个容器的内存要求设置为:1228 MB(由配置确定:yarn.scheduler.minimum-allocation-mb
),每个容器的 vCore 为 1 vCore (由配置决定:yarn.scheduler.minimum-allocation-vcores
)。
我已将:yarn.nodemanager.resource.memory-mb
设置为 9830 MB。因此,每个节点总共可以有 8 个容器 (9830/1228 = 8)。
所以,对于我的集群:
VCores-Total = 1 (node) * 8 (containers) * 1 (vCore per container) = 8
Memory-Total = 1 (node) * 8 (containers) * 1228 MB (memory per container) = 9824 MB = 9.59375 GB = 9.6 GB
现在让我们看看“MB-seconds” 和“vcore-seconds”。 根据代码(ApplicationResourceUsageReport.java)中的描述:
MB 秒:应用程序已分配的内存总量(以兆字节为单位)乘以应用程序已运行的秒数。
vcore-seconds:应用程序已分配的 vcore 总数乘以应用程序已运行的秒数。
描述是不言自明的(记住关键字:聚合)。
让我用一个例子来解释这一点。 我运行了一个 DistCp 作业(产生了 25 个容器),为此我得到了以下信息:
Aggregate Resource Allocation: 10361661 MB-seconds, 8424 vcore-seconds
现在,让我们粗略计算一下每个容器花费的时间:
For memory:
10361661 MB-seconds = 10361661 / 25 (containers) / 1228 MB (memory per container) = 337.51 seconds = 5.62 minutes
For CPU
8424 vcore-seconds = 8424 / 25 (containers) / 1 (vCore per container) = 336.96 seconds = 5.616 minutes
这表明平均每个容器执行时间为 5.62 分钟。
我希望这能说明问题。您可以执行作业并自行确认。
关于hadoop - YARN 中作业的聚合资源分配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33866888/