hive 运行复杂sql 报错 Execution Error, return code 2

问题描述

hive 运行复杂sql 报错 Execution Error, return code 2 如下:

0: jdbc:hive2://node01:10000/>      select id from tb_user_log t where t.yue="09" group by id ;
Query ID = root_20201014053747_ecfd0927-dfb0-4390-8e1f-59c056f01176
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks not specified. Estimated from input data size: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
Job running in-process (local Hadoop)
INFO  : Compiling command(queryId=root_20201014053747_ecfd0927-dfb0-4390-8e1f-59c056f01176): select id from tb_user_log t where t.yue="09" group by id
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:id, type:int, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=root_20201014053747_ecfd0927-dfb0-4390-8e1f-59c056f01176); Time taken: 0.38 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=root_20201014053747_ecfd0927-dfb0-4390-8e1f-59c056f01176): select id from tb_user_log t where t.yue="09" group by id
WARN  : Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
INFO  : Query ID = root_20201014053747_ecfd0927-dfb0-4390-8e1f-59c056f01176
INFO  : Total jobs = 1
INFO  : Launching Job 1 out of 1
INFO  : Starting task [Stage-1:MAPRED] in parallel
2020-10-14 05:37:49,413 Stage-1 map = 0%,  reduce = 0%
Ended Job = job_local1894110159_0008 with errors
Error during job, obtaining debugging information...
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched: 
Stage-Stage-1:  HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec
ERROR : FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
INFO  : MapReduce Jobs Launched: 
INFO  : Stage-Stage-1:  HDFS Read: 0 HDFS Write: 0 FAIL
INFO  : Total MapReduce CPU Time Spent: 0 msec
INFO  : Completed executing command(queryId=root_20201014053747_ecfd0927-dfb0-4390-8e1f-59c056f01176); Time taken: 2.008 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)

解决方法:

进入namenode所在节点一个命令解决,

hdfs dfsadmin -safemode leave

使用上面命令退出安全模式即可快乐的掉头发了。。。

原因:

别问,问就是 namenode处于safemode状态,再问就是不知道

后面一天又不行了

于是乎:

在hadoop-3.2.1/etc/hadoop/hadoop-env.sh 中添加配置:

 export HADOOP_CLIENT_OPTS="-Xmx1024m $HADOOP_CLIENT_OPTS"

[root@node01 ~]# vim /opt/module/hadoop-3.2.1/etc/hadoop/hadoop-env.sh 

 

重启hiveserver2

搞定!

 

  • 5
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值