hive:

default> select distinct order_status from dwd.fact_order_master
[2022-10-11 13:50:21] [08S01][2] Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

在这里插入图片描述
在这里插入图片描述

Diagnostics:	
Application application_1665474430718_0005 failed 2 times due to AM Container for appattempt_1665474430718_0005_000002 exited with exitCode: 1
Failing this attempt.Diagnostics: [2022-10-11 16:31:55.292]Exception from container-launch.
Container id: container_1665474430718_0005_02_000001
Exit code: 1
[2022-10-11 16:31:55.295]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-10-11 16:31:55.295]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://bigdata2:8088/cluster/app/application_1665474430718_0005 Then click on links to logs of each attempt.
. Failing the application.

解决过程:

检查mapred-site.xml是否配置以下内容:(我已配置,且环境变量中也已经有${HADOOP_HOME})

    <property>
	   <name>yarn.app.mapreduce.am.env</name>
	   <value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
	 </property>
	 <property>
	   <name>mapreduce.map.env</name>
	   <value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
	 </property>
	 <property>
	   <name>mapreduce.reduce.env</name>
	   <value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
	 </property>

解决:

将${HADOOP_HOME}换成所在路径。

    <property>
           <name>yarn.app.mapreduce.am.env</name>
           <value>HADOOP_MAPRED_HOME=/opt/module/hadoop-3.1.3</value>
         </property>
         <property>
           <name>mapreduce.map.env</name>
           <value>HADOOP_MAPRED_HOME=/opt/module/hadoop-3.1.3</value>
         </property>
         <property>
           <name>mapreduce.reduce.env</name>
           <value>HADOOP_MAPRED_HOME=/opt/module/hadoop-3.1.3</value>
         </property>
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐