liangsw  

错误信息描述:

Application application_1562660574247_0003 failed 2 times due to AM Container for appattempt_1562660574247_0003_000002 exited with exitCode: 1

Failing this attempt.Diagnostics: [2019-07-09 08:07:16.710]Exception from container-launch.

Container id: container_1562660574247_0003_02_000001

Exit code: 1

[2019-07-09 08:07:16.715]Container exited with a non-zero exit code 1. Error file: prelaunch.err.

Last 4096 bytes of prelaunch.err :

Last 4096 bytes of stderr :

Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

Please check whether your etc/hadoop/mapred-site.xml contains the below configuration:

<property>

<name>yarn.app.mapreduce.am.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

<property>

<name>mapreduce.map.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

<property>

<name>mapreduce.reduce.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

[2019-07-09 08:07:16.715]Container exited with a non-zero exit code 1. Error file: prelaunch.err.

Last 4096 bytes of prelaunch.err :

Last 4096 bytes of stderr :

Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

Please check whether your etc/hadoop/mapred-site.xml contains the below configuration:

<property>

<name>yarn.app.mapreduce.am.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

<property>

<name>mapreduce.map.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

<property>

<name>mapreduce.reduce.env</name>

<value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>

</property>

For more detailed output, check the application tracking page: http://standby:8088/cluster/app/application_1562660574247_0003 Then click on links to logs of each attempt.

. Failing the application.

解决方法:

1、在命令行执行,复制信息。

hadoop classpath

2、编辑yarn-site.xml,添加信息:

<configuration>
  <property>
    <name>yarn.application.classpath</name>
    <value>复制的Hadoop classpath信息</value>
  </property>
</configuration>

在所有的Master和Slave节点进行如上设置,设置完毕后重启Hadoop集群,重新运行刚才的MapReduce程序,成功运行。

亲测可用!!!

参考链接:https://blog.csdn.net/qq_41684957/article/details/81710190 

posted on 2019-07-09 20:45  liangsw  阅读(762)  评论(0编辑  收藏  举报