无法运行HBase的示例 - 权威指南

时间:2013-07-15 09:19:41

标签: java hadoop hbase apache-zookeeper

我一直试图从HBase-Definitve指南运行示例,我遇到了这个错误,我无法通过它。如果有帮助的话,我正在独立模式下运行。

Exception in thread "main" org.apache.hadoop.hbase.MasterNotRunningException: �
17136@ubuntulocalhost,32992,1373877731444
at    org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:615)
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:94)  
at util.HBaseHelper.<init>(HBaseHelper.java:29)  
at util.HBaseHelper.getHelper(HBaseHelper.java:33)  
at client.PutExample.main(PutExample.java:22)  

但是我的HMaster进程正在运行:

hduser@ubuntu:/home/ubuntu/hbase-book/ch03$ jps
17602 Jps
8709 NameNode
8929 DataNode
9472 TaskTracker
9252 JobTracker
9172 SecondaryNameNode
17136 HMaster

这是我的hbase-site.xml文件:

<configuration>  
<property>  
<name>hbase.rootdir</name>  
<value>file:///usr/local/hbase/hbase-data/</value>  
</property>  
<property>  
<name>hbase.zookeeper.property.dataDir</name>  
<value>/usr/local/hbase/zookeeper-data/</value>  


   
这是我的/ etc / hosts文件:

127.0.0.1       localhost
127.0.1.1       ubuntu
127.0.0.1       ubuntu.ubuntu-domain ubuntu

具体来说,我正在尝试运行第3章示例,我只是不明白为什么我的设置没有运行..

知道我哪里出错了吗?

编辑:以下是日志:

2013-07-15 03:56:32,663 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket connection from /127.0.0.1:60119
2013-07-15 03:56:32,672 WARN org.apache.zookeeper.server.ZooKeeperServer: Connection request from old client /127.0.0.1:60119; will be dropped if server is in r-o mode
2013-07-15 03:56:32,672 INFO org.apache.zookeeper.server.ZooKeeperServer: Client attempting to establish new session at /127.0.0.1:60119
2013-07-15 03:56:32,674 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x13fe17e7f1d0006 with negotiated timeout 40000 for client /127.0.0.1:60119
2013-07-15 03:57:11,653 DEBUG org.apache.hadoop.hbase.io.hfile.LruBlockCache: Stats: total=1.17 MB, free=247.24 MB, max=248.41 MB, blocks=2, accesses=68, hits=55, hitRatio=80.88%, , cachingAccesses=61, cachingHits=53, cachingHitsRatio=86.88%, , evictions=0, evicted=6, evictedPerRun=Infinity
2013-07-15 03:57:14,333 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x13fe17e7f1d0006, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
at java.lang.Thread.run(Thread.java:724)
2013-07-15 03:57:14,334 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:60119 which had sessionid 0x13fe17e7f1d0006
2013-07-15 03:57:24,551 INFO org.apache.hadoop.hbase.master.LoadBalancer: Skipping load balancing because balanced cluster; servers=1 regions=1 average=1.0 mostloaded=1 leastloaded=1
2013-07-15 03:57:24,568 DEBUG org.apache.hadoop.hbase.client.MetaScanner: Scanning .META. starting at row= for max=2147483647 rows using org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@189ddf
2013-07-15 03:57:24,578 DEBUG org.apache.hadoop.hbase.master.CatalogJanitor: Scanned 1 catalog row(s) and gc'd 0 unreferenced parent region(s)

1 个答案:

答案 0 :(得分:0)

它与独立或分布式模式无关。确保您的设置正常。我可以看到RegionServer和Zookeeper没有运行。在 / etc / hosts 文件中注释掉 127.0.1.1 ubuntu 行,然后重新启动HBase。你可能不得不杀了它。

P.S:由于您已经配置了Hadoop并且运行正常,因此可以在伪分布式设置中运行HBase。