hadoop-HBase javaapi在put()上卡住了


0

我已经 join到我的HBase,并用Java应用程序非常正常地执行命令。但最近,一旦我得到一张这样的 table:

Table table = hbconnection.getTable(TableName.valueOf(DOC_TABLE_NAME));

然后它会被这样的命令卡住:

table.put(myput);

我没有例外。应用程序不会终止。它就挂在那里。。。

在CLI中查看Hbase输出时,我注意到以下部分:

2015-10-20 15:01:53,207 INFO  [ProcessThread(sid:0 cport:-1):] server.PrepRequestProcessor: Got user-level KeeperException when processing sessionid:0x150855715570000 type:create cxid:0xd57 zxid:0x62e txntype:-1 reqpath:n/a Error Path:/hbase/namespace/hbase Error:KeeperErrorCode = NodeExists for /hbase/namespace/hbase
2015-10-20 15:01:53,217 INFO  [Greg:52905.activeMasterManager] master.HMaster: Master has completed initialization

2015-10-20 15:01:53,220 INFO [greg:52905.activeMasterManager] quotas.MasterQuotaManager: Quota support disabled
2015-10-20 15:02:10,001 INFO [SessionTracker] server.ZooKeeperServer: Expiring session 0x1508540d00a0009, timeout of 40000ms exceeded
2015-10-20 15:02:10,002 INFO [SessionTracker] server.ZooKeeperServer: Expiring session 0x1508540d00a0008, timeout of 40000ms exceeded
2015-10-20 15:02:10,005 INFO [ProcessThread(sid:0 cport:-1):] server.PrepRequestProcessor: Processed session termination for sessionid: 0x1508540d00a0009
2015-10-20 15:02:10,007 INFO [ProcessThread(sid:0 cport:-1):] server.PrepRequestProcessor: Processed session termination for sessionid: 0x1508540d00a0008
2015-10-20 15:06:48,610 INFO [LruBlockCacheStatsExecutor] hfile.LruBlockCache: totalSize=1.67 MB, freeSize=1.58 GB, max=1.58 GB, blockCount=4, accesses=17, hits=13, hitRatio=76.47%, , cachingAccesses=17, cachingHits=13, cachingHitsRatio=76.47%, evictions=29, evicted=0, evictedPerRun=0.0
2015-10-20 15:06:58,791 INFO [greg,52936,1445346099888_ChoreService_1] regionserver.HRegionServer: greg,52936,1445346099888-MemstoreFlusherChore requesting flush for region hbase:meta,,1.1588230740 after a delay of 20679
2015-10-20 15:07:08,790 INFO [greg,52936,1445346099888_ChoreService_1] regionserver.HRegionServer: greg,52936,1445346099888-MemstoreFlusherChore requesting flush for region hbase:meta,,1.1588230740 after a delay of 6649
2015-10-20 15:07:18,790 INFO [greg,52936,1445346099888_ChoreService_1] regionserver.HRegionServer: greg,52936,1445346099888-MemstoreFlusherChore requesting flush for region hbase:meta,,1.1588230740 after a delay of 18558
2015-10-20 15:07:19,481 INFO [MemStoreFlusher.0] regionserver.HRegion: Started memstore flush for hbase:meta,,1.1588230740, current region memstore size 2.79 KB, and 1/1 column families' memstores are being flushed.
2015-10-20 15:07:19,643 INFO [MemStoreFlusher.0] regionserver.DefaultStoreFlusher: Flushed, sequenceid=332, memsize=2.8 K, hasBloomFilter=false, into tmp file file:/C:/Users/greg/AppData/Local/Temp/hbase-greg/hbase/data/hbase/meta/1588230740/.tmp/edcebd7b3e8841de931094a5f97f7d1b
2015-10-20 15:07:19,702 INFO [MemStoreFlusher.0] regionserver.HStore: Added file:/C:/Users/greg/AppData/Local/Temp/hbase-greg/hbase/data/hbase/meta/1588230740/info/edcebd7b3e8841de931094a5f97f7d1b, entries=12, sequenceid=332, filesize=6.0 K
2015-10-20 15:07:19,705 INFO [MemStoreFlusher.0] regionserver.HRegion: Finished memstore flush of ~2.79 KB/2856, currentsize=0 B/0 for region hbase:meta,,1.1588230740 in 224ms, sequenceid=332, compaction requested=false
2015-10-20 15:11:48,609 INFO [LruBlockCacheStatsExecutor] hfile.LruBlockCache: totalSize=1.67 MB, freeSize=1.58 GB, max=1.58 GB, blockCount=4, accesses=19, hits=15, hitRatio=78.95%, , cachingAccesses=19, cachingHits=15, cachingHitsRatio=78.95%, evictions=59, evicted=0, evictedPerRun=0.0

我运行的是windows和jdk1.8。

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/commons-configuration-1.6.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/commons-lang-2.6.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/commons-logging-1.2.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/log4j-1.2.17.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/protobuf-java-2.5.0.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/slf4j-api-1.7.7.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/slf4j-log4j12-1.7.5.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/zookeeper-3.4.6.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hadoop-client-2.5.1.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hadoop-common-2.5.1.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hbase-client-1.1.2.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hbase-common-1.1.2.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/guava-12.0.1.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/commons-collections-3.2.1.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hadoop-hdfs-2.5.1.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hadoop-auth-2.5.1.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hbase-annotations-1.1.2.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/hbase-protocol-1.1.2.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/htrace-core-3.1.0-incubating.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/commons-io-2.4.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/netty-all-4.0.23.Final.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/hbase-1.1.2-bin/lib/commons-codec-1.9.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/tika-core-1.5.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/tika-parsers-1.5.jar"/>
    <classpathentry kind="lib" path="C:/Users/Greg/Documents/Tools/pdfbox-app-1.8.10.jar"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

如何修复此问题并使HBase再次响应?

编辑

我试图删除C:UsersgregAppDataLocalTemp中的tmp数据

2015-10-20 15:51:27,022 INFO  [RS:0;greg:54045-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2015-10-20 15:51:27,213 INFO  [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2015-10-20 15:51:28,026 WARN  [RS:0;greg:54045-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Session 0x150858481600003 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-10-20 15:51:28,217 WARN  [main-SendThread(127.0.0.1:2181)] zookeeper.ClientCnxn: Session 0x150858481600001 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)

1 答案


0

似乎您的会话以不一致的状态结束,在ZooKeeper中留下了一些元数据(这是您遇到的第一个错误),也许您可以通过使用ZooKeeper client清除ZooKeeper并在那里清除HBase条目并重新启动HBase来解决该错误。

但是,现在您甚至不能启动HBase,我建议您下载并在相同的地址(127.0.0.1:2181)启动自己的ZooKeeper服务器,然后再次尝试启动HBase。如果这样做的话,那就意味着您需要研究如何正确地修复HBase ZooKeeper join。我不太熟悉HBase,但这可能是一个好的开始。


我来回答

写文章

提问题

面试题