在启动hbase集群时,我遇到了以下错误
2015-05-15 16:58:31,741 WARN [regionserver60020- SendThread(hbasenamenode:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-05-15 16:58:32,843 INFO [regionserver60020-SendThread(hbasenamenode:2181)] zookeeper.ClientCnxn: Opening socket connection to server hbasenamenode/172.17.198.59:2181. Will not attempt to authenticate using SASL (unknown error)
2015-05-15 16:58:32,847 WARN [regionserver60020-SendThread(hbasenamenode:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-05-15 16:58:33,752 INFO [regionserver60020] ipc.RpcServer: Stopping server on 60020
2015-05-15 16:58:33,755 FATAL [regionserver60020] regionserver.HRegionServer: ABORTING region server demodatanode2clone2,60020,1431689290504: Initialization of RS failed. Hence aborting RS.
java.io.IOException: Received the shutdown message while waiting.
at org.apache.hadoop.hbase.regionserver.HRegionServer.blockAndCheckIfStopped(HRegionServer.java:783)
at org.apache.hadoop.hbase.regionserver.HRegionServer.initializeZooKeeper(HRegionServer.java:730)
at org.apache.hadoop.hbase.regionserver.HRegionServer.preRegistrationInitialization(HRegionServer.java:702)
at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:837)
at java.lang.Thread.run(Thread.java:744)
2015-05-15 16:58:33,756 FATAL [regionserver60020] regionserver.HRegionServer: RegionServer abort: loaded coprocessors are: []
2015-05-15 16:58:33,767 INFO [regionserver60020] ipc.RpcServer: Stopping server on 60020
2015-05-15 16:58:33,767 INFO [regionserver60020] regionserver.HRegionServer: Stopping infoServer
2015-05-15 16:58:33,845 INFO [regionserver60020] mortbay.log: Stopped SelectChannelConnector@0.0.0.0:60030
2015-05-15 16:58:33,949 ERROR [main] regionserver.HRegionServerCommandLine: Region server exiting
java.lang.RuntimeException: HRegionServer Aborted
at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:66)
at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:85)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:2410)
2015-05-15 16:58:33,951 INFO [regionserver60020-SendThread(hbasenamenode:2181)] zookeeper.ClientCnxn: Opening socket connection to server hbasenamenode/172.17.198.59:2181. Will not attempt to authenticate using SASL (unknown error)
2015-05-15 16:58:33,953 WARN [regionserver60020-SendThread(hbasenamenode:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2015-05-15 16:58:33,959 INFO [Thread-9] regionserver.ShutdownHook: Shutdown hook starting; hbase.shutdown.hook=true; fsShutdownHook=org.apache.hadoop.fs.FileSystem$Cache$ClientFinalizer@36d87f9e
2015-05-15 16:58:33,972 INFO [Thread-9] regionserver.ShutdownHook: Starting fs shutdown hook thread.
2015-05-15 16:58:33,983 INFO [Thread-9] regionserver.ShutdownHook: Shutdown hook finished.
但在查找错误时,我从某个站点得到了一个解决方案,即运行此命令
bin/hbase zkcli
但我不明白这个命令的作用是什么?有谁能告诉我为什么我之前面对这个问题,以及如何解决这个问题?
1条答案
按热度按时间mw3dktmi1#
在hbase-site.xml中添加此属性:
此属性增加了客户端连接的最大数目。
默认值为300。将其更改为1000以避免zookeeper connectionloss错误。同时添加
hbase.zookeeper.quorum
以及hbase.zookeeper.property.clientPort
从属节点中的属性hbase-site.xml
我也是。注意:在主节点和从节点上都添加此属性。重新启动hbase。
更新:
改变你的想法
hbase-site.xml
(在主节点和从节点中)如下所示:我有同样的
hbase-site.xml
在所有节点上。但是在主节点和从节点上有不同的文件。这可能是将来的问题。尽量保持所有的hbase-site.xml
文件相似。更新二:
为删除一个条目
demonamenodeclone2
在主区域服务器文件中。主服务器中的regionserver文件应该只包含两行,一行表示主主机名,另一行表示从主机名。从属节点上的regionserver文件应与主节点上的regionserver文件相同。但是你只有localhost在里面。将其更改为包含两行,如在master的regionserver文件中一样。
你错过了一个
</property>
在hbase-site.xml中hbase.zookeeper.property.clientPort
. 也可以在从属节点中更改它。