hadoop/hbase-无法使用hdfs高可用性(故障转移)配置regionserver

yruzcnhs  于 2021-06-09  发布在  Hbase
关注(0)|答案(0)|浏览(653)

我正在尝试构建一个具有故障转移功能的hadoop架构。我的问题是我不能正确配置带有hdfs ha的regionserver。我在regionserver日志中有以下错误

java.io.IOException: Port 9000 specified in URI hdfs://HAcluster:9000 but host 'HAcluster' is a logical (HA) namenode and does not use port information.
at org.apache.hadoop.hdfs.NameNodeProxies.getFailoverProxyProviderClass(NameNodeProxies.java:396)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:134)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:510)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:453)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2433)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:88)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2467)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2449)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:367)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:166)
at org.apache.hadoop.hbase.regionserver.HRegionServer.startRegionServer(HRegionServer.java:2508)
at org.apache.hadoop.hbase.regionserver.HRegionServer.startRegionServer(HRegionServer.java:2492)
at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:62)
at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:85)
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.regionserver.HRegionServer.main(HRegionServer.java:2543)

在我的组件下面:
hadoop:2.7.1版本
hbase:0.98.12
Zookeeper:3.4.6
java:jdk甲骨文1.7\ U 75
关于架构,我有6个vm:
2个硕士学位:
hdfs(名称节点)
Yarn(资源经理)
hbase(主)
一个主机处于活动状态,另一个处于备用状态(以防第一个主机崩溃)。备用主机只是活动主机的复制
一个从机具有:
hdfs(数据节点)
Yarn(节点管理器)
hbase(区域服务器)
三个Zookeeper在专用服务器上
每个组件都处于ha(highavailability)模式下,为了做到这一点,我必须为hdfs和yarn创建逻辑集群
在不同的文件下面,它们可能有助于更好地理解:
hdfs-site.xml(定义hacluster的地方)-除了ha可用性范围之外的一些属性外,3台服务器的情况相同

<configuration>
<property>
    <name>dfs.replication</name>
    <value>1</value>
    <description>the value is the number of the copy of the file in the file system</description>
</property>
<!-- High Availability Hadoop -->
<property>
    <name>dfs.nameservices</name>
    <value>HAcluster</value> <!-- HAcluster is consisted of SUNRAY009IV06 = MASTER 1 and SUNRAY009IV07 = MASTER 2 -->
    <final>true</final>
    <description>The name of your cluster which consists of Master 1 and Master 2</description>
</property>
<property>
    <name>dfs.ha.namenodes.HAcluster</name>
    <value>SUNRAY009IV06,SUNRAY009IV07</value> <!--SUNRAY009IV06 = MASTER 1, SUNRAY009IV07 = MASTER 2 -->
    <final>true</final>
    <description>The namenodes in your cluster</description>
</property>
<property>
    <name>dfs.namenode.rpc-address.HAcluster.SUNRAY009IV06</name>
    <value>SUNRAY009IV06:9000</value> <!--SUNRAY009IV06 = MASTER 1 -->
    <description>the RPC adress of your Master 1</description>
</property>
<property>
    <name>dfs.namenode.rpc-address.HAcluster.SUNRAY009IV07</name>
    <value>SUNRAY009IV07:9000</value> <!--SUNRAY009IV07 = MASTER 2 -->
    <description>the RPC adress of your Master 2</description>
</property>
<property>
    <name>dfs.namenode.http-address.HAcluster.SUNRAY009IV06</name>
    <value>SUNRAY009IV06:50070</value> <!--SUNRAY009IV06 = MASTER 1 -->
    <description>the HTTP adress of your Master 1</description>
</property>
<property>
    <name>dfs.namenode.http-address.HAcluster.SUNRAY009IV07</name>
    <value>SUNRAY009IV07:50070</value> <!--SUNRAY009IV07 = MASTER 2 -->
    <description>the HTTP adress of your Master 2</description>
</property>
<property>
    <name>dfs.namenode.shared.edits.dir</name>
    <value>qjournal://SUNRAY009IV06:8485;SUNRAY009IV07:8485;SUNRAY009IV08:8485/HAcluster</value>
    <!--SUNRAY009IV06 = MASTER 1, SUNRAY009IV07 = MASTER 2, SUNRAY009IV08 = SLAVE 1 -->
    <description>the location of the shared storage directory</description>
</property>
<property>
    <name>dfs.client.failover.proxy.provider.HAcluster</name>
    <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
    <description>the Java class that HDFS clients use to contact the Active NameNode</description>
</property>
<property> 
    <name>dfs.permissions</name>
    <value>false</value>
    <description>disable hdfs permissions</description>
</property>
<property>
    <name>dfs.ha.automatic-failover.enabled</name>
    <value>true</value>
    <description>The backup is defined as automatic</description>
</property>
<property>
    <name>ha.zookeeper.quorum</name>
    <value>SUNRAY009IV09:2181,SUNRAY009IV11:2181,SUNRAY009IV13:2181</value>
    <description>The list of your Zookeeper servers in your Hadoop architecture</description>
    <!--SUNRAY009IV09 = ZOOKEEPER 1, SUNRAY009IV11 = ZOOKEEPER 2, SUNRAY009IV13 = ZOOKEEPER 3 -->
</property>
<property>
    <name>dfs.ha.fencing.methods</name>
    <value>sshfence</value>
    <description> method which will be used to fence the Active NameNode during a failover. 
    sshfence = SSH to the Active NameNode and kill the process</description>
</property>
<property>
    <name>dfs.ha.fencing.ssh.private-key-files</name>
    <value>/home/hadoopuser/.ssh/id_rsa</value>
    <description>List of SSH private key files</description>
</property>
<property>
    <name>dfs.ha.fencing.ssh.connect-timeout</name>
    <value>3000</value>
    <description>timeout</description>
</property>

yarn-site.xml-除ha可用性范围外的某些属性外,其他3台服务器的情况相同

<configuration>

<!-- Site specific YARN configuration properties -->
<property>
    <name>yarn.resourcemanager.hostname</name>
    <value>HAyarn</value>
    <!--HAyarn is consisted of SUNRAY009IV06 = MASTER 1 and SUNRAY009IV07 = MASTER 2 -->
    <description>The name of the Resource Manager</description>
</property>
<property>
    <name>yarn.log-aggregation-enable</name>
    <value>true</value>
    <description>to enable YARN logs</description>
</property>
<property>
    <name>yarn.nodemanager.remote-app-log-dir</name>
    <value>/tmp/logs</value>
    <description>Where to store logs in HDFS</description>
</property>
<property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
    <description>shuffle service that needs to be set for Map Reduce to run</description>
</property>
<property>
    <name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
    <value>org.apache.hadoop.mapred.ShuffleHandler</value>
    <description>mapreduce_shuffle service to implement</description>
</property>
<property>
    <name>mapreduce.jobhistory.address</name>
    <value>HAyarn:8031</value>
    <!--HAyarn is consisted of SUNRAY009IV06 = MASTER 1 and SUNRAY009IV07 = MASTER 2 -->
    <description>host is the hostname of the resource manager and  the port is the port on which the NodeManagers contact the Resource Manage</description>
</property>

<!-- High Availability YARN -->
<property>
    <name>yarn.resourcemanager.ha.enabled</name>
    <value>true</value>
</property>
<property>
    <name>yarn.resourcemanager.cluster-id</name>
    <value>HAyarn</value>
</property>
<property>
    <name>yarn.resourcemanager.ha.rm-ids</name>
    <value>rm1,rm2</value>
</property>
<property>
    <name>yarn.resourcemanager.hostname.rm1</name>
    <value>SUNRAY009IV06</value>
    <!--SUNRAY009IV06 = MASTER 1, SUNRAY009IV07 = MASTER 2-->
    <description>The hostname of MASTER 1</description>
</property>
<property>
    <name>yarn.resourcemanager.hostname.rm2</name>
    <value>SUNRAY009IV07</value>
    <!--SUNRAY009IV06 = MASTER 1, SUNRAY009IV07 = MASTER 2-->
    <description>The hostnameof MASTER 2</description>
</property>
<property>
    <name>yarn.resourcemanager.webapp.address.rm1</name>
    <value>SUNRAY009IV06:8088</value>
    <!--SUNRAY009IV06 = MASTER 1, SUNRAY009IV07 = MASTER 2-->
    <description>The Web application address of MASTER 1</description>
</property>
<property>
    <name>yarn.resourcemanager.webapp.address.rm2</name>
    <value>SUNRAY009IV07:8088</value>
    <!--SUNRAY009IV06 = MASTER 1, SUNRAY009IV07 = MASTER 2-->
    <description>The Web application address of MASTER 2</description>
</property>
<property>
    <name>yarn.resourcemanager.zk-address</name>
    <value>SUNRAY009IV09:2181,SUNRAY009IV11:2181,SUNRAY009IV13:2181</value>
    <description>The list of your Zookeeper servers in your Hadoop architecture</description>
    <!--SUNRAY009IV09 = ZOOKEEPER 1, SUNRAY009IV11 = ZOOKEEPER 2, SUNRAY009IV13 = ZOOKEEPER 3 -->
</property>
<property>
    <name>yarn.client.failover-proxy-provider.HAyarn</name>
    <value>org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider</value>
    <description>the class used for the YARN failover</description>
</property>

hbase-site.xml(3台服务器中相同)

<property>
    <name>hbase.rootdir</name>
    <value>hdfs://HAcluster/hbase</value> <!--HAcluster is consisted of SUNRAY009IV06 = MASTER 1 and SUNRAY009IV07 = MASTER 2 -->
    <description>The directory shared by RegionServers (slaves)</description>
</property>
<property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
    <description>The mode the cluster will be in</description>
</property>
<property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
    <description>Property from ZooKeeper's config zoo.cfg. The port at which the clients will connect.</description>
</property>
<property>
    <name>hbase.zookeeper.quorum</name>
    <value>SUNRAY009IV09,SUNRAY009IV11,SUNRAY009IV13</value>
    <descrption>The list of your Zookeeper servers in your Hadoop architecture</descrption>
    <!--SUNRAY009IV09 = ZOOKEEPER 1, SUNRAY009IV11 = ZOOKEEPER 2, SUNRAY009IV13 = ZOOKEEPER 3 -->
</property>
<property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/zookeeper</value>
    <description>Property from ZooKeeper's config zoo.cfg. The directory where the snapshot is stored.</description>
</property>
<property>
    <name>zookeeper.znode.parent</name>
    <value>/hbase</value>
    <description>The root znode that will contain all the znodes created/used byHBase</description>
</property>

hbase-env.sh-仅适用于


# Tell HBase whether it should manage it's own instance of Zookeeper or not.

export HBASE_MANAGES_ZK=false

在发布之前,我在谷歌上做了研究。没有什么有用的根据我,所以我做了一些尝试:-我试图改变hbase版本。我下载了最后一个(0.98.17-hadoop2)。没有效果-我尝试从头开始,这意味着:格式化hdfs,删除zookeeper元数据,删除znodes等等我试着替换hdfs://hacluster/hbase 由hdfs://master1:9000/hbase在每个有hbase的服务器上。没有效果。
所以我有点迷路了,因为即使没有逻辑集群,我仍然有错误。
ps:其余的都按预期工作:datanode/nodemanager连接到活动namenode/resourcemanager(通过web应用程序检查)hbase master也正常运行,备份master也被考虑在内(通过webapp检查),这也是我不明白为什么我有这个错误的原因
我希望我给了你所有的元素来正确理解我的问题

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题