首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Hbase Regions服务器无法与HMaster通信

Hbase Regions服务器无法与HMaster通信
EN

Stack Overflow用户
提问于 2013-06-26 18:39:42
回答 3查看 6.8K关注 0票数 2

我无法在分布式模式下设置hbase。当我在一台机器上设置它时,它工作得很好(独立模式)。我的Zookeeper、hmaster和region服务器启动正常。

但是当我访问hbase shell并查看状态时。它向我显示了0区域服务器。我附上了我的地区服务器的日志。加上我的主节点(Namenode)和从节点(Datanode)的主机文件。我已经尝试了stackoverflow上给出的每一个改变主机文件的P&C,但对我都不起作用。

代码语言:javascript
复制
       2013-06-24 15:03:45,844 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server naresh-pc/192.168.0.108:2181. Will not attempt to authenticate using SASL (unknown error)
            2013-06-24 15:03:45,845 WARN org.apache.zookeeper.ClientCnxn: Session 0x13f75807d960001 for server null, unexpected error, closing socket connection and attempting to reconnect

            java.net.ConnectException: Connection refused
                    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
                    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692)
                    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
                    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)

     Slave /etc/hosts :

    127.0.0.1       localhost
    127.0.1.1       ubuntu-pc
    #ip for hadoop
    192.168.0.108   master
    192.168.0.126   slave

    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

    Master /etc/hosts :

    127.0.0.1       localhost
    127.0.1.1       naresh-pc
   #ip for hadoop 
    192.168.0.108   master
    192.168.0.126   slave


    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

hbase-site.xml:

代码语言:javascript
复制
  <configuration>  
 <property>
    <name>hbase.master</name>
           <value>master:60000</value>
          <description>The host and port that the HBase master runs at.
                    A value of 'local' runs the master and a regionserver
                                                     in a single process.
                               </description>
                </property>

                <property>
                                <name>hbase.rootdir</name>
                                <value>hdfs://master:54310/hbase</value>
                                <description>The directory shared by region servers.</description>
                </property>


<property>
                                <name>hbase.cluster.distributed</name>
                                <value>true</value>
                                <description>The mode the cluster will be in. Possible values are
                                false: standalone and pseudo-distributed setups with managed
                                Zookeeper true: fully-distributed with unmanaged Zookeeper
                                Quorum (see hbase-env.sh)
                                </description>
                </property>
                <property>
                                <name>hbase.zookeeper.property.clientPort</name>
                                <value>2181</value>
                                <description>Property from ZooKeeper's config zoo.cfg.
                                The port at which the clients will connect.
                                </description>
                </property>

                <property>
           <name>hbase.zookeeper.quorum</name>
             <value>master</value>
                <description>Comma separated list of servers in the ZooKeeper Quorum.
                                     For example,
                                     "host1.mydomain.com,host2.mydomain.com".
                                     By default this is set to localhost for local and
                                     pseudo-distributed modes of operation. For a
                                     fully-distributed setup, this should be set to a full
                                     list of ZooKeeper quorum servers. If
                                     HBASE_MANAGES_ZK is set in hbase-env.sh
                                     this is the list of servers which we will start/stop
                                     ZooKeeper on.
                </description>
                </property>
</configuration>

    Zookeeper log:

         2013-06-28 18:22:26,781 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
    EndOfStreamException: Unable to read additional data from client sessionid 0x13f8ac0b91b0002, 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:722)
    2013-06-28 18:22:26,858 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /192.168.0.108:57447 which had sessionid 0x13f8ac0b91b0002
    2013-06-28 18:25:21,001 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x13f8ac0b91b0002, timeout of 180000ms exceeded
    2013-06-28 18:25:21,002 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x13f8ac0b91b0002      

Master Log:
2013-06-28 18:22:41,932 INFO org.apache.hadoop.hbase.master.ServerManager: Waiting for region servers count to settle; currently checked in 0, slept for 1502022 ms
2013-06-28 18:22:43,457 INFO org.apache.hadoop.hbase.master.ServerManager: Waiting for region servers count to settle; currently checked in 0, slept for 1503547 ms
EN

回答 3

Stack Overflow用户

发布于 2013-06-26 18:45:35

从主机文件中删除127.0.1.1并打开IPV6。这应该可以解决这个问题。

票数 0
EN

Stack Overflow用户

发布于 2013-06-27 19:17:51

您的Regionserver正在naresh-pc上查找主机,但是您的/etc/ HMaster文件中没有这样的条目。请确保您的配置正确。

票数 0
EN

Stack Overflow用户

发布于 2020-06-22 22:12:39

你能尝试所有这些吗:

确保您的/conf/regionservers文件只有一个条目:slave

不确定您使用的是哪个HBase版本,而不是为hbase-site.xml中的hbase.rootdir属性使用端口54310,而是使用端口9000

您的/etc/hosts文件在主服务器和从服务器上都应该只有以下自定义条目:

127.0.0.1本地主机

192.168.0.108主

192.168.0.126从

我担心您的日志显示为Opening socket connection to server naresh-pc/192.168.0.108:2181

显然,系统认为zookeeper在主机naresh-pc上,但在您的配置中,您在主机master上设置了zookeeper quorum,HBase将绑定到该主机。这就是一个问题。根据我的经验,HBase对主机名非常挑剔,所以要确保它们在所有配置和/etc/hosts文件中都是同步的。

此外,这可能是一个小问题,但在.xml文件中指定zookeper数据目录以具有使集群工作的最小设置集也无伤大雅:hbase.zookeeper.property.dataDir

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17317824

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档