【问题标题】:Aggregate Resource Allocation for a job in YARNYARN 中作业的聚合资源分配
【发布时间】:2015-11-23 08:52:26
【问题描述】:

我是 Hadoop 新手。当我运行一个作业时,我看到该作业的总资源分配为 251248654 MB-秒,24462 vcore-秒。但是,当我找到有关集群的详细信息时,它显示总共有 888 个 Vcor​​es 和 15.90 TB 内存。谁能告诉我这有什么关系? MB-second 和 Vcor​​e-seconds 指的是什么。

网上有资料可以知道这些吗?我尝试了冲浪,力求得到正确的答案

【问题讨论】:

    标签: hadoop hadoop-yarn


    【解决方案1】:
    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 分钟来执行。

    我希望这能说明问题。您可以执行作业并自行确认。

    【讨论】:

    • 非常感谢 Manjunath。它非常精确,解释得很好。
    • 如何获取每个节点中存在的容器数量以及每个容器分配的 vcore?我们的集群共有 74 个节点。我可以从host:8088/cluster 链接中的集群详细信息中获取这些详细信息。但找不到其他详细信息
    • 您可以使用 host:8080/cluster/nodes/ 获取每个节点的容器数量。这里显示了每个节点的详细信息
    • 容器数量取决于您的工作要求。例如,对于 mapreduce 作业,它取决于 mapper 和 reducer 的数量。这些是汇总数字。简而言之,您可以说这些是每个容器所花费的平均时间乘以容器数量乘以(每个容器的 VC-Core 或每个容器的内存)。我得到了完美的数字。
    • 喜欢你的回答! :)
    猜你喜欢
    • 2018-12-07
    • 2016-02-03
    • 1970-01-01
    • 1970-01-01
    • 2019-12-05
    • 1970-01-01
    • 1970-01-01
    • 2014-02-20
    • 2019-12-13
    相关资源
    最近更新 更多