今天使用Azkaban運行Hadoop自帶的單詞計數jar報以下錯誤:
[pid=19143,containerID=container_1515150928558_0003_01_000002] is running beyond virtual memory limits. Current usage: 105.8 MB of 1 GB physical memory used; 2.8 GB of 2.1 GB virtual memory used. Killing container.node
通過上網查詢資料,終於獲得有效解決。oop
報該錯誤的緣由是由於運行所須要的內存超出虛擬內存限制,container被迫殺死致使任務不能正常進行。spa
切換到/root/hadoop-2.7.2/etc/hadoop修改yarn-site.xml添加如下內容:3d
<!--當運行時所需內存超過虛擬內存限制是否強制關閉container--> <property> <name>yarn.nodemanager.vmem-check-enabled</name> <value>false</value> <description>Whether virtual memory limits will be enforced for containers</description> </property> <!--設置容器的內存限制時虛擬內存與物理內存之間的比率--> <property> <name>yarn.nodemanager.vmem-pmem-ratio</name> <value>4</value> <description>Ratio between virtual memory to physical memory when setting memory limits for containers</description> </property>
結果code