我一直在使用我的Java应用程序连接到我的HBase并正常执行命令。但最近,一旦我以这种方式得到一张桌子:
table.put(myput);
然后它就会遇到像这样的命令:
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
我没有例外。该应用程序不会终止。它只是挂在那里......
当我在CLI中查看Hbase输出时,我注意到这一部分:
<?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>
我在Windows和JDK 1.8上运行。 我的hbase-site配置为空。 我的应用程序的类路径如下:
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)
如何解决此问题并让HBase再次响应? 谢谢你的帮助。
修改
我尝试删除 C:\ Users \ greg \ AppData \ Local \ Temp 中的tmp数据 以及我项目中的数据和 zookeeper 文件夹,现在Hbase甚至无法启动。
{{1}}
答案 0 :(得分:1)
看来你的会话最终处于不一致的状态,在ZooKeeper中留下了一些元数据(这是你得到的第一个错误),也许你可以通过使用ZooKeeper client自己清理ZooKeeper并清除那里的HBase条目来解决这个错误。重启HBase。
但是现在您甚至无法启动HBase,我建议download并在同一地址(127.0.0.1:2181)启动您自己的ZooKeeper服务器并尝试再次启动HBase。如果这样可行则意味着您需要考虑正确修复HBase ZooKeeper连接。我对HBase不是很熟悉,但this可能是一个很好的起点。