简体   繁体   English

执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 返回代码 1 (state=08S01,code=1)

[英]Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=1)

I have started metastore and hiveserver2我已经启动了 Metastore 和 hiveserver2

#./hive --service metastore
#./hive --service hiveserver2 

When I excute below query当我执行以下查询时

#./beeline -u jdbc:hive2://192.168.0.10:10000 -e 'select count(*) from test_tb'  --hiveconf hive.root.logger=DEBUG,console --verbose=true

It throws below error它抛出以下错误

Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=1)
java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
        at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:275)
        at org.apache.hive.beeline.Commands.execute(Commands.java:736)
        at org.apache.hive.beeline.Commands.sql(Commands.java:657)
        at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:804)
        at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:608)
        at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:630)
        at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:368)
        at org.apache.hive.beeline.BeeLine.main(BeeLine.java:351)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
Beeline version 0.13.1 by Apache Hive

hiveserver2 log below hiveserver2 日志如下

6/06/14 10:57:32 [main]: WARN common.LogUtils: DEPRECATED: Ignoring hive-default.xml found on the CLASSPATH at /data/offline/apache-hive-0.13.1-bin/conf/hive-default.xml
16/06/14 10:57:32 [main]: INFO metastore.HiveMetaStore: Starting hive metastore on port 9083
16/06/14 10:57:32 [main]: INFO metastore.HiveMetaStore: 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
16/06/14 10:57:32 [main]: INFO metastore.ObjectStore: ObjectStore, initialize called
16/06/14 10:57:33 [main]: INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
16/06/14 10:57:33 [main]: INFO metastore.ObjectStore: Initialized ObjectStore
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: Added admin role in metastore
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: Added public role in metastore
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: No user is added in admin role, since config is empty
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: Starting DB backed MetaStore Server
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: Started the new metaserver on port [9083]...
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: Options.minWorkerThreads = 200
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: Options.maxWorkerThreads = 100000
16/06/14 10:57:34 [main]: INFO metastore.HiveMetaStore: TCP keepalive = true
16/06/14 10:57:40 [pool-3-thread-1]: INFO metastore.HiveMetaStore: 1: source:/10.234.177.127 get_table : db=default tbl=test_tb
16/06/14 10:57:40 [pool-3-thread-1]: INFO HiveMetaStore.audit: ugi=qspace       ip=/10.234.177.127      cmd=source:/192.168.0.10 get_table : db=default tbl=test_tb
16/06/14 10:57:40 [pool-3-thread-1]: INFO metastore.HiveMetaStore: 1: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
16/06/14 10:57:40 [pool-3-thread-1]: INFO metastore.ObjectStore: ObjectStore, initialize called
16/06/14 10:57:40 [pool-3-thread-1]: INFO metastore.ObjectStore: Initialized ObjectStore

I see you are using Hiveserver2.我看到您正在使用 Hiveserver2。 For such aggregations, depending upon configuration, I believe you may need to set the number of reducers prior to execution.对于此类聚合,根据配置,我相信您可能需要在执行之前设置减速器的数量。 With Hive you can use this syntax:使用 Hive,您可以使用以下语法:

SET mapred.reduce.tasks=1

However on Hive2 I have noticed I need to use:但是在 Hive2 上,我注意到我需要使用:

SET mapreduce.job.reduces=1

I hope this helps!我希望这会有所帮助! Previously I had a the same error message and changing this resolved the problem for me.以前我有一个相同的错误消息,改变它为我解决了问题。

This could be a permission issue,Try starting beeline as follows这可能是权限问题,请尝试按如下方式开始直线

beeline直线

!connect jdbc:hive2://hadoop7:10000/default !connect jdbc:hive2://hadoop7:10000/default

enter your user and password输入您的用户名和密码

Confirming that in my case it was caused by permission issue (as pointed already by wise_w) what was weird is that it looked like plain select * worked fine but anything more elaborate did not.确认在我的情况下它是由权限问题引起的(正如 wise_w 已经指出的),奇怪的是它看起来像普通的 select * 工作正常,但任何更复杂的东西都没有。

I tried the following:我尝试了以下方法:

$ beeline -u jdbc:hive2://server1:10000
(connected fine, no errors)
> select * from table1;
-> worked fine

> select count(*) from table1;
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=1)
or
ERROR : Job Submission failed with exception 'org.apache.hadoop.security.AccessControlException(Permission denied: user=anonymous, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

The solution started with wise_w suggestion解决方案始于 wise_w 建议

$ beeline --incremental=true
$ !connect jdbc:hive2://server1:10000/default
Enter username for jdbc:hive2://server1:10000/default: hive
Enter password for jdbc:hive2://server1:10000/default: **** (this is hive as well in my test setup)

-> and now everything worked fine. -> 现在一切正常。

Now one liner现在一个班轮

$ beeline -u jdbc:hive2://server1:10000 -n hive -p hive --incremental=true

I thing the confision came from the fact, that connecting like:我认为 confision 来自这样一个事实,即连接如下:

$ beeline -u jdbc:hive2://server1:10000

does not throw any error.不会抛出任何错误。

Setting the below parameters, it is important in this case:设置以下参数,在这种情况下很重要:

set mapred.job.queue.name=<your queue name>;
set mapreduce.job.reduces=1;

Add the below snippet before running you your query:在运行查询之前添加以下代码段:

SET hive.auto.convert.join=false;
SET mapreduce.map.memory.mb = 16384; 
SET mapreduce.map.java.opts='-Djava.net.preferIPv4Stack=true -Xmx13107M';
SET mapreduce.reduce.memory.mb = 13107; 
SET mapreduce.reduce.java.opts='-Djava.net.preferIPv4Stack=true -Xmx16384M';
set hive.support.concurrency = false;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Hive:失败:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码2 - Hive : FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask 执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 返回代码 2 - Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask Hive Error on windows - return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask - Hive Error on windows - return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask Hive 错误:失败:执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 返回代码 2 - Hive Error : FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask Cloudera Hive:失败:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask MapReduce返回代码2 - Cloudera Hive: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask MapReduce 错误ql.Driver(SessionState.java:printError(419))-失败:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码-101 - ERROR ql.Driver (SessionState.java:printError(419)) - FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask 失败:执行错误,在访问 Hive 视图时从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 异常返回代码 2 - Getting FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask exception while access Hive views 查询 HiveServer2 时,Impyla 从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 返回代码 1 - Impyla return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask when querying HiveServer2 来自 org.apache.hadoop.hive.ql.exec.mapredtask 的配置单元执行错误返回代码 2 失败 - hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask 失败:执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask​​ 返回代码 1 - FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM