Java – HBase 0.94.4 on Hadoop 2.2.0

HBase 0.94.4 on Hadoop 2.2.0… here is a solution to the problem.

HBase 0.94.4 on Hadoop 2.2.0

I’m trying to set up Hbase 0.94 (distributed setup) on Hadoop 2. I recompiled HBase to support Hadoop 2 using the command mvn -Dhadoop.profile=2.0 -DskipTests install

I replaced all hadoop-*.jars in HBase/lib with their counterparts in Hadoop 2.2. Still can’t get HMaster running. The following error occurred

FATAL org.apache.hadoop.hbase.master.HMaster: HBase is having a problem with its Hadoop jars.  You may need to recompile HBase against     Hadoop version 2.2.0 or change your hadoop jars to start properly
java.lang.NoClassDefFoundError: org/apache/hadoop/hdfs/protocol/FSConstants$SafeModeAction
        at org.apache.hadoop.hbase.util.FSUtils.waitOnSafeMode(
        at org.apache.hadoop.hbase.master.MasterFileSystem.checkRootDir(
        at org.apache.hadoop.hbase.master.MasterFileSystem.createInitialFileSystemLayout(
        at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(
        at org.apache.hadoop.hbase.master.HMaster.finishInitialization(
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.protocol.FSConstants$SafeModeAction
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClassInternal(
        ... 7 more

How to solve it?


This has been addressed by using a clean build with Maven. The following command works

mvn clean package assembly:assembly -DskipTests -Dhadoop.profile=2.0

Related Problems and Solutions