Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive

Hive 执行sql报 code2 错误

INFO  : Query ID = root_20201015210009_fc36f3cc-2533-4857-af24-79474f803ad9
INFO  : Total jobs = 1
INFO  : Starting task [Stage-5:MAPREDLOCAL] in serial mode
INFO  : Execution completed successfully
INFO  : MapredLocal task succeeded
INFO  : Launching Job 1 out of 1
INFO  : Starting task [Stage-2:MAPRED] in serial mode
INFO  : Number of reduce tasks not specified. Estimated from input data size: 1
INFO  : In order to change the average load for a reducer (in bytes):
INFO  :   set hive.exec.reducers.bytes.per.reducer=<number>
INFO  : In order to limit the maximum number of reducers:
INFO  :   set hive.exec.reducers.max=<number>
INFO  : In order to set a constant number of reducers:
INFO  :   set mapreduce.job.reduces=<number>
INFO  : number of splits:1
INFO  : Submitting tokens for job: job_local1956915029_0021
INFO  : Executing with tokens: []
INFO  : The url to track the job: http://localhost:8080/
INFO  : Job running in-process (local Hadoop)
INFO  : 2020-10-15 21:00:22,533 Stage-2 map = 0%,  reduce = 0%
ERROR : Ended Job = job_local1956915029_0021 with errors
ERROR : FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
INFO  : MapReduce Jobs Launched: 
INFO  : Stage-Stage-2:  HDFS Read: 0 HDFS Write: 0 FAIL
INFO  : Total MapReduce CPU Time Spent: 0 msec
INFO  : Completed executing command(queryId=root_20201015210009_fc36f3cc-2533-4857-af24-79474f803ad9); Time taken: 12.769 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
Error: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=2)

在这里插入图片描述

出现错误的原因可能有两个

1.集群时间不同步
1.1同步集群时间
  1. 所有机器安装 ntpdate
yum -y install ntpdate
  1. 集群所有机器同时执行 ntpdate time.nist.gov 同步时间
2.MapReduce Job程序内存溢出
  1. 元数据服务配置
    在hive-site.xml中添加元数据服务配置
<property>
<name>hive.metastore.local</name>
<value>false</value>
<description>controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://linux01:9083</value>
</property>

2.启动元数据服务

hive --service metastore     监听的端口是 9083
  1. 修改 MR 内存
vi /opt/apps/hadoop-3.1.1/etc/hadoop/hadoop-env.sh

修改内容

export HADOOP_CLIENT_OPTS="-Xmx1g ${HADOOP_CLIENT_OPTS}"
  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]:Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. Exception when loading 1 in table uniaction1 with loadPath=********************************* 。 引用\[2\]:Error while processing statement: FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Ensure called on an unitialized (or closed) session 352a2d91-16c8-44bd-a296-8a8eab91a2d0 。 引用\[3\]:ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask INFO : Completed executing command(queryId=hive_20221018074224_172b6c79-9a2b-4af0-a992-b6db1380daf2); Time taken: 5.112 seconds Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask (state=08S01,code=1) Intercepting System.exit(2) Failing Oozie Launcher, Main class \[org.apache.oozie.action.hadoop.Hive2Main\], exit code \[2\] 。 问题: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask 回答: 根据提供的引用内容,没有找到关于"Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask"的具体信息。请提供更多的上下文或详细描述,以便我能够更好地回答您的问题。 #### 引用[.reference_title] - *1* *2* *3* [hive报错信息不明确的情况汇总](https://blog.csdn.net/Direction_Wind/article/details/126001680)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值