Hive无法在hdfs中写入数据

时间:2015-08-24 15:34:13

标签: java hadoop hive apache-storm

我们编写了一个风暴三叉戟拓扑,它将使用hive将数据插入到hdfs中,但是我们遇到了以下异常。我不确定发生了什么,我也没有在谷歌找到任何帮助:(

2015-08-24 12:35:40 o.a.h.h.s.AbstractRecordWriter [ERROR] Failed creating record updater java.io.IOException: java.lang.InterruptedException
at org.apache.hadoop.ipc.Client.call(Client.java:1448) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na] 
at org.apache.hadoop.ipc.Client.call(Client.java:1400) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at com.sun.proxy.$Proxy9.create(Unknown Source) ~[na:na]
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.create(ClientNamenodeProtocolTranslatorPB.java:296) ~[stormjar.jar:na]
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at com.sun.proxy.$Proxy10.create(Unknown Source) ~[na:na]
at org.apache.hadoop.hdfs.DFSOutputStream.newStreamForCreate(DFSOutputStream.java:1726) ~[stormjar.jar:na]
at org.apache.hadoop.hdfs.DFSClient.create(DFSClient.java:1668) ~[stormjar.jar:na]
at org.apache.hadoop.hdfs.DFSClient.create(DFSClient.java:1593) ~[stormjar.jar:na]
at org.apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:397) ~[stormjar.jar:na]
at org.apache.hadoop.hdfs.DistributedFileSystem$6.doCall(DistributedFileSystem.java:393) ~[stormjar.jar:na]
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at org.apache.hadoop.hdfs.DistributedFileSystem.create(DistributedFileSystem.java:393) ~[stormjar.jar:na]
at org.apache.hadoop.hdfs.DistributedFileSystem.create(DistributedFileSystem.java:337) ~[stormjar.jar:na]
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:908) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:869) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
at org.apache.hadoop.hive.ql.io.orc.OrcRecordUpdater.<init>(OrcRecordUpdater.java:230) ~[stormjar.jar:na]
at org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat.getRecordUpdater(OrcOutputFormat.java:282) ~[stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.AbstractRecordWriter.createRecordUpdater(AbstractRecordWriter.java:137) ~[stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.AbstractRecordWriter.newBatch(AbstractRecordWriter.java:117) ~[stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.DelimitedInputWriter.newBatch(DelimitedInputWriter.java:47) [stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.HiveEndPoint$TransactionBatchImpl.<init>(HiveEndPoint.java:506) [stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.HiveEndPoint$TransactionBatchImpl.<init>(HiveEndPoint.java:458) [stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl.fetchTransactionBatchImpl(HiveEndPoint.java:345) [stormjar.jar:na]
at org.apache.hive.hcatalog.streaming.HiveEndPoint$ConnectionImpl.fetchTransactionBatch(HiveEndPoint.java:325) [stormjar.jar:na]
at org.apache.storm.hive.common.HiveWriter$6.call(HiveWriter.java:247) [stormjar.jar:na]
at org.apache.storm.hive.common.HiveWriter$6.call(HiveWriter.java:244) [stormjar.jar:na]
at org.apache.storm.hive.common.HiveWriter$9.call(HiveWriter.java:332) [stormjar.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_75]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
Caused by: java.lang.InterruptedException: null
        at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:400) [na:1.7.0_75]
        at java.util.concurrent.FutureTask.get(FutureTask.java:187) [na:1.7.0_75]
        at org.apache.hadoop.ipc.Client$Connection.sendRpcRequest(Client.java:1047) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na]
        at org.apache.hadoop.ipc.Client.call(Client.java:1442) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na] ... 36 common frames omitted 

java.io.IOException: Failed on local exception: java.nio.channels.ClosedByInterruptException; Host Details : local host is: "xxxx"; destination host is: "yyyy":8020; 
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:772) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na] 
at org.apache.hadoop.ipc.Client.call(Client.java:1473) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na] 
at org.apache.hadoop.ipc.Client.call(Client.java:1400) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na] 
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232) ~[hadoop-common-2.6.0.2.2.6.0-2800.jar:na] 
at com.sun.proxy.$Proxy9.create(Unknown Source) ~[na:na] 
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.create(ClientNamenodeProtocolTranslatorPB.java:296) ~[stormjar.jar:na] 

1 个答案:

答案 0 :(得分:1)

最后一个问题原来是我们设置的超时时间少了,所以它抛出异常。

java.io.IOException: Failed on local exception: java.nio.channels.ClosedByInterruptException; Host Details : local host is: "xxxx"; destination host is: "yyyy":8020; 

设置正确的超时解决了HiveOptions.callTimeout

中的问题