2022-12-06 01:18:30,452 INFO mapreduce.Job: Job job_1670295690200_0003 failed with state FAILED due to: Application application_1670295690200_0003 failed 2 times due to AM Container for appattempt_1670295690200_0003_000002 exited with exitCode: 1
Failing this attempt.Diagnostics: [2022-12-06 01:18:27.898]Exception from container-launch.
Container id: container_1670295690200_0003_02_000001
Exit code: 1
[2022-12-06 01:18:27.900]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>
[2022-12-06 01:18:27.901]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://hadoop1:8088/cluster/app/application_1670295690200_0003 Then click on links to logs of each attempt.
. Failing the application.
2022-12-06 01:18:30,493 INFO mapreduce.Job: Counters: 0
2022-12-06 01:18:30,514 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
2022-12-06 01:18:30,518 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 16.3008 seconds (0 bytes/sec)
2022-12-06 01:18:30,528 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
2022-12-06 01:18:30,529 INFO mapreduce.ImportJobBase: Retrieved 0 records.
2022-12-06 01:18:30,529 ERROR tool.ImportTool: Import failed: Import job failed!
[root@hadoop1 conf]#
进入hadoop # cd /app/hadoop/etc/hadoop/
添加以下内容
/app/hadoop是我的目录,改为自己的
<property>
<name>yarn.app.mapreduce.am.env</name>
<value>HADOOP_MAPRED_HOME=/app/hadoop</value>
</property>
<property>
<name>mapreduce.map.env</name>
<value>HADOOP_MAPRED_HOME=/app/hadoop</value>
</property>
<property>
<name>mapreduce.reduce.env</name>
<value>HADOOP_MAPRED_HOME=/app/hadoop</value>
</property>