不知道是不是hive-0.12版增强了local mode的原因,在之前版本运行好好的Hive-QL在这个版本上错误频频,折磨一天多以后终于定位到原因,把在内部的总结在这再记录下,希望对遇到同样问题的筒子们有所帮助。
部分一 关于return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
Hive升级到0.12版之后,若干原来在0.10上执行正常的SQL会在新版上报错误 “return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask”,查看hive执行日志,从中找到如下错误
Total MapReduce jobs = 1 java.io.IOException: Cannot run program "/data/opt/hadoop_cdh5/bin/hadoop" (in directory "/root"): error=13, 权限不够 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at java.lang.Runtime.exec(Runtime.java:617) at java.lang.Runtime.exec(Runtime.java:450) at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.execute(MapredLocalTask.java:253) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65) at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1485) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1263) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1091) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:931) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:921) at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:198) at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:644) at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:628) at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:244) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.io.IOException: error=13, 权限不够 at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ... 19 more FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
从上边错误及下边报错的类MapredLocalTask可以看出跟本地任务有关
hive从0.7版以后,为了提高小数据的计算速度,增加了本地模式,即将hdfs上的数据拉到hiveserver本地进行计算,可以通过以下几个参数对相关行为进行设置
hive.exec.mode.local.auto.input.files.max=4
hive.exec.mode.local.auto.inputbytes.max=134217728
类似上一篇中return code 1的问题,这个也是跟hive本地任务有关系。
从hive的日志中可以找到出错时本地日志文件,如下:
查看日志文件内容
2014-07-10 11:50:37,606 INFO mr.ExecDriver (SessionState.java:printInfo(417)) - Execution log at: /tmp/hdfs/hdfs_20140710114949_ab4d1d02-0637-4abd-9e45-2a27c5d740d9.log 2014-07-10 11:50:37,711 WARN conf.Configuration (Configuration.java:loadProperty(2358)) - file:/tmp/hdfs/hive_2014-07-10_11-49-37_877_2428431256361163465-1/-local-10009/jobconf 2014-07-10 11:50:37,720 WARN conf.Configuration (Configuration.java:loadProperty(2358)) - file:/tmp/hdfs/hive_2014-07-10_11-49-37_877_2428431256361163465-1/-local-10009/jobconf 2014-07-10 11:50:37,798 INFO log.PerfLogger (PerfLogger.java:PerfLogBegin(97)) - <PERFLOG method=deserializePlan from=org.apache.hadoop.hive.ql.exec.Utilities> 2014-07-10 11:50:37,798 INFO exec.Utilities (Utilities.java:deserializePlan(732)) - Deserializing MapredLocalWork via kryo 2014-07-10 11:50:38,043 INFO log.PerfLogger (PerfLogger.java:PerfLogEnd(124)) - </PERFLOG method=deserializePlan start=1404964237798 end=1404964238043 duration=245 from=org.apa 2014-07-10 11:50:38,050 INFO mr.MapredLocalTask (SessionState.java:printInfo(417)) - 2014-07-10 11:50:38 Starting to launch local task to process map join; maximum memory = 2014-07-10 11:50:38,059 INFO mr.MapredLocalTask (MapredLocalTask.java:initializeOperators(389)) - fetchoperator for t2:t_tmp_user_first_login created 2014-07-10 11:50:38,198 INFO exec.TableScanOperator (Operator.java:initialize(338)) - Initializing Self 0 TS 2014-07-10 11:50:38,198 INFO exec.TableScanOperator (Operator.java:initializeChildren(403)) - Operator 0 TS initialized 2014-07-10 11:50:38,199 INFO exec.TableScanOperator (Operator.java:initializeChildren(407)) - Initializing children of 0 TS 2014-07-10 11:50:38,199 INFO exec.SelectOperator (Operator.java:initialize(442)) - Initializing child 1 SEL 2014-07-10 11:50:38,199 INFO exec.SelectOperator (Operator.java:initialize(338)) - Initializing Self 1 SEL 2014-07-10 11:50:38,605 ERROR mr.MapredLocalTask (MapredLocalTask.java:executeFromChildJVM(324)) - Hive Runtime Error: Map local work failed java.lang.RuntimeException: java.lang.ClassNotFoundException: com.renren.hive.date.GetWeekISO at org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge.getUdfClass(GenericUDFBridge.java:132) at org.apache.hadoop.hive.ql.exec.FunctionRegistry.isStateful(FunctionRegistry.java:1474) at org.apache.hadoop.hive.ql.exec.FunctionRegistry.isDeterministic(FunctionRegistry.java:1437) at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator.isDeterministic(ExprNodeGenericFuncEvaluator.java:132) at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluatorFactory.iterate(ExprNodeEvaluatorFactory.java:83) at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluatorFactory.toCachedEval(ExprNodeEvaluatorFactory.java:73) at org.apache.hadoop.hive.ql.exec.SelectOperator.initializeOp(SelectOperator.java:59) at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:377) at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:453) at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:409) at org.apache.hadoop.hive.ql.exec.TableScanOperator.initializeOp(TableScanOperator.java:188) at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:377) at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.initializeOperators(MapredLocalTask.java:408) at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.executeFromChildJVM(MapredLocalTask.java:302) at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.main(ExecDriver.java:728) 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:212) Caused by: java.lang.ClassNotFoundException: com.renren.hive.date.GetWeekISO at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge.getUdfClass(GenericUDFBridge.java:130)
由上可知,这次是找不到UDF的类(如遇到其他情况,需要具体问题具体分析),虽然在进入hive的时候通过add jar语句将自定义函数的jar包添加到hadoop集群,但在本地模式时确找不到了。定位到问题就好解决了:既然是local模式找不到udf jar包,说明在add jar步骤只是向当前job在hdfs上的工作目录下添加了,无视本地工作目录;那么我们就直接把udf的jar包copy到hive的lib目录下,测 试正常。
该问题在之前用过的hive 0.10、0.8.1中都未遇到过,初步猜测跟0.12版的bug有关,具体原因就需要花时间翻代码对照前后版本的变动了
从org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask代码中看,还有return code 3的情况,现在幸运的尚未遇到,遇到后再补记录
相关推荐
Hive错误之 Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask错误分析_xiaohu21的博客-CSDN博客.mht
ERROR : FAILED: Execution Error, return code 30041 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. 前言报错信息异常分析配置改动后记 前言 在成功消除Cloudare管理界面上那些可恶的警告之后,我又对yarn...
包org.apache.hadoop.mapreduce的Hadoop源代码分析
Java-org.apache.hadoop是Apache Hadoop项目的核心组件,它在分布式计算领域扮演着至关重要的角色。Hadoop是由Apache软件基金会开发的一个开源框架,主要用于处理和存储大量数据。它设计的初衷是为了支持数据密集型...
org.apache.hadoop.classification org.apache.hadoop.conf org.apache.hadoop.contrib.utils.join org.apache.hadoop.examples org.apache.hadoop.examples.dancing org.apache.hadoop.examples.pi org....
必须将此jar包放在org.apache.hadoop.io包下,否则无法正常覆盖使用
import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.ha
看清楚版本,想要其他版本的可以私聊我,版本经测试,可以用,请大家放心下载使用
NULL 博文链接:https://ouyida3.iteye.com/blog/1144326
Maven坐标:org.apache.hadoop:hadoop-mapreduce-client-common:2.6.5; 标签:apache、mapreduce、common、client、hadoop、jar包、java、API文档、中英对照版; 使用方法:解压翻译后的API文档,用浏览器打开...
Exception in thread main org.apache.hadoop.security.AccessControlException: Permission denied: user=L.MOON, access=WRITE, inode=/user/lsy/result1/_temporary/0:lsy:supergroup:drwxr-xr-x Caused by: org....
Class.forName("org.apache.hive.jdbc.HiveDriver"); Connection conn = DriverManager.getConnection("jdbc:hive2://<Hive服务器>:<端口>/<数据库名>", "<用户名>", "<密码>"); Statement stmt = conn....
大数据笔记,包含Hadoop、Spark、Flink、Hive、Kafka、Flume、ZK...... 大数据笔记,包含Hadoop、Spark、Flink、Hive、Kafka、Flume、ZK...... 大数据笔记,包含Hadoop、Spark、Flink、Hive、Kafka、Flume、ZK.......
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient 解决方法 ...
ERROR org.apache.hadoop.mapred.TaskTracker: Can not start task tracker because java.io.IOException: Failed to set permissions of path: \tmp\hadoop-admin \mapred\local\ttprivate to 0700 at org.apache...
解决方案:Exceptionin thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.util.NativeCrc32.nativeCo
hadoop支持LZO压缩配置 将...org.apache.hadoop.io.compress.GzipCodec, org.apache.hadoop.io.compress.DefaultCodec, org.apache.hadoop.io.compress.BZip2Codec, org.apache.hadoop.io.compress.SnappyCodec, ...
6. **日志和监控**:Hadoop使用`org.apache.hadoop.log`和`org.apache.hadoop.metrics`包来收集和处理系统的日志和性能指标,帮助管理员监控和诊断系统状态。 **Hadoop 2.5.1源码解析** 从hadoop-2.5.1-src中,...
org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Ljava/lang/String;I)V 解决方案:下载本资源解压将hadoop.dll和winutils.exe文件复制到hadoop2.7.3的bin目录下即可解决。