Hadoop运行jar包出现Please check whether your etchadoopmapred-site.xml contains the below

[2021-04-18 10:04:16.881]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://hadoop103:8088/cluster/app/application_1618710108404_0003 Then click on links to logs of each attempt.
. Failing the application.
2021-04-18 10:04:17,485 INFO mapreduce.Job: Counters: 0

格式如下

<value>HADOOP_MAPRED_HOME=你hadoop安装的目录,bin目录所在位置,不包含bin</value>
#填入配置过的$HADOOP_HOME不管用

猜你喜欢

转载自blog.csdn.net/m0_67401134/article/details/126667131