Yarn 显示的资源比 cluster 多

Yarn shows more resources than cluster have

我用 3 个 m3.xlarge 实例(1 个主实例和 2 个从实例)启动了一个 EMR 集群,但我遇到了一些麻烦。

根据 aws 文档,一个 m3.xlarge 实例有 4 个 vcpu ( https://aws.amazon.com/ec2/instance-types/ )。这是什么意思?这意味着 4 个线程或 4 个核心,每个核心 2 个线程?我问你这个问题,因为当我打开 hadoop UI(端口 8088)时,每个实例似乎有 8 个可用的 vcore,但根据我的经验,集群的行为就像一个 2 个实例,每个实例有 4 个 vcore。我错了吗?还是 Amazon 或 yarn 的错误?

8 vcores来自默认的Yarn属性

<property>
    <name>yarn.nodemanager.resource.cpu-vcores</name>
    <value>8</value>
    <description>Number of vcores that can be allocated for containers. This is used by the RM scheduler when allocating resources for containers. This is not used to limit the number of physical cores used by YARN containers.</description>
</property>

虽然它被定义为比实例中的实际 vcores 数量更高的值,但容器将根据每个 nodemanager 实例实际可用的 vcores 数量创建。

根据实例 vcores 修改 yarn-site.xml 中此 属性 的值。