錯誤信息描述:
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