CCAH-CCA-500-6题:You want YARN to launch no more than 16 containers per...
6.What should you do?
Each node in your Hadoop cluster, running YARN, has 64GB memory and 24 cores.
Your yarn.site.xml has the following configuration:
<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>32768</value>
</property>
<property>
<name>yarn.nodemanager.resource.cpu-vcores</name>
<value>12</value>
</property>
You want YARN to launch no more than 16 containers per node. What should you do?
A.
Modify yarn-site.xml with the following property:
<name>yarn.scheduler.minimum-allocation-mb</name>
<value>2048</value>
B.
Modify yarn-sites.xml with the following property:
<name>yarn.scheduler.minimum-allocation-mb</name>
<value>4096</value>
C.
Modify yarn-site.xml with the following property:
<name>yarn.nodemanager.resource.cpu-vccores</name>
D.
No action is needed: YARN’s dynamic resource allocation automatically optimizes the node
memory and cores
问题:
Hadoop集群的每台节点内存64G,CPU 24核。当前一个节点可分配的物理内存总量是32768M(32G),可分配的虚拟cpu总个数是12。
那么yarn在每个节点上,发起不超过16个容器,我们应该怎样配置?
分析:A
yarn.scheduler.minimum-allocation-mb:最小可申请内存量,默认是1024,我们设置2048M,见如下计算公式
Maximum memory YARN can utilize on the node
————————————————————————————————————————————— = minimum memory per container
Number of containers
配置文件 配置项名称 配置项值
yarn-site.xml yarn.nodemanager.resource.memory-mb = Containers个数* 每个Container内存
yarn-site.xml yarn.scheduler.minimum-allocation-mb = 每个Container内存
yarn-site.xml yarn.scheduler.maximum-allocation-mb = Containers个数* 每个Container内存
mapred-site.xml mapreduce.map.memory.mb = 每个Container内存
mapred-site.xml mapreduce.reduce.memory.mb = 2 * 每个Container内存
mapred-site.xml mapreduce.map.java.opts = 0.8 * 每个Container内存
mapred-site.xml mapreduce.reduce.java.opts = 0.8 * 2 * 每个Container内存
yarn-site.xml (check) yarn.app.mapreduce.am.resource.mb = 2 * 每个Container内存
yarn-site.xml (check) yarn.app.mapreduce.am.command-opts = 0.8 * 2 * 每个Container内存