我正在尝试用hadoop ha设置hbase ha。我已经设置了hadoop ha setup并进行了测试。
但是在hbase设置中,启动时,我收到以下错误
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster.
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2426)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:231)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:137)
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:2436)
Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: hdfs-nameservice
at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:373)
at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:258)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:153)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:602)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:547)
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:2625)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2607)
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:1003)
at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:570)
at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:381)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2419)
... 5 more
Caused by: java.net.UnknownHostException: hdfs-nameservice
... 25 more
我认为我的hbase设置无法识别我的名字服务hdfs-nameservice。
我正在使用Hbase 1.2.4&amp; Hadoop 2.7.3。
我的hbase-site.xml有
<property>
<name>hbase.rootdir</name>
<value>hdfs://hdfs-nameservice/hbase</value>
</property>
core-site.xml有
<property>
<name>fs.defaultFS</name>
<value>hdfs://hdfs-nameservice:8020</value>
</property>
和hdfs-site.xml有
<property>
<name>dfs.nameservices</name>
<value>hdfs-nameservice</value>
</property>
<property>
<name>dfs.ha.namenodes.hdfs-nameservice</name>
<value>namenode1,namenode2</value>
</property>
//with rpc, http address confs for both namenode1&2
尝试: 1.在hbase conf目录中复制核心和hdfs-site xmls。 2.在环境变量和hbase-env.sh
中添加了Hadoop conf路径仍然无法弄清楚如何让我的hbase识别hdfs-nameservice。
非常感谢任何帮助。