HBase集群数据迁移方案
来源:互联网 发布:收费站车流量数据分析 编辑:程序博客网 时间:2024/04/30 09:12
一、静态迁移方案
1、在hbase停止的状态下进行数据的迁移。
2、采用Hadoop distcp
方式,将以上目录的内容,迁移到另一个集群。
使用add_table.rb
进行恢复。
缺点:不太灵活
二、动态迁移方案
-Replication备份方案
-CopyTable方案
-Export and Import方案
1.Replication备份方案
修改hbase-site.xml
配置,增加hbase.replication
属性,
增加表属性REPLICATION_SCOPE
属性。
add_peer增加一个从集群。
2.CopyTable方案
命令:
./hbase org.apache.hadoop.hbase.mapreduce.CopyTable --peer.adr=new cluster ip:2181:/hbase_table
package org.apache.hadoop.hbase.mapreduce;/** * Tool used to copy a table to another one which can be on a different setup. * It is also configurable with a start and time as well as a specification * of the region server implementation if different from the local cluster. */public class CopyTable extends Configured implements Tool { ...}
说明:
1、拷贝完成,不需要重启机器,在new cluster中就可以看到该表。
2、稳定性还需要考虑。
3.Export and Import方案
步骤:
(1)在old cluster上执行:
./hbase org.apache.hadoop.hbase.mapreduce.Export test hdfs://new cluster ip:9000/xxx
/*** Export an HBase table.* Writes content to sequence files up in HDFS. Use {@link Import} to read it* back in again.*/public class Export { ...}
(2)在new cluster上执行:
./hbase org.apache.hadoop.hbase.mapreduce.Import test hdfs://new cluster ip:9000/xxx
package org.apache.hadoop.hbase.mapreduce;/** * Import data written by {@link Export}. */public class Import { ...}
说明:
1、一定要写绝对路径,不能写相对路径。
2、在import前,需要将表事先在new cluster中创建好。
三、手动方式
1、从源HBase集群中复制出HBase数据库表到本地目录。
[root@hadoop1 temp]# hadoop fs -get src desc
2、目标HBase导入
[root@hadoop1 temp]# hadoop fs -put src desc
3、修复.META.
表
[root@hadoop1 temp]# hbase hbck -fixMeta查看该表的meta数据:hbase(main):001:0> scan 'hbase:meta'
4、重新分配数据到各RegionServer
[root@hadoop1 temp]# hbase hbck -fixAssignments
优势:
比较灵活,安全(因为不是执行程序的,而是用命令)。
0 0
- HBase集群数据迁移方案
- HBase迁移数据方案1(两个集群不能通信)
- HBase迁移数据方案(两个集群不能通信)
- hbase集群间数据迁移
- Hbase集群间数据迁移
- Hbase集群间数据迁移方法总结
- hadoop集群间的hbase数据迁移
- Hbase集群间数据迁移方法总结 .
- HBase集群间不停服迁移数据
- 在不同hbase集群中迁移数据
- Hadoop集群间HBase数据迁移
- Hbase集群迁移
- Hbase集群迁移
- Hbase版本升级之数据迁移方案汇总
- mongodb分片集群数据迁移(方案一)
- mongodb分片集群数据迁移(方案二)
- mongodb分片集群数据迁移(方案三)
- HBase表跨集群迁移
- Asp.Net 用户验证(自定义IPrincipal和IIdentity)
- swift边学边记
- <转>MySQL Cluster (二) --- 单机搭建集群环境
- MySQL优化之——视图
- Domino中的读者域和作者域
- HBase集群数据迁移方案
- H5大会之后,未来指向何方?
- 【iOS开发之Objective-C】继承
- OpenLayers3基础教程——OL3 介绍control
- 自定义Stack
- 再议javascript变量作用域
- 使用AutoCompleteExtender实现文本框自动匹配
- IPO 首次公开募股(Initial Public Offerings,简称IPO)
- Python编写算法导论基本算法