我正在尝试通过Hadoop 2设置Hbase 0.94(分发设置)。我使用命令mvn -Dhadoop.profile=2.0 -DskipTests install
我将HBase / lib中的所有hadoop - * .jars替换为Hadoop 2.2中的相应内容。我仍然无法让HMaster运行。发生以下错误
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(FSUtils.java:529)
at org.apache.hadoop.hbase.master.MasterFileSystem.checkRootDir(MasterFileSystem.java:333)
at org.apache.hadoop.hbase.master.MasterFileSystem.createInitialFileSystemLayout(MasterFileSystem.java:130)
at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:115)
at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:514)
at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:376)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.protocol.FSConstants$SafeModeAction
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 7 more
如何解决这个问题?
答案 0 :(得分:0)
通过使用maven进行干净构建解决了这个问题。以下命令有效
mvn clean package assembly:assembly -DskipTests -Dhadoop.profile=2.0