在apache hadoop2中以HA模式配置HBase所需的步骤?

时间:2017-09-08 11:06:57

标签: hbase hadoop2 high-availability

我使用的是hadoop 2.6.0和hbase 0.98.7,我为hdfs / namenode配置了HA。我有活动的nn1和待机nn2正在显示。现在问题是我无法为hbase启用高可用性,我也不明白如何将hbase与启用HA的hdfs集成。另外,在执行jps时,HMaster正在运行但无法看到hbase的UI。

我的核心site.xml

<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://ha-cluster</value>
</property>
<property>
<name>dfs.journalnode.edits.dir</name>
<value>/opt/hadoop/HA/data/jn</value>
</property>
</configuration>

我的hdfs site.xml

<configuration>
 <property>
 <name>dfs.namenode.name.dir</name>
 <value>/opt/hadoop/HA/data/namenode</value>
 </property>
 <property>
 <name>dfs.replication</name>
 <value>1</value>
 </property>
 <property>
 <name>dfs.permissions</name>
 <value>false</value>
 </property>
 <property>
 <name>dfs.nameservices</name>
 <value>ha-cluster</value>
 </property>
 <property>
 <name>dfs.ha.namenodes.ha-cluster</name>
 <value>nn1,nn2</value>
 </property>
 <property>
 <name>dfs.namenode.rpc-address.ha-cluster.nn1</name>
 <value>nn1.cluster.com:9000</value>
 </property>
 <property>
 <name>dfs.namenode.rpc-address.ha-cluster.nn2</name>
 <value>nn2.cluster.com:9000</value>
 </property>
 <property>
 <name>dfs.namenode.http-address.ha-cluster.nn1</name>
 <value>nn1.cluster.com:50070</value>
 </property>
 <property>
 <name>dfs.namenode.http-address.ha-cluster.nn2</name>
 <value>nn2.cluster.com:50070</value>
 </property>
 <property>
 <name>dfs.namenode.shared.edits.dir</name>
 <value>qjournal://nn1.cluster.com:8485;nn2.cluster.com:8485;dn1.cluster.com:8485/ha-cluster</value>
 </property>
 <property>
 <name>dfs.client.failover.proxy.provider.ha-cluster</name>
 <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
 </property>
 <property>
 <name>dfs.ha.automatic-failover.enabled</name>
 <value>true</value>
 </property>
 <property>
 <name>ha.zookeeper.quorum</name>
 <value>nn1.cluster.com:2181,nn2.cluster.com:2181,dn1.cluster.com:2181</value>
 </property>
 <property>
 <name>dfs.ha.fencing.methods</name>
 <value>shell(/bin/true)</value>
 </property>
 <property>
 <name>dfs.ha.fencing.ssh.private-key-files</name>
 <value>/home/hadoop/.ssh/id_rsa</value>
 </property>
</configuration>

我的hbase site.xml

<configuration>
<property>
<name>hbase.master</name>
<value>test-hmaster-1-aws.icare.com:60000</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://ha-cluster/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>test-hmaster-1-aws.icare.com,test-hslave-1-aws.icare.com,test-kerberos-aws.icare.com</value>
</property> 
</configuration>

1 个答案:

答案 0 :(得分:0)

首先,在配置HDFS HA后,您的<ControlTemplate x:Key="FlatButton" TargetType="Button"> <Grid Background="{TemplateBinding Background}" TextBlock.Foreground="{TemplateBinding Foreground}"> <Rectangle Fill="White" Opacity="0." x:Name="Overlay" /> <Rectangle Fill="Gray" Opacity="0." x:Name="OverlayDark" /> <ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup Name="CommonStates"> <VisualState Name="Normal"> <VisualState.Storyboard> <Storyboard TargetName="Overlay" TargetProperty="Opacity"> <DoubleAnimation To="0.0" Duration="0:0:0.1" /> </Storyboard> </VisualState.Storyboard> </VisualState> <VisualState Name="MouseOver"> <VisualState.Storyboard> <Storyboard TargetName="Overlay" TargetProperty="Opacity"> <DoubleAnimation To="0.5" Duration="0:0:0.1" /> </Storyboard> </VisualState.Storyboard> </VisualState> <VisualState Name="Pressed"> <Storyboard TargetName="OverlayDark" TargetProperty="Opacity"> <DoubleAnimation To="0.5" Duration="0:0:0.1" /> </Storyboard> </VisualState> <VisualState Name="Disabled"> <Storyboard TargetName="OverlayDark" TargetProperty="Opacity"> <DoubleAnimation To="1" Duration="0:0:0.1" /> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> 变为fs.defaultFS。您还在hdfs://ha-cluster hbase.rootdir中将其用作hbase-site.xml的一部分。因此, ARE 与启用HA的HDFS集成。没有更多事情要做。

其次,HBase HA与HDFS HA不同。基本上,您需要配置多个HBase主实例。其中一个是主动主机,其余主机实例成为备用主机。

说实话,我有点被Cloudera Manager破坏了,你需要做的就是启用HBase HA来添加多个HBase实例。但是,如果您不使用HBase的任何供应商分发并且必须手动配置它,则可以按照此处的说明进行操作 http://hbase.apache.org/book.html#quickstart_fully_distributed

第三,我不知道为什么无法访问主UI。但由于您的实例位于AWS中,您可能需要配置安全组设置以打开端口访问权限吗?