Hbase master啓動報錯:Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster Caused

Hbase master啓動報錯:java

java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2893)
        at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:186)
        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:2907)
Caused by: java.net.UnknownHostException: nameservice
        at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:380)
        at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:259)
        at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:153)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:547)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:492)
        at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:139)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2591)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)
        at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2643)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2625)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)
        at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)
        at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:941)
        at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:537)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2888)
        ... 5 more

 報錯緣由是hbase找不到hdfs的nameservice。docker

解決方法,在hbase的啓動CLASSPATH中加入hdfs的配置文件的路徑,core-site.xml和hdfs-site.xml。apache

若是是在docker中啓動,還須要將hdfs的配置文件的路徑掛載出來:bash

mountPath: /var/log/hbase
hostPath: /var/log/hbase
相關文章
相關標籤/搜索