启动HBASE,java.lang.ClassNotFoundException:org.apache.htrace.SamplerBuilder

时间:2018-11-01 18:08:45

标签: java hadoop hbase

我正在尝试使用start-hbase.sh启动HBASE,但是出现错误:java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder.

我尝试将各种.jar添加到各种文件夹(如其他线程中所建议),但是没有任何效果。我正在使用Hadoop 3.11和HBase 2.10,这是(结束)错误日志。

java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster. 
    at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2972)
    at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:236)
    at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
    at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2983)
Caused by: java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:635)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:619)
    at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:149)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2669)
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94)
    at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2703)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2685)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:373)
    at org.apache.hadoop.fs.Path.getFileSystem(Path.java:295)
    at org.apache.hadoop.hbase.util.CommonFSUtils.getRootDir(CommonFSUtils.java:358)
    at org.apache.hadoop.hbase.util.CommonFSUtils.isValidWALRootDir(CommonFSUtils.java:407)
    at org.apache.hadoop.hbase.util.CommonFSUtils.getWALRootDir(CommonFSUtils.java:383)
    at org.apache.hadoop.hbase.regionserver.HRegionServer.initializeFileSystem(HRegionServer.java:691)
    at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:600)
    at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:484)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
    at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2965)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    ... 25 more

3 个答案:

答案 0 :(得分:2)

HBase 2.1.0发行版使用HTrace,这是一个正在孵化的Apache Foundation项目。

HBase的lib文件夹client-facing-thirdparty中有一个用于第三方库的文件夹。您需要将htrace-core-3.1.0-incubating.jar从那里复制到HBase lib目录。 (see reference)

Cloudera Community处还有另一种解决方案,它可以更改配置而不是手动添加库。

答案 1 :(得分:1)

Hbase和Hadoop之间似乎存在兼容性问题,我转而使用Hadoop 2.9.1和Hbase 1.2.6以及JDK 1.8.0

答案 2 :(得分:0)

HBase 2.1.4在htrace-core-3.1.0-incubating.jar中没有client-facing-thirdparty

您需要从2.1.3复制或从https://mvnrepository.com/artifact/org.apache.htrace/htrace-core下载