简体   繁体   English

HBase MapReduce中的Nullpointer异常

[英]Nullpointer exception in HBase MapReduce

I have a mapreduce app that takes an HBase source data and mapreduces it to another HBase table, all written in Java.When I run it using 我有一个mapreduce应用程序,该应用程序接收一个HBase源数据并将其映射到另一个用Java编写的HBase表中。

hadoop jar myhbase.jar 

It terminated with a NullpointerException as below: 它以NullpointerException终止,如下所示:


14/01/31 11:07:02 INFO zookeeper.ClientCnxn: Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session
14/01/31 11:07:02 INFO zookeeper.ClientCnxn: Session establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = 0x143e677d6e30007, negotiated timeout = 180000
14/01/31 11:07:03 INFO mapreduce.TableOutputFormat: Created table instance for hourinfo
14/01/31 11:07:03 INFO mapred.JobClient: Cleaning up the staging area hdfs://192.168.1.149:9000/hadoop_tmp/mapred/staging/root/.staging/job_201401310933_0002
Exception in thread "main" java.lang.NullPointerException
        at org.apache.hadoop.net.DNS.reverseDns(DNS.java:72)
        at org.apache.hadoop.hbase.mapreduce.TableInputFormatBase.reverseDNS(TableInputFormatBase.java:219)
        at org.apache.hadoop.hbase.mapreduce.TableInputFormatBase.getSplits(TableInputFormatBase.java:184)
        at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962)
        at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979)
        at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
        at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
        at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
        at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
        at mapreduce.hi.api.hbase.HBaseJobRunner.main(HBaseJobRunner.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

I am using hbase-0.94.5 and hadoop-1.0.4 . 我正在使用hbase-0.94.5hadoop-1.0.4 I am really stuck on this error.Please help.. 我确实对这个错误感到困惑。请提供帮助。

Check out the top of your stack trace: 查看堆栈跟踪的顶部:

 at org.apache.hadoop.net.DNS.reverseDns(DNS.java:72)

Be sure that your forward and reverse DNS lookups exactly match on your HBase/ZK nodes. 确保您的正向和反向DNS查找在您的HBase / ZK节点上完全匹配。

Okay I fixed the issue. 好吧,我解决了这个问题。 From the exception I got it originated from TableInputFormatBase.getSplits() .When I analyze source code of TableInputFormatBase , it is looking for a job configuration parameter hbase.nameserver.address . 从异常中我得到它源自TableInputFormatBase.getSplits() 。当我分析TableInputFormatBase源代码时,它正在寻找作业配置参数hbase.nameserver.address When I set this value from my code, it worked. 当我从代码中设置此值时,它就起作用了。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM