Hive错误:FAILED:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码2

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hive错误:FAILED:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码2相关的知识,希望对你有一定的参考价值。

我在HDFS上使用了flume的twitter数据。有3个节点集群和mysql Metastore用于配置单元。

当我执行下面的查询

select user_name.screen_name, user_name.followers_count from BBMP_election_tweets limit 10;

它给出了适当的结果。

但如果我在查询下运行

select user_name.screen_name, user_name.followers_count c from BBMP_election_tweets order by c desc;

它抛出错误

查询ID = hduser_20150827102628_15a405ae-59a4-4c90-aa47-045d58c62f02总作业数= 1启动作业1(满分1)编译时确定的减少任务数:1为了更改减速器的平均负载(以字节为单位):设置配置单元。 exec.reducers.bytes.per.reducer =为了限制reducers的最大数量:set hive.exec.reducers.max =为了设置一个常数的reducers:set mapreduce.job.reduces = Starting Job = job_1439458788229_0016 ,跟踪URL = http://hdmaster:8088/proxy/application_1439458788229_0016/ Kill Command = / usr / local / hadoop / bin / hadoop job -kill job_1439458788229_0016 Stage-1的Hadoop作业信息:映射器数量:2;减速机数量:1 2015-08-27 10:27:33,567 Stage-1 map = 0%,reduce = 0%2015-08-27 10:27:43,908 Stage-1 map = 50%,reduce = 0%2015 -08-27 10:27:45,015 Stage-1 map = 0%,reduce = 0%2015-08-27 10:28:31,011 Stage-1 map = 100%,reduce = 100%Ended Job = job_1439458788229_0016 with errors在作业期间,获取调试信息...从作业job_1439458788229_0016检查任务ID:task_1439458788229_0016_m_000001(以及更多)

失败最多的任务(4):-----任务ID:task_1439458788229_0016_m_000001

网址: http://hdmaster:8088/taskdetails.jsp?jobid=job_1439458788229_0016&tipid=task_1439458788229_0016_m_000001 -----此任务的诊断消息:错误:java.lang.RuntimeException:在org.apache.hadoop上的org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)中配置对象时出错。 org.apache.hadoop.util上的orr.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)中的util.ReflectionUtils.setConf(ReflectionUtils.java:75)org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:446) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)at org.apache.hadoop.mapred.YarnChild $ 2.run(YarnChild.java:163)at java.security.AccessController.doPrivileged(Native Method) )位于org.apache.hadoop.mapred.YarnChild.main的org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)的javax.security.auth.Subject.doAs(Subject.java:415) YarnChild.java:158)由sun.reflect.NativeMethodAccessorImpl.invoke上的sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)引起的java.lang.reflect.InvocationTargetException(NativeMethodAccessorImpl.java:5) 7)atg.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java)中的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:606) :106)... 9更多引起:java.lang.RuntimeException:在org.apache.hadoop.util.ReflectionUtils的org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)中配置对象时出错.setConf(ReflectionUtils.java:75)org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)... 14更多引起:sun.reflect.DeativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.invoke:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl。)的sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)中的java.lang.reflect.InvocationTargetException。 java:43)at org.apache.hadoop.util.ReflectionUtils.setJ的java.lang.reflect.Method.invoke(Method.java:606)了java.lang.RuntimeException:obConf(ReflectionUtils.java:106)... 17多个所致地图运营商在初始化org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:140失败)... ... 22更多引起:org.apache.hadoop.hive.ql.metadata.HiveException:java.lang.ClassNotFoundException:在org.apache.hadoop.hive中找不到类com.cloudera.hive.serde.JSONSerDe。位于org.apache.hadoop.hive.ql.exec的org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:338)的ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)。 mr.ExecMapper.configure(ExecMapper.java:109)... 22更多引起:java.lang.ClassNotFoundException:在org.apache.hadoop.conf.Configuration.getClassByName中找不到类com.cloudera.hive.serde.JSONSerDe (Configuration.java:1980)在org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer(PartitionDesc.java:141)在org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java :302)......还有24个

FAILED:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码2启动MapReduce作业:Stage-Stage-1:Map:2 Reduce:1 HDFS读取:0 HDFS写入:0 FAIL Total MapReduce CPU耗时:0毫秒

选中时会创建日志。它给出了以下信息

2015-08-27 10:28:48,852 INFO [main] org.apache.hadoop.mapred.YarnChild:Kind:mapreduce.job,服务:job_1439458788229_0016,Ident:(org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier @ 988145f)2015-08-27 10:28:49,023 INFO [main] org.apache.hadoop.mapred.YarnChild:在重试之前休眠0ms。现在变空了。 2015-08-27 10:28:49,627 INFO [main] org.apache.hadoop.mapred.YarnChild:mapreduce.cluster.local.dir for child:/ tmp / hadoop-hduser / nm-local-dir / usercache / hduser / appcache / application_1439458788229_0016 2015-08-27 10:28:50,363 INFO [main] org.apache.hadoop.conf.Configuration.deprecation:不推荐使用session.id.相反,请使用dfs.metrics.session-id 2015-08-27 10:28:51,186 INFO [main] org.apache.hadoop.mapred.Task:Using ResourceCalculatorProcessTree:[] 2015-08-27 10:28:51,534 INFO [main] org.apache.hadoop.mapred.MapTask:处理拆分:路径:/user/flume/tweets/BBMP_elections/2015/08/25/11/FlumeData.1440484157685:0 + 52974,/ user / flume / tweets / BBMP_elections / 2015/08/25/11 / FlumeData.1440484188899:0 + 20119InputFormatClass:org.apache.hadoop.mapred.TextInputFormat

2015-08-27 10:28:51,701 INFO [main] org.apache.hadoop.hive.ql.exec.Utilities:PLAN PATH = hdfs:// hdmaster:8020 / tmp / hive / hduser / 55daf291-b44e-414b -b3a5-e326134f9f24 / hive_2015-08-27_10-26-28_312_5076847637673296334-1 / -mr-10004 / 6e310852-ea63-4789-93f1-754147923e7f / map.xml 2015-08-27 10:28:51,701 INFO [main] org .apache.hadoop.hive.ql.exec.Utilities:***************非本地模式*************** 2015-08 -27 10:28:51,701 INFO [main] org.apache.hadoop.hive.ql.exec.Utilities:local path = hdfs:// hdmaster:8020 / tmp / hive / hduser / 55daf291-b44e-414b-b3a5- e326134f9f24 / hive_2015-08-27_10-26-28_312_5076847637673296334-1 / -mr-10004 / 6e310852-ea63-4789-93f1-754147923e7f / map.xml 2015-08-27 10:28:51,701 INFO [main] org.apache。 hadoop.hive.ql.exec.Utilities:打开文件阅读计划:hdfs:// hdmaster:8020 / tmp / hive / hduser / 55daf291-b44e-414b-b3a5-e326134f9f24 / hive_2015-08-27_10-26-28_312_5076847637673296334 -1 / -mr-10004 / 6e310852-ea63-4789-93f1-754147923e7f / map.xml 2015-08-27 10:28:51,719 INFO [main] org.apache.hado op.hive.ql.log.PerfLogger:2015-08-27 10:28:51,720 INFO [main] org.apache.hadoop.hive.ql.exec.Utilities:通过kryo反序列化MapWork 2015-08-27 10:28 :52,043 INFO [main] org.apache.hadoop.hive.ql.log.PerfLogger:2015-08-27 10:28:52,080 INFO [main] org.apache.hadoop.hive.ql.io.HiveContextAwareRecordReader:处理文件hdfs:// hdmaster:8020 / user / flume / tweets / BBMP_elections / 2015/08/25/11 / FlumeData.1440484157685 2015-08-27 10:28:52,080 INFO [main] org.apache.hadoop.conf.Configuration .deprecation:不推荐使用map.input.file。相反,请使用mapreduce.map.input.file 2015-08-27 10:28:52,080 INFO [main] org.apache.hadoop.conf.Configuration.deprecation:不推荐使用map.input.start。相反,请使用mapreduce.map.input.start 2015-08-27 10:28:52,080 INFO [main] org.apache.hadoop.conf.Configuration.deprecation:不推荐使用map.input.length。相反,请使用mapreduce.map.input.length 2015-08-27 10:28:52,080 INFO [main] org.apache.hadoop.mapred.MapTask:numReduceTasks:1 2015-08-27 10:28:52,228 INFO [main ] org.apache.hadoop.mapred.MapTask:(EQUATOR)0 kvi 26214396(104857584)2015-08-27 10:28:52,228 INFO [main] org.apache.hadoop.mapred.MapTask:mapreduce.task.io。 sort.mb:100 2015-08-27 10:28:52,228 INFO [main] org.apache.hadoop.mapred.MapTask:soft limit at 83886080 2015-08-27 10:28:52,228 INFO [main] org.apache .hadoop.mapred.MapTask:bufstart = 0; bufvoid = 104857600 2015-08-27 10:28:52,228 INFO [main] org.apache.hadoop.mapred.MapTask:kvstart = 26214396;长度= 6553600

2015-08-27 10:28:52,243 INFO [main] org.apache.hadoop.hive.ql.exec.MapOperator:初始化运算符MAP [3] 2015-08-27 10:28:52,243 INFO [main] org。 apache.hadoop.hive.ql.exec.MapOperator:Initialization Done 3 MAP 2015-08-27 10:28:52,243 INFO [main] org.apache.hadoop.hive.ql.exec.MapOperator:Operator 3 MAP initialized 2015- 08-27 10:28:52,262 WARN [main] org.apache.hadoop.mapred.YarnChild:异常运行子:java.lang.RuntimeException:在org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils)配置对象时出错.java:109)org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)atg.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)atg.apache.hadoop。 mapred.MapTask.runOldMapper(MapTask.java:446)org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)org.apache.hadoop.mapred.YarnChild $ 2.run(YarnChild.java:163) )在javax.security.auth.Subject.doAs(Sub)的java.security.AccessController.doPrivileged(Native Method)中ject.java:415)org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)引起:java.lang .reflect.InvocationTargetException 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.ReflectionUtils.setJobConf(ReflectionUtils.java:106)... 9更多引起:java.lang.RuntimeException:配置对象时出错at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)at org.apache.hadoop.util.ReflectionUtils.newInstance (ReflectionUtils.java:133)org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)... 14更多引起:java.lang.ref位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)的sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)中的lect.InvocationTargetException位于java.lang的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)。 reflect.Method.invoke(Method.java:606)at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)... 17更多引起:java.lang.RuntimeException:Map运算符初始化失败于org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:140)... 22更多引起:org.apache.hadoop.hive.ql.metadata.HiveException:java.lang。 ClassNotFoundException:在org.apache.hadoop.hive.ql.exec的org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)中找不到类com.cloudera.hive.serde.JSONSerDe。 MapOperator.setChildren(MapOperator.java:338)org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:109)... 22更多引起:java.lang.ClassNot FoundException:在org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer中找不到org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1980)中的类com.cloudera.hive.serde.JSONSerDe( PartitionDesc.java:141)org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:302)... 24更多

2015-08-27 10:28:52,269 INFO [main] org.apache.hadoop.mapred.Task:Runnning cleanup for the task 2015-08-27 10:28:52,278 INFO [main] org.apache.hadoop.metrics2 .impl.MetricsSystemImpl:停止MapTask指标系统... 2015-08-27 10:28:52,278 INFO [main] org.apache.hadoop.metrics2.impl.MetricsSystemImpl:MapTask指标系统已停止。 2015-08-27 10:28:52,279 INFO [main] org.apache.hadoop.metrics2.impl.MetricsSystemImpl:MapTask metrics系统关闭完成。

请建议。如何解决这个问题。它为什么会发生。

谢谢

答案

这是一个类路径问题根本原因是java.lang.ClassNotFoundException:类com.cloudera.hive.serde.JSONSerDe

你可以看看这里添加hive-serdes:https://github.com/cloudera/cdh-twitter-example

以上是关于Hive错误:FAILED:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码2的主要内容,如果未能解决你的问题,请参考以下文章

无法将 Spark 作为 Hive 执行引擎

失败:执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask​​ 返回代码 1

Hive tez 执行错误

hive 错误 FAILED: SemanticException [Error 10041]: No partition predicate found for

Hadoop - 删除 Hive 表时超时

Hive 中的 ParseExection 错误