guangzhou



shanghai

Recent posts:
Blog index
About
RSS

Hadoop伪分布式下HBase出现at org.jruby.xxxxx错误的解决方案

September 08, 2015     Hadoop   705   

原创文章,转载请注明: 转载自工学1号馆

今天在hadoop1.0版本伪分布式的基础上安装了hbase,就是觉得伪分布式下可以方便的做一些hbase的操作,因为之前安装的全分布式《hadoop2.6完全分布式安装HBase1.1》在虚拟机下太笨重,太扯淡了。

在hadoop伪分布式下是不需要安装zookeeper的,所以简单的下载了一个版本的hbase(我这里使用的是hbase-0.98.14版本),在hbase-env.sh中进行jdk的路径设置,在hbase-site.xml中进行如下设置:

<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
</configuration>

再就是在vim etc/profile中进行设置hbase的环境变量路径

剩下的工作就按部就班了,先启动hdfs…… 这一套命令我就不写了,因为本文的重点不在这,如果不清楚可以看我博客前面的文章。 :mrgreen:

然后就是启动hbase:

wu@ubuntu:~/opt/hbase-0.98.14$ bin/start-hbase.sh

starting master, logging to /home/wu/opt/hbase-0.98.14/bin/../logs/hbase-wu-master-ubuntu.out

wu@ubuntu:~/opt/hbase-0.98.14$ bin/hbase shell

HBase Shell; enter ‘help<RETURN>’ for list of supported commands.
Type “exit<RETURN>” to leave the HBase Shell
Version 0.98.14-hadoop1, r4e4aabb93b52f1b0fef6b66edd06ec8923014dec, Tue Aug 25 22:26:17 PDT 2015

一切似乎完美,但是运行下面的命令的时候:

hbase(main):001:0> status

出现一长串的异常提示:
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:450)
        at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:311)
        at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:59)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:63)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:199)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
        at org.jruby.RubyClass.finvoke(RubyClass.java:552)
        at org.jruby.RubyBasicObject.send(RubyBasicObject.java:2777)
        at org.jruby.RubyKernel.send(RubyKernel.java:2105)
        at org.jruby.RubyKernel$s$send.call(RubyKernel$s$send.gen:65535)
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:266)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
        at org.jruby.ast.FCallSpecialArgNode.interpret(FCallSpecialArgNode.java:39)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
        at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:295)
        at org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229)
        at org.jruby.runtime.Block.yieldSpecific(Block.java:99)
        at org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
        at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:153)
        at org.jruby.ast.FCallSpecialArgBlockNode.interpret(FCallSpecialArgBlockNode.java:34)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
        at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:215)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
        at org.jruby.ast.CallSpecialArgNode.interpret(CallSpecialArgNode.java:69)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:215)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
        at org.jruby.ast.FCallSpecialArgNode.interpret(FCallSpecialArgNode.java:41)

……………………………………

在网上查找解决办法,最后找到官方网站上(http://hbase.apache.org/0.94/book/quickstart.html

/etc/hosts   should look something like this:

127.0.0.1 localhost
127.0.0.1 ubuntu.ubuntu-domain ubuntu

意思是将/etc/hosts 中的第二行的IP修改为127.0.0.1。貌似是版本问题导致的

修改之后重启电脑再运行就和谐了:

1 servers, 0 dead, 2.0000 average load

如果文章对您有帮助,欢迎点击下方按钮打赏作者

Comments

No comments yet.
To verify that you are human, please fill in "七"(required)