启动hbase,java.lang.classnotfoundexception:org.apache.htrace.samplerbuilder

tgabmvqs  于 2021-06-01  发布在  Hadoop
关注(0)|答案(3)|浏览(589)

我正在尝试用start-hbase.sh启动hbase,但是,出现错误: java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder. 我尝试添加了各种 .jar ,但没有任何效果。我使用的是hadoop3.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
niwlg2el

niwlg2el1#

hbase和hadoop之间似乎存在兼容性问题,我恢复使用hadoop2.9.1和hbase 1.2.6以及jdk1.8.0

jjjwad0x

jjjwad0x2#

HBAS2.1.0发布使用HTrink,这是一个孵化的Apache基金会项目。
hbase中有一个用于第三方库的文件夹 lib 文件夹, client-facing-thirdparty . 你需要复制 htrace-core-3.1.0-incubating.jar 从那里到hbase lib目录((见参考文献)
cloudera社区还有另一个解决方案,它可以更改配置,而不是手动添加库。

nwwlzxa7

nwwlzxa73#

hbase 2.1.4没有 htrace-core-3.1.0-incubating.jarclient-facing-thirdparty 您需要从2.1.3中复制或从下载https://mvnrepository.com/artifact/org.apache.htrace/htrace-core

相关问题