在伪分布式模式下启动hbase失败引发“failed construction regionserver”

quhf5bfb  于 2021-07-13  发布在  Hadoop
关注(0)|答案(1)|浏览(486)

我试图在ubuntu的docker映像中运行hbase pseudo distributed。
在start-hbase.sh之后,hmaster和regionserver不能正常运行。
regionserver和主日志都显示:

ERROR [main] regionserver.HRegionServer: Failed construction RegionServer
java.io.IOException: Couldn't create proxy provider class org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
        at org.apache.hadoop.hdfs.NameNodeProxiesClient.createFailoverProxyProvider(NameNodeProxiesClient.java:261)
        at org.apache.hadoop.hdfs.NameNodeProxiesClient.createFailoverProxyProvider(NameNodeProxiesClient.java:224)
        at org.apache.hadoop.hdfs.NameNodeProxiesClient.createProxyWithClientProtocol(NameNodeProxiesClient.java:134)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:374)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:308)
        at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:184)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3414)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:158)
        at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3474)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3442)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:524)
        at org.apache.hadoop.hbase.fs.HFileSystem.<init>(HFileSystem.java:91)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.initializeFileSystem(HRegionServer.java:763)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:653)
        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:490)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.constructRegionServer(HRegionServer.java:3155)
        at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:63)
        at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:87)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
        at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:3173)

jps显示:

31168 HQuorumPeer
14801 NodeManager
2049 Jps
12435 SecondaryNameNode
12105 NameNode
14699 ResourceManager
14141 DataNode

core-site.xml是:

<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/bigdata/hadoop/tmp</value>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

hdfs-site.xml显示:

<configuration>
   <property>
<name>dfs.replication</name>
<value>1</value>
</property>

<property>
<name>dfs.namenode.name.dir</name>
<value>/usr/local/hadoop/yarn_data/hdfs/namenode</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>/usr/local/hadoop/yarn_data/hdfs/datanode</value>
</property>

<property>
<name>dfs.namenode.http-address</name>
<value>localhost:50070</value>
</property>
<configuration>

    <property>
        <name>dfs.client.failover.proxy.provider.hdfscluster</name>
        <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
    </property>
</configuration>
</configuration>

这两个配置文件都是从hadoop/etc/hadoop/软链接的,我不知道如何根据日志修复这个问题。谢谢你的帮助!
更新:修复majid指出的hdfs-site.xml中的语法错误后。

"ERROR [main] regionserver.HRegionServer: Failed construction RegionServer
java.lang.IllegalArgumentException: java.net.UnknownHostException: hdfs
        at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:448)
        at org.apache.hadoop.hdfs.NameNodeProxiesClient.createProxyWithClientProtocol(NameNodeProxiesClient.java:139)"
voj3qocg

voj3qocg1#

你的 hdfs-site.xml 格式不正确。应该是:

<configuration>
 <property>
    <name>dfs.nameservices</name>
    <value>hdfscluster</value>
 </property>

<property>
  <name>dfs.replication</name>
  <value>1</value>
</property>

<property>
<name>dfs.namenode.name.dir</name>
<value>/usr/local/hadoop/yarn_data/hdfs/namenode</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>/usr/local/hadoop/yarn_data/hdfs/datanode</value>
</property>

<property>
<name>dfs.namenode.http-address</name>
<value>localhost:50070</value>
</property>
<property>
  <name>dfs.client.failover.proxy.provider.hdfscluster</name>
  <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
</configuration>

或删除 dfs.client.failover.proxy.provider.hdfscluster 财产和 hdfs-site.xml 应该是

<configuration>
   <property>
<name>dfs.replication</name>
<value>1</value>
</property>

<property>
<name>dfs.namenode.name.dir</name>
<value>/usr/local/hadoop/yarn_data/hdfs/namenode</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>/usr/local/hadoop/yarn_data/hdfs/datanode</value>
</property>

<property>
<name>dfs.namenode.http-address</name>
<value>localhost:50070</value>
</property>
</configuration>

在启动hbase之前,请确保格式化namenode。

相关问题