Sun
wei
  Sat, Feb 28 2015 3:07 AM

Apache HBase是目前非常流行的NoSQL数据库,通过HDFS+Zookeep+Master+Region Server的架构避免了单点故障具有很高的可靠性。在Azure HDInsight中的HBase也提供了相应的功能,通过Azure Storage来代替HDFS并提供了3个zookeeper及在多个workernode上的region server,并提供每月99.9%的SLA。但是对于一些更苛刻的场景,用户还需要DR的方案来保证业务的连续性。Apache HBase自身提供了Replication的功能,这种功能类似于MySQL里面的Master-Salve部署模式,我们可以部署2套Apache
HBase Cluster来实现DR的要求。在Azure的数据中心设计时,我们也考虑到DR的情况,在每一个区域我们都提供了2个互为灾备的数据中心,在中国我们有北部和东部2个数据中心来做数据中心间的灾备,这样我们就可以利用Azure的资源来设计HBase的灾备解决方案了。

首先在设计Azure HDInsight HBase灾备的前提是网络层面的互通。Azure是一种多租户的环境,每隔客户之间的网络是相互隔离的,即便是一个客户的订阅下,北部数据中心和东部数据中心的网络也是不能互通的。为了达到这种互通的效果,我们需要借助Azure Virtual Network以及Site-to-Site VPN技术将2个数据中心的网络层进行互联,具体可以参考 https://msdn.microsoft.com/library/azure/dn133795.aspx

其次我们还需要处理名称解析的问题。处于安全考虑Azure默认提供的DNS只能解析一个云服务内的名称解析,对于这种跨Azure数据中心的名称解析,我们可以通过自己搭建DNS并在虚拟网络里设定DNS的方法来处理,将2个Cluster里面的服务器通过手工的方法注册到DNS之中。

最后的步骤就是创建HBase Cluster了。由于需要在部署Hbase的时候指定虚拟网络并修改hbase-site.xml,所以我们需要通过Powershell脚本的方式来创建。下面的示例脚本可以帮我们在2个数据中心中创建我们需要的2个cluster

#default storage account name for HDInsight cluster

$storageAccountName01="Your storage account name in China North"

$storageAccountName02="Your storage account name in China East"

#default storage container name for HDInsight cluster, the container is used to save the hadoop system files and samples

$containerName01="Your cluster storage account container name in China North"

$containerName02="Your cluster storage account container name in China East"

#get storage primary access key

$storageAccountKey01=Get-AzureStorageKey $storageAccountName01| %{$_.Primary}

$storageAccountKey02=Get-AzureStorageKey $storageAccountName02| %{$_.Primary}

#define cluster name

$clusterName01="Your cluster Name in China North"

$clusterName02="Your cluster name in China East"

#define cluster location

$location01="China North"

$location02="China East"

#define cluster node count

$clusterNodes=1

#define hadoop cluster username and password

$clusterUserName="your admin name"

$clusterPassword="your admin password”

$password=ConvertTo-SecureString $clusterPassword -AsPlainText -Force

$cred=New-Object System.Management.Automation.PSCredential($clusterUserName,$password)

#define Chine HDInsight endpoint

$MCEndpoint="core.chinacloudapi.cn"

$VNetName01="Your vnet name in China North"

$SubnetName01="Your subnet name in China North"

$VNetName02=" Your vnet name in China East"

$SubnetName02=" Your subnet name in China East"

$vnetID01=(Get-AzureVNetSite -VNetName $VNetName01).Id

$vnetID02=(Get-AzureVNetSite -VNetName $VNetName02).Id

$HBaseConfig=New-Object Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects.AzureHDInsightHBaseConfiguration

$HBaseConfig.Configuration=@{"hbase.replication"="true"}

#create cluster, you should remove Verbose and Debug parameter if you doesn't need detail information.

$confighbdrbj01 = New-AzureHDInsightClusterConfig -ClusterSizeInNodes $clusterNodes -ClusterType HBase| Set-AzureHDInsightDefaultStorage -StorageAccountName "$storageAccountName01.blob.core.chinacloudapi.cn" -StorageAccountKey $storageAccountKey01 -StorageContainerName
$containerName01| Add-AzureHDInsightConfigValues -HBase $HBaseConfig

$confighbdrbj01.VirtualNetworkId=$vnetID01

$confighbdrbj01.SubnetName=$SubnetName01

$confighbdrsh01 = New-AzureHDInsightClusterConfig -ClusterSizeInNodes $clusterNodes -ClusterType HBase| Set-AzureHDInsightDefaultStorage -StorageAccountName "$storageAccountName02.blob.core.chinacloudapi.cn" -StorageAccountKey $storageAccountKey02 -StorageContainerName
$containerName02| Add-AzureHDInsightConfigValues-HBase $HBaseConfig

$confighbdrsh01.VirtualNetworkId=$vnetID02

$confighbdrsh01.SubnetName=$SubnetName02

New-AzureHDInsightCluster -Name $clusterName01 -Config $confighbdrbj01 -Location $location01 -Credential $cred -EndPoint $MCEndpoint -Verbose -Debug

New-AzureHDInsightCluster -Name $clusterName02 -Config $confighbdrsh01 -Location $location02 -Credential $cred -EndPoint $MCEndpoint -Verbose -Debug

剩下的步骤就是在HBase里面配置Peer和table了,具体步骤可以参考http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/replication/package-summary.html

在Master cluster中添加peer,Zookeeper Quorum是指Slave Cluster的Zookeeper Qourum,可以通过http://azure.microsoft.com/en-us/documentation/articles/hdinsight-hbase-provision-vnet

里面提供的方法来获取,或者直接开启RDP登陆查看hbase-site.xml

add_peer '1','{ZookeeperQuorum}:2181:/hbase'

create ‘sampletable’,'cf1',{NAME=>'cf1',REPLICATION_SCOPE=>'1'}

然后再Slave cluster里面创建相同的table,这样就可以完成了。

Wei & Yiyu

如果你有任何疑问,欢迎访问MSDN社区,由专家来为您解答Windows
Azure各种技术问题,或者拨打世纪互联客户服务热线400-089-0365/010-84563652咨询各类服务信息。

本文转载自: http://blogs.msdn.com/b/cciccat/archive/2015/02/28/azure-hdinsight-hbase-dr.aspx



Azure HDInsight HBase DR解决方案的更多相关文章

  1. 在Azure HDInsight HBase集群中使用Thrift接口

    Sun wei  Wed, Feb 25 2015 2:17 AM Apache Thrift 是一种可扩展的跨语言服务接口,可以通过内置的代码生成引擎帮助创建跨语言服务类库,Apache HBase ...

  2. HBase(三): Azure HDInsigt HBase表数据导入本地HBase

    目录: hdfs 命令操作本地 hbase Azure HDInsight HBase表数据导入本地 hbase hdfs命令操作本地hbase: 参见  HDP2.4安装(五):集群及组件安装 , ...

  3. Azure HDInsight 和 Spark 大数据实战(一)

    What is HDInsight? Microsoft Azure HDInsight 是基于 Hortonoworks Data Platform (HDP) 的 Hadoop 集群,包括Stor ...

  4. Windows Azure HDInsight 支持预览版 Hadoop 2.2 群集

     Windows Azure HDInsight 支持预览版 Hadoop 2.2 群集 继去年 10 月推出 Windows Azure HDInsight 之后,我们宣布 Windows Az ...

  5. Windows Azure HDInsight 现已正式发布!

    今天,我们宣布正式发布 Windows Azure HDInsight 服务.HDInsight 是 Microsoft 提供的基于 Hadoop 的服务,为云提供 100% 的 Apache Had ...

  6. HDInsight HBase概观

    HDInsight HBase概观 什么是HBase的? HBase它是基于HadoopApache开源NoSQL数据库.它提供了很多非结构化和半结构化数据一致性的随机存取能力的.它是仿照谷歌的Big ...

  7. Windows Azure HDInsight 使用技巧

    Windows Azure HDInsight是一个面向大数据的PaaS服务,是PaaS版本的Hadoop.HDInsight是微软与Hortonworks合作的产物.可以理解为Hortonworks ...

  8. Azure HDInsight 现已在中国正式发布

     今年月,我们宣布微软成为全球首家在中国公开发布云 Hadoop 产品公共预览版的云提供商.今天,微软非常高兴地宣布 AzureHDInsight现已在中国正式发布.中国本土组织以及在中国设立了办 ...

  9. SQLServer 2014 本地机房HA+灾备机房DR解决方案

    SQLServer 2014 主数据中心HA+灾备机房DR解决方案 SQLServer 2008 的时候使用 local WSFC+DR Mirror方式,对象是单数据库 两个单独的 WSFC 上使用 ...

随机推荐

  1. [旧博客]Python 第一天总结

    语法部分: 3**4 表示3的四次方 -1**3 结果是-1 raw_input 输入文本 input 输入值,input 3*3 结果为9 pow(5,5) 等于 5*5 abs(-1.8) 等于 ...

  2. mysql日志详细解析 [转]

    原文出处:http://pangge.blog.51cto.com/6013757/1319304 MySQL日志: 主要包含:错误日志.查询日志.慢查询日志.事务日志.二进制日志: 日志是mysql ...

  3. unity手游之聊天SDK集成与使用二

    集成思路 如果是自己的小游戏的话,可以把好友等信息直接保存在亲加服务器上,通过调用api来操作. 我们游戏只使用sdk的通信功能,好友等信息保存在自己的服务器上. 用户在登陆游戏的时候,通过算法用用户 ...

  4. 1016: [JSOI2008]最小生成树计数 - BZOJ

    Description 现在给出了一个简单无向加权图.你不满足于求出这个图的最小生成树,而希望知道这个图中有多少个不同的最小生成树.(如果两颗最小生成树中至少有一条边不同,则这两个最小生成树就是不同的 ...

  5. scrum敏捷开发

    团队PM:袁佩佩 scrum敏捷开发计划制定: 确定项目实施具体阶段目标 确定项目相关任务分解 确定每日站立会议进行计划 确定项目计划总结日程 确定风险解决方案

  6. Windows下的Memcache安装与测试教程

    Windows下的Memcache安装 1.下载memcache for windows. 下载地址:http://splinedancer.com/memcached-win32/,推荐下载bina ...

  7. leetcode6 Reverse Words in a String 单词取反

    Reverse Words in a String  单词取反 whowhoha@outlook.com Question: Given an input string s, reverse the ...

  8. 对jQuery.extend()方法的分析

    jQuery.extend方法是我们常用的方法,也是jQuery源码中的基础方法.它的主要作用是:将一个或多个“源对象”合并到一个“目标对象”中,并返回目标对象.它主要有三种表现形式: a.jQuer ...

  9. Unity3d大会的部分总结

    原地址:http://blog.csdn.net/sgnyyy/article/details/23775219 一.项目开发,管理和发布策略 1.       四大准则 a.       美术的资源 ...

  10. JavaScript 踩坑心得— 为了高速(上)

    一.前言 很多情况下,产品的设计与开发人员一直想打造一套高品质的解决方案,从而快速.平稳地适应产品迭代.速度是衡量产品适应性的真正且唯一的标准,而且,这并不是笔者的一家之言. 「速度是衡量适应能力的真 ...