区域服务器未在hadoop 2.0分布式群集上运行

时间:2015-05-07 14:10:01

标签: hadoop hbase apache-zookeeper

启动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 个答案:

答案 0 :(得分:1)

hbase-site.xml

中添加此属性
<property>
        <name>hbase.zookeeper.property.maxClientCnxns</name>
        <value>1000</value>
 </property>

此属性增加了最大客户端连接数。

默认值为 300 。将其更改为 1000 以避免zookeeper ConnectionLoss错误。同时在从属节点的hbase.zookeeper.quorum中添加hbase.zookeeper.property.clientPorthbase-site.xml属性。

  

注意:在主节点和从属节点上添加此属性。重启你的HBase。

<强>更新

更改您的hbase-site.xml(在从属节点中),如下所示:

<configuration>
    <property>
        <name>hbase.master</name>
        <value>master:60000</value>
    </property>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://NN:PortNo/hbase</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2181</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>NN,DN</value>
    </property>
    <property>
            <name>hbase.cluster.distributed</name>
            <value>true</value>
    </property>
    <property>
            <name>hbase.zookeeper.property.maxClientCnxns</name>
            <value>1000</value>
     </property>
</configuration>

我在所有节点上都有hbase-site.xml。但是主节点和从节点上都有不同的文件。这可能是将来的问题。尽量保持所有hbase-site.xml个文件类似。

更新II:

  1. 在主人的 regionservers 文件中删除demonamenodeclone2的一个条目。 master中的regionserver文件应该只包含两行,其中一行代表master-hostname,另一行代表slave-hostname。

  2. 从属节点上的
  3. Regionserver 文件应与master上的相同。但是你只有localhost。将其更改为包含两行,如在master的regionserver文件中。

  4. 您在</property> hbase-site.xml 中缺少hbase.zookeeper.property.clientPort。也可以在从属节点中更改它。