如何将hadoopmapreduce作业限制为一定数量的节点?

7fhtutme  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(256)

所以,基本上我有一个有4个数据节点的系统。但是,为了检查hadoop应用程序的可伸缩性,我想用1、2和4个节点来测试它。那么,如何将hadoop使用的节点数限制为1或2个呢。我使用的是hadoop2.5.1,我没有系统的管理员权限。此外,如何控制hadoop为一个节点使用的核心数?

ryevplcw

ryevplcw1#

你需要管理员权限才能做到这一切
如何将hadoop使用的节点数限制为1或2。
停用2-3个节点
如何控制hadoop为节点使用的核心数
在yarn-site.xml的config下面设置,以便为每个节点分配8个vcore

<property>
    <name>yarn.nodemanager.resource.cpu-vcores</name>
    <value>8</value>
</property>

同时更新capacity-scheduler.xml中的yarn.scheduler.capacity.resource-calculator,因为defaultresourcecalculator只使用内存。

<property>
    <name>yarn.scheduler.capacity.resource-calculator</name>
    <value>org.apache.hadoop.yarn.util.resource.DominantResourceCalculator</value>
    <description>
      The ResourceCalculator implementation to be used to compare
      Resources in the scheduler.
      The default i.e. DefaultResourceCalculator only uses Memory while
      DominantResourceCalculator uses dominant-resource to compare
      multi-dimensional resources such as Memory, CPU etc.
    </description>   </property>

相关问题