Hadoop作业保持运行,并且未分配容器

时间:2019-07-06 10:36:22

标签: hadoop mapreduce hdfs yarn

我尝试在Hadoop 2.8.5中运行mapreduce作业,但该作业仍在运行。 申请状态如下: YarnApplicationState: ACCEPTED: waiting for AM container to be allocated, launched and register with RM.

RM Web UI: enter image description here

运行状况报告说:1/1 local-dir是错误的:/ home / hduser / hadooptmpdata / nm-local-dir; 1/1日志目录不正确:/home/hduser/hadoop-2.8.5/logs/userlogs

enter image description here

core-site.xml

<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hduser/hadooptmpdata</value>
</property>
</configuration>

hdfs-site.xml

<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<name>dfs.name.dir</name>
<value>file:///home/hduser/hdfs/namenode</value>
<name>dfs.data.dir</name>
<value>file:///home/hduser/hdfs/datanode</value>
</property>
</configuration>

yarn-site.xml

<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>

<property>
<name>yarn.scheduler.capacity.maximum-am-resource-percent</name>
<value>100</value>
</property>

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

<property>
<name>yarn.scheduler.minimum-allocation-vcores</name>
<value>1</value>
</property>

<property>
<name>yarn.scheduler.maximum-allocation-vcores</name>
<value>3</value>
</property>

<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>4096</value>
</property>

<property>
<name>yarn.scheduler.minimum-allocation-mb</name>
<value>2048</value>
</property>

<property>
<name>yarn.scheduler.maximum-allocation-mb</name>
<value>4096</value>
</property>

<property>
<name>yarn.nodemanager.local-dirs</name>
<value>/home/hduser/hadooptmpdata/nm-local-dir</value>
</property>
</configuration>

mapred-site.xml

<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.map.memory.mb</name>
<value>2048</value>
</property>
<property>
<name>mapreduce.map.cpu.vcores</name>
<value>2</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>2048</value>
</property>
<property>
<name>mapreduce.reduce.cpu.vcores</name>
<value>2</value>
</property>
<property>
<name>mapreduce.cluster.local.dir</name>
<value>/home/user/hduser/hadooptmpdata/mapred/local</value>
</property>
</configuration>

我正在 ubuntu 上运行Hadoop,并且我的电脑具有 intel i7处理器,具有 16 gb RAM 256 GB SSD strong>

1 个答案:

答案 0 :(得分:2)

YARN的资源管理器需要节点管理器的计算资源才能运行任何程序。您的节点管理器显示它的本地目录错误。这意味着您没有可用的计算资源(已通过查看集群指标进行了验证。请查看所有零。)这就是您的应用程序停留在“已接受”状态的原因。

enter image description here

修复您的yarn.nodemanager.local-dirs,并确保YARN拥有完整的权限才能继续操作。