在Hadoop v1中,我已经分配了每个7GB的mapper和reducer slot,大小为1GB,我的mappers和reducer运行正常.我的机器有8G内存,8个处理器.现在使用YARN,当在同一台机器上运行相同的应用程序时,我收到了容器错误.默认情况下,我有这样的设置:
<property>
<name>yarn.scheduler.minimum-allocation-mb</name>
<value>1024</value>
</property>
<property>
<name>yarn.scheduler.maximum-allocation-mb</name>
<value>8192</value>
</property>
<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>8192</value>
</property>
Run Code Online (Sandbox Code Playgroud)
它给了我错误:
Container [pid=28920,containerID=container_1389136889967_0001_01_000121] is running beyond virtual memory limits. Current usage: 1.2 GB of 1 GB physical memory used; 2.2 GB of 2.1 GB virtual memory used. Killing container.
Run Code Online (Sandbox Code Playgroud)
然后我尝试在mapred-site.xml中设置内存限制:
<property>
<name>mapreduce.map.memory.mb</name>
<value>4096</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>4096</value>
</property>
Run Code Online (Sandbox Code Playgroud)
但仍然得到错误:
Container [pid=26783,containerID=container_1389136889967_0009_01_000002] is running beyond physical memory limits. Current usage: 4.2 GB of 4 GB physical memory used; 5.2 GB of 8.4 GB virtual memory used. …
Run Code Online (Sandbox Code Playgroud)