我在尝试在5节点hadoop集群中安装Hbase时遇到了一些问题,

时间:2012-07-17 12:04:37

标签: hadoop hbase

我在尝试在5节点hadoop群集中安装Hbase时遇到了一些问题,Hmaster和Hregionservers没有运行,只有Hquorumpeer deamon在所有5个节点上运行。我使用hadoop-0.20.2和hbase-0.90.4并且hadoop工作正常。这是我的hbase-site.xml: -

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2222</value>
    <description>Property from ZooKeeper's config zoo.cfg.
 The port at which the clients will connect.
    </description>
  </property>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://master:54310/hbase</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>dfs.replication</name>
    <value>3</value>
  </property>
  <property>
    <name>hbase.hregion.max.filesize</name>
    <value>1048576</value>
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>192.168.1.25,192.168.1.26,192.168.1.27,192.168.1.28,192.168.1.29</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/opt/data/zookeeper</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.initLimit</name>
    <value>100</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.syncLimit</name>
    <value>100</value>
  </property>
  <property>
    <name>zookeeper.session.timeout</name>
    <value>1200000</value>
  </property>
</configuration>  

这是我的/ etc / hosts文件: -

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.23    adm001
192.168.1.25    master.poc.net  master hbase-master
192.168.1.28    dn2.poc.net     dn2
192.168.1.27    dn1.poc.net     dn1
192.168.1.26    dn3.poc.net     dn3
192.168.1.29    dn4.poc.net     dn4

我在主日志中运行Hbase时出现以下错误

 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-07-17 12:41:06,877 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn3.poc.net/192.168.1.26:2222
2012-07-17 12:41:06,878 WARN org.apache.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:701)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-07-17 12:41:07,499 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn2.poc.net/192.168.1.28:2222
2012-07-17 12:41:07,500 WARN org.apache.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:701)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
2012-07-17 12:41:08,549 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn1.poc.net/192.168.1.27:2222
2012-07-17 12:41:08,550 INFO org.apache.zookeeper.ClientCnxn: Socket connection established to dn1.poc.net/192.168.1.27:2222, initiating session
2012-07-17 12:41:08,554 INFO org.apache.zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2012-07-17 12:41:08,654 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn4.poc.net/192.168.1.29:2222
2012-07-17 12:41:08,755 INFO org.apache.zookeeper.ZooKeeper: Session: 0x0 closed
2012-07-17 12:41:08,756 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1064)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:142)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:102)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
        at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1078)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
        at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:809)
        at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:837)
        at org.apache.hadoop.hbase.zookeeper.ZKUtil.createAndFailSilent(ZKUtil.java:903)
 at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:133)
        at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:222)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1059)

我从hadoop lib文件夹中复制了hadoop-core.jar和其他必要的jar文件。

1 个答案:

答案 0 :(得分:2)

执行以下命令

打开端口2222
iptables -A INPUT -p tcp --dport 2222 -j ACCEPT

这应该可以解决您的问题