Hive错误:FAILED:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask

时间:2015-08-28 08:48:15

标签: java hadoop mapreduce hive

我在HDFS上使用了水槽获得了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为了改变平均负载   reducer(以字节为单位):set   hive.exec.reducers.bytes.per.reducer =为了限制   最大减速器数:set hive.exec.reducers.max = In   为了设置一个恒定数量的reducer:set   mapreduce.job.reduces =正在开始工作= job_1439458788229_0016,   跟踪网址=   http://hdmaster:8088/proxy/application_1439458788229_0016/杀了   Command = / usr / local / hadoop / bin / hadoop job -kill   job_1439458788229_0016 Stage-1的Hadoop作业信息:number of   地图:2;减速机数量:1 2015-08-27 10:27:33,567第1阶段地图   = 0%,reduce = 0%2015-08-27 10:27:44,108 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第1阶段地图= 100%,减少= 100%结束工作=   job_1439458788229_0016有错误在作业期间出错,获取   调试信息...检查任务ID:   来自job的task_1439458788229_0016_m_000001(以及更多)   job_1439458788229_0016

     

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

     

URL:
  http://hdmaster:8088/taskdetails.jsp?jobid=job_1439458788229_0016&tipid=task_1439458788229_0016_m_000001   -----此任务的诊断消息:错误:java.lang.RuntimeException:配置对象时出错           在org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)           在org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)           在org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)           在org.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)           at java.security.AccessController.doPrivileged(Native Method)           在javax.security.auth.Subject.doAs(Subject.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)           在org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)           ... 9更多引起:java.lang.RuntimeException:配置对象时出错           在org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)           在org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)           在org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)           在org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)           ... 14更多引起: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)           在org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)           ... 17更多引起:java.lang.RuntimeException:映射运算符初始化失败           在org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:140)           ... 22更多引起:org.apache.hadoop.hive.ql.metadata.HiveException:   java.lang.ClassNotFoundException:Class   找不到com.cloudera.hive.serde.JSONSerDe           在org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)           在org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:338)           在org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:109)           ... 22更多引起:java.lang.ClassNotFoundException:找不到类com.cloudera.hive.serde.JSONSerDe           在org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1980)           在org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer(PartitionDesc.java:141)           at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:302)           ......还有24个

     

失败:执行错误,返回代码2   org.apache.hadoop.hive.ql.exec.mr.MapRedTask MapReduce Jobs推出:   Stage-Stage-1:Map:2 Reduce:1 HDFS读取:0 HDFS写入:0 FAIL   总MapReduce CPU使用时间:0毫秒

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

  

2015-08-27 10:28:48,852 INFO [主要]   org.apache.hadoop.mapred.YarnChild:种类:mapreduce.job,服务:   job_1439458788229_0016,Ident:   (org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier@988145f)   2015-08-27 10:28:49,023 INFO [主要]   org.apache.hadoop.mapred.YarnChild:在重试前休眠0ms   再次。现在变空了。 2015-08-27 10:28:49,627 INFO [主要]   org.apache.hadoop.mapred.YarnChild:mapreduce.cluster.local.dir for   儿童:   的/ tmp / Hadoop的hduser /纳米本地-DIR / usercache / hduser /应用程序缓存/ application_1439458788229_0016   2015-08-27 10:28:50,363 INFO [主要]   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:使用   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,/用户/水槽/鸣叫/ BBMP_elections / 2015/08/25/11 / FlumeData.1440484188899:0+ 20119InputFormatClass:   org.apache.hadoop.mapred.TextInputFormat

     

2015-08-27 10:28:51,701 INFO [主要]   org.apache.hadoop.hive.ql.exec.Utilities:PLAN PATH =   HDFS:// hdmaster:8020 / TMP /蜂巢/ 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 [主要]   org.apache.hadoop.hive.ql.exec.Utilities:***************非本地   模式*************** 2015-08-27 10:28:51,701 INFO [主要]   org.apache.hadoop.hive.ql.exec.Utilities:local path =   HDFS:// hdmaster:8020 / TMP /蜂巢/ 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 [主要]   org.apache.hadoop.hive.ql.exec.Utilities:打开文件阅读计划:   HDFS:// hdmaster:8020 / TMP /蜂巢/ 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 [主要]   org.apache.hadoop.hive.ql.log.PerfLogger:   2015-08-27 10:28:51,720 INFO [主要]   org.apache.hadoop.hive.ql.exec.Utilities:通过反序列化MapWork   kryo 2015-08-27 10:28:52,043 INFO [主要]   org.apache.hadoop.hive.ql.log.PerfLogger:2015-08-27   10:28:52,080 INFO [主要]   org.apache.hadoop.hive.ql.io.HiveContextAwareRecordReader:处理   文件   HDFS:// hdmaster:8020 /用户/水槽/鸣叫/ BBMP_elections / 2015/08/25/11 / FlumeData.1440484157685   2015-08-27 10:28:52,080 INFO [主要]   org.apache.hadoop.conf.Configuration.deprecation:map.input.file是   弃用。相反,请使用mapreduce.map.input.file 2015-08-27   10:28:52,080 INFO [主要]   org.apache.hadoop.conf.Configuration.deprecation:map.input.start是   弃用。相反,请使用mapreduce.map.input.start 2015-08-27   10:28:52,080 INFO [主要]   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:软限制在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 [主要]   org.apache.hadoop.hive.ql.exec.MapOperator:初始化运算符   MAP [3] 2015-08-27 10:28:52,243 INFO [主要]   org.apache.hadoop.hive.ql.exec.MapOperator:初始化完成3 MAP   2015-08-27 10:28:52,243 INFO [主要]   org.apache.hadoop.hive.ql.exec.MapOperator:运算符3 MAP已初始化   2015-08-27 10:28:52,262警告[主要]   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)     在   org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)     在org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:446)     在org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)at   org.apache.hadoop.mapred.YarnChild $ 2.run(YarnChild.java:163)at at   java.security.AccessController.doPrivileged(Native Method)at   javax.security.auth.Subject.doAs(Subject.java:415)at   org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)     在org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)引起   by:java.lang.reflect.InvocationTargetException at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:606)at   org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)     ... 9更多引起:java.lang.RuntimeException:错误   配置对象   org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)     在   org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)     在   org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)     在org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)     ... 14更多引起:java.lang.reflect.InvocationTargetException     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.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:Class   com.cloudera.hive.serde.JSONSerDe找不到   org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)     在   org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:338)     在   org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:109)     ... 22更多引起:java.lang.ClassNotFoundException:Class   com.cloudera.hive.serde.JSONSerDe找不到   org.apache.hadoop.conf.Configuration.getClassByName(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个

     

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 [主要]   org.apache.hadoop.metrics2.impl.MetricsSystemImpl:MapTask指标   系统停了。 2015-08-27 10:28:52,279 INFO [主要]   org.apache.hadoop.metrics2.impl.MetricsSystemImpl:MapTask指标   系统关闭完成。

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

由于

1 个答案:

答案 0 :(得分:0)

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

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