【问题标题】:Hbase HDFS integration - Hbase Master not startingHbase HDFS 集成 - Hbase Master 未启动
【发布时间】:2015-04-02 10:46:05
【问题描述】:

我已经配置了在一个虚拟机上并行运行的 linux 发行版的两个节点集群。

两个linux发行版/etc/hosts文件内容如下

hduser@ubuntu-master:~$ cat /etc/hosts
192.168.56.103  Ubuntu-Master master
192.168.56.102  LinuxMint-Slave slave
10.33.136.219   inkod2lp00100.techmahindra.com inkod2lp00100


hduser@LinuxMint-Slave ~ $ cat /etc/hosts
192.168.56.103  Ubuntu-Master master
192.168.56.102  LinuxMint-Slave slave
10.33.136.219   inkod2lp00100.techmahindra.com inkod2lp00100

两个linux发行版中hbase-site.xml(位置-/usr/local/hbase/conf)的内容如下-

hduser@ubuntu-master:~$ cat /usr/local/hbase/conf/hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

<property>
  <name>hbase.tmp.dir</name>
  <value>file:///usr/local/hbase/hbasetmp/hbase-${user.name}</value>
</property>

<property>
    <name>hbase.master</name>
    <value>Ubuntu-Master:16000</value>
    <description>The host and port that the HBase master runs at.</description>
</property>

  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://Ubuntu-Master:54310/hbase</value>
  </property>

<property>
  <name>hbase.cluster.distributed</name>
  <value>true</value>
</property>

<property>
  <name>hbase.zookeeper.quorum</name>
  <value>Ubuntu-Master,LinuxMint-Slave</value>
</property>

   <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>file:///usr/local/hbase/zookeeperdata</value>
  </property>

<property>
     <name>hbase.zookeeper.property.clientPort</name>
   <value>2222</value>
 </property>
</configuration>

hduser@LinuxMint-Slave ~ $ cat /usr/local/hbase/conf/hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>

<property>
  <name>hbase.tmp.dir</name>
  <value>file:///usr/local/hbase/hbasetmp/hbase-${user.name}</value>
</property>

<property>
<name>hbase.master</name>
<value>Ubuntu-Master:16000</value>
<description>The host and port that the HBase master runs at.</description>
</property>

  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://Ubuntu-Master:54310/hbase</value>
  </property>

<property>
  <name>hbase.cluster.distributed</name>
  <value>true</value>
</property>

<property>
  <name>hbase.zookeeper.quorum</name>
  <value>Ubuntu-Master,LinuxMint-Slave</value>
</property>


  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>file:///usr/local/hbase/zookeeperdata</value>
  </property>

<property>
     <name>hbase.zookeeper.property.clientPort</name>
   <value>2222</value>
 </property>

</configuration>

但是当我在 Master Node 中启动 HBase 服务时,每次 HMaster 都没有启动,初始启动后 HMaster 失败

请检查服务状态:

hduser@ubuntu-master:~$ jps

3793 SecondaryNameNode
5332 HQuorumPeer
4006 ResourceManager
4134 NodeManager
4883 JobHistoryServer
6286 Jps
3512 NameNode
3637 DataNode
5535 HRegionServer

hduser@LinuxMint-Slave ~ $ jps
2504 DataNode
3175 HQuorumPeer
2651 NodeManager
3681 Jps
3291 HRegionServer

这里是 HMaster 服务的日志文件

2015-02-03 12:21:14,168 WARN  [Thread-12] hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471) ………………….

……………………..
2015-02-03 12:21:14,185 DEBUG [master:Ubuntu-Master:60000] util.FSUtils: Unable to create version file at hdfs://Ubuntu-Master:54310/hbase, retrying
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471)

…………………………………………

2015-02-03 12:21:24,285 WARN  [Thread-15] hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471)

……………………………………………………….
2015-02-03 12:21:24,286 DEBUG [master:Ubuntu-Master:60000] util.FSUtils: Unable to create version file at hdfs://Ubuntu-Master:54310/hbase, retrying
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471)
……………………………………………..

2015-02-03 12:21:34,312 WARN  [Thread-17] hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471)
……………………………………………………………….
2015-02-03 12:21:44,333 FATAL [master:Ubuntu-Master:60000] master.HMaster: Unhandled exception. Starting shutdown.
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
…………………………………….

    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:514)
2015-02-03 12:21:44,334 INFO  [master:Ubuntu-Master:60000] master.HMaster: Aborting
2015-02-03 12:21:44,334 DEBUG [master:Ubuntu-Master:60000] master.HMaster: Stopping service threads
2015-02-03 12:21:44,335 INFO  [master:Ubuntu-Master:60000] ipc.RpcServer: Stopping server on 60000
2015-02-03 12:21:44,335 INFO  [RpcServer.listener,port=60000] ipc.RpcServer: RpcServer.listener,port=60000: stopping
2015-02-03 12:21:44,339 INFO  [RpcServer.responder] ipc.RpcServer: RpcServer.responder: stopped
2015-02-03 12:21:44,339 INFO  [RpcServer.responder] ipc.RpcServer: RpcServer.responder: stopping
2015-02-03 12:21:44,339 INFO  [master:Ubuntu-Master:60000] master.HMaster: Stopping infoServer
2015-02-03 12:21:44,364 INFO  [master:Ubuntu-Master:60000] mortbay.log: Stopped SelectChannelConnector@0.0.0.0:60010
2015-02-03 12:21:44,508 INFO  [main-EventThread] zookeeper.ClientCnxn: EventThread shut down
2015-02-03 12:21:44,509 INFO  [master:Ubuntu-Master:60000] zookeeper.ZooKeeper: Session: 0x14b4e1d0a040002 closed
2015-02-03 12:21:44,510 INFO  [master:Ubuntu-Master:60000] master.HMaster: HMaster main thread exiting
2015-02-03 12:21:44,510 ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: HMaster Aborted
    at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:194)
    at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:135)
    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.master.HMaster.main(HMaster.java:2803)
2015-02-03 12:21:44,515 ERROR [Thread-5] hdfs.DFSClient: Failed to close file /hbase/.tmp/hbase.version
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) running and no node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1471)

【问题讨论】:

    标签: hbase hdfs


    【解决方案1】:

    我最近遇到了完全相同的问题。

    克服它的方法很简单,但是危险

    您肯定会丢失 HDFS 上的所有数据。

    您应该执行以下操作:

    1. 停止所有hadoop服务:stop-hbase.sh &amp;&amp; stop-yarn.sh &amp;&amp; stop-dfs.sh
    2. 删除master和slave上的所有HDFS数据,你可以在hadoop的/etc/hadoop/hdfs-site.xml中找到路径,在我的例子中,我必须删除的文件夹是/home/hadoop/hadoopdata/hdfs/namenode/home/hadoop/hadoopdata/hdfs/datanode

    相反,您可以简单地删除两台服务器上的/home/hadoop/hadoopdata 目录。

    这是您可能需要查找的配置文件:

        <property>
            <name>dfs.name.dir</name>
            <value>file:///home/hadoop/hadoopdata/hdfs/namenode</value>
        </property>
    
        <property>
            <name>dfs.data.dir</name>
            <value>file:///home/hadoop/hadoopdata/hdfs/datanode</value>
        </property>
    
    1. 在 master 上运行:hadoop namenode -formatnamenode 部分对您来说可能不同)。

    2. 在从属设备上运行:hadoop datanode -formatdatanode 部分对您来说可能再次不同)。

    3. 启动hadoop等服务:start-dfs.sh &amp;&amp; start-yarn.sh &amp;&amp; start-hbase.sh

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-14
      • 1970-01-01
      相关资源
      最近更新 更多