以伪分布式模式配置hbase

时间:2014-04-29 11:33:02

标签: hadoop hbase apache-zookeeper

我正在尝试在伪分布式模式下配置hbase。我已经尝试了很多教程,但每次我在日志中出现此错误

2014-04-29 16:47:47,029 WARN org.apache.hadoop.hbase.master.AssignmentManager: Failed assignment of -ROOT-,,0.70236052 to serverName=localhost,60020,1398804454531, load=(requests=0, regions=0, usedHeap=0, maxHeap=0), trying to assign elsewhere instead; retry=0
org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to /127.0.0.1:60020 after attempts=1
    at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:355)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:969)
    at org.apache.hadoop.hbase.master.ServerManager.getServerConnection(ServerManager.java:620)
    at org.apache.hadoop.hbase.master.ServerManager.sendRegionOpen(ServerManager.java:555)
    at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:1043)
    at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:858)
    at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:838)
    at org.apache.hadoop.hbase.master.AssignmentManager.assignRoot(AssignmentManager.java:1304)
    at org.apache.hadoop.hbase.master.HMaster.assignRootAndMeta(HMaster.java:431)
    at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:388)
    at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:282)
Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:404)
    at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:328)
    at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:883)
    at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:750)
    at org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257)
    at com.sun.proxy.$Proxy5.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:419)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:393)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:444)
    at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:349)
    ... 10 more
2014-04-29 16:47:47,052 WARN org.apache.hadoop.hbase.master.AssignmentManager: Unable to find a viable location to assign region -ROOT-,,0.70236052

我试过以下解决方案

  • 从/ etc / hosts文件中删除127.0.1.1
  • 在hbase-env.sh
  • 中强制使用IPV4

我的hbase-site.xml就是这个

<configuration>
      <property>
           <name>hbase.rootdir</name>
            <value>file:///home/freeswitch/TryNutch/hbase</value>
       </property>
       <property>
          <name>hbase.cluster.distributed</name>
          <value>true</value>
       </property>
      <property>
           <name>hbase.zookeeper.property.dataDir</name>
           <value>/home/freeswitch/TryNutch/zookeeper</value>
       </property>
</configuration>

感谢您阅读此帖 非常需要你的帮助。

1 个答案:

答案 0 :(得分:1)

首先,如果您打算在分布式模式下运行HBase,请用适当的值替换file:///home/freeswitch/TryNutch/hbase。我可以看到hbase.cluster.distributed设置为true。将它指向您的NameNode地址。类似于hdfs://localhost:9000/hbase

另外,在hbase-site.xml文件中添加以下两个属性:

<property>
        <name>hbase.zookeeper.quorum</name>
        <value>localhost</value>
</property>
<property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2181</value>
</property>

确保您的NameNode运行正常,然后重新启动HBase守护进程。如果您仍然遇到任何问题,请尝试按照 link 进行操作。我试图详细解释这个程序。如果您仍然遇到任何问题,请告诉我。

HTH