设为首页 收藏本站
查看: 888|回复: 0

[经验分享] hadoop(四): 本地 hbase 集群配置 Azure Blob Storage

[复制链接]

尚未签到

发表于 2017-6-30 13:24:08 | 显示全部楼层 |阅读模式
        基于 HDP2.4安装(五):集群及组件安装  创建的hadoop集群,修改默认配置,将hbase 存储配置为 Azure Blob Storage
  目录:


  • 简述
  • 配置
  • 验证
  • FAQ
  简述:



  • hadoop-azure 提供hadoop 与 azure blob storage 集成支持,需要部署 hadoop-azure.jar 程序包,在HDP2.4 安装包中已默认提供,如下图:
  • DSC0000.png
  • 配置成功后,读写的数据都存储在 Azure Blob Storage account
  • 支持配置多个 Azure Blob Storage account, 实现了标准的 Hadoop FileSystem interface
  • Reference file system paths using URLs using the wasb scheme.
  • Tested on both Linux and Windows. Tested at scale.
  • Azure Blob Storage 包含三部分内容:



    • Storage Account: All access is done through a storage account
    • Container: A container is a grouping of multiple blobs. A storage account may have multiple containers. In Hadoop, an entire file system hierarchy is stored in a single container. It is also possible to configure multiple containers, effectively presenting multiple file systems that can be referenced using distinct URLs.
    • Blob: A file of any type and size. In Hadoop, files are stored in blobs. The internal implementation also uses blobs to persist the file system hierarchy and other metadata

  配置 :



  • 在 china Azure  门户(https://manage.windowsazure.cn) 创建一个 blob storage Account, 如下图命名:localhbase
  • DSC0001.png
  • 配置访问 Azure blob storage 访问证书及key以及切换文件系统配置,本地 hadoop  core-site.xml 文件,内容如下


    <property>
    <name>fs.defaultFS</name>
    <value>wasb://localhbase@localhbase.blob.core.chinacloudapi.cn</value>
    </property>
    <property>
    <name>fs.azure.account.key.localhbase.blob.core.chinacloudapi.cn</name>
    <value>YOUR ACCESS KEY</value>
    </property>
  •   在大多数场景下Hadoop clusters, the core-site.xml file is world-readable,为了安全起见,可通过配置将Key加密,然后通过配置的程序对key进行解密,此场景下的配置如下(基于安全考虑的可选配置):



    <property>
    <name>fs.azure.account.keyprovider.localhbase.blob.core.chinacloudapi.cn</name>
    <value>org.apache.hadoop.fs.azure.ShellDecryptionKeyProvider</value>
    </property>
    <property>
    <name>fs.azure.account.key.localhbase.blob.core.chinacloudapi.cn</name>
    <value>YOUR ENCRYPTED ACCESS KEY</value>
    </property>
    <property>
    <name>fs.azure.shellkeyprovider.script</name>
    <value>PATH TO DECRYPTION PROGRAM</value>
    </property>
  •   Azure Blob Storage interface for Hadoop supports two kinds of blobs, block blobs and page blobs;Block blobs are the default kind of blob and are good for most big-data use cases, like input data for Hive, Pig, analytical map-reduce jobs etc

  •   Page blob handling in hadoop-azure was introduced to support HBase log files. Page blobs can be written any number of times, whereas block blobs can only be appended to 50,000 times before you run out of blocks and your writes will fail,That won’t work for HBase logs, so page blob support was introduced to overcome this limitation

  •    Page blobs can be up to 1TB in size, larger than the maximum 200GB size for block blobs

  •   In order to have the files you create be page blobs, you must set the configuration variable fs.azure.page.blob.dir to a comma-separated list of folder names



    <property>
    <name>fs.azure.page.blob.dir</name>
    <value>/hbase/WALs,/hbase/oldWALs,/mapreducestaging,/hbase/MasterProcWALs,/atshistory,/tezstaging,/ams/hbase</value>
    </property>

  验证:



  • 上面的参数配置均在 ambari 中完成,重启参数依赖的服务
  •    命令: hdfs dfs -ls /hbase/data/default    如下图, 没有数据

  • DSC0002.png
  • 参见 HBase(三): Azure HDInsigt HBase表数据导入本地HBase  将测试表数据导入,完成后如下图:
  • DSC0003.png
  • 命令:./hbase hbck -repair -ignorePreCheckPermission
  • 命令: hbase shell
  • 查看数据,如下图,则OK
  • DSC0004.png
  • 用我们自己开发的查询工具验证数据,如下图,关于工具的开发见下一章
  • DSC0005.png
  • 参考资料: https://hadoop.apache.org/docs/current/hadoop-azure/index.html
  FAQ



  • ambari collector不要与regionserver一台机器
  • 配置ha一定要在更改数据目录到wasb之前
  • hadoop core-site.xml增加以下配置,否则mapreduce2组件会起不来,(注意impl为小写)


    <property>         
    <name>fs.AbstractFileSystem.wasb.impl</name>                           
    <value>org.apache.hadoop.fs.azure.Wasb</value>
    </property>
  •   本地自建集群,配置HA,修改集群的FS为 wasb, 然后将原hbase集群物理文件目录copy至新建的blob storage, 此时,在使用phoenix插入带有索引的表数据时出错,修改hbase-site.xml配置如下:



    <property>         
    <name>hbase.regionserver.wal.codec</name>                           
    <value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
    </property>


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-389672-1-1.html 上篇帖子: 初码-Azure系列-存储队列的使用与一个Azure小工具(蓝天助手) 下篇帖子: Azure IaaS 用户手册
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表