2

我无法在分布式模式下设置 hbase。当我在一台机器上设置它时它工作正常(独立模式)。我的 Zookeeper、hmaster 和区域服务器正常启动。
但是当我去 hbase shell 并查找状态时。它向我显示 0 区域服务器。我正在附加我的区域服务器日志。加上我的主(namenode)和从属(datanode)的主机文件。我已经尝试了 stackoverflow 上提供的用于更改主机文件的所有 P&C,但对我不起作用。

       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:

  <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
4

3 回答 3

0

从 hosts 文件中删除 127.0.1.1 并关闭 IPV6。那应该可以解决问题。

于 2013-06-26T10:45:35.143 回答
0

您的 Regionserver 正在 naresh-pc 上寻找 HMaster,但您的 /etc/hosts 文件中没有任何此类条目。请确保您的配置正确。

于 2013-06-27T11:17:50.793 回答
0

您可以尝试所有这些吗:

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

不确定您使用的是什么 HBase 版本,但不要在 hbase-site.xml中使用端口54310作为属性,而是使用端口hbase.rootdir9000

您的 /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 在 host 上naresh-pc,但是在您的配置中,您将 zookeeper quorum 设置在 hostmaster上,HBase 将绑定到它。这是一个问题。根据我的经验,HBase 对主机名非常挑剔,因此请确保它们在所有配置和 /etc/hosts 文件中都同步。

此外,这可能是一个小问题,但在 .xml 文件中指定 zookeper 数据目录以具有应该使集群工作的最小设置集不会有什么坏处:hbase.zookeeper.property.dataDir

于 2020-06-22T14:12:38.707 回答