网站首页 > 技术教程 正文
# 在源集群中创建快照
(linux shell) hbase snapshot -t <table_name> -n <snapshot_name>
或(hbase shell) snapshot <table_name>, <snapshot_name>
# 将快照从源集群导出到目标集群
(linux shell) hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot <table_name> -copy-from hdfs://<source_cluster>/hbase -copy-to hdfs://<target_cluster>/hbase -mappers 200 -bandwidth 20 -chuser hbase -chgroup hbase -overwrite
或
(linux shell) hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot <table_name> -copy-from hdfs://namenodeip:8020/hbase -copy-to hdfs://namenodeip:8020/hbase -mappers 200 -bandwidth 20 -chuser hbase -chgroup hbase -overwrite
参数:
-mappers ->任务map数
-bandwidth -> 网络带宽最大使用量
-chuser -> 所有者
-chgroup -> 所有组
-overwrite ->覆盖
注意:
-chuser hbase -chgroup hbase必须加,否则在clone时会有权限问题,导致clone失败
补充:
有些时候执行完任务,在目标集群并不能找到对应快照,再执行一次,会在很短时间内完成
# 在目标hbase中从快照恢复表
(hbase shell) clone_snapshot <snapshot_name>,<table_name>
补充:恢复完需验证数据,有些时候数据检索不到,drop后,再重新clone出来可恢复
# 在目标集群中删除快照
(hbase shell) delete_snapshot <snapshot_name>
# 在源集群中删除快照和表
(hbase shell) delete_snapshot <snapshot_name>
(hbase shell) disable <tablename>(数据同步时无需执行)
(hbase shell) drop <tablename>(数据同步时无需执行)
TIPS:
正常集群内的表及数据目录:
/hbase/data/default/
通过快照传输过去的表数据在hdfs的目录:
/hbase/archive/data/default/,且表名与源集群表名相同
克隆出的表也存在于/hbase/data/default/,表名取决于clone时的命名,drop后会删除,但不会删除原始数据目录(/hbase/archive/data/default/)
猜你喜欢
- 2024-11-11 Oct 2019 Psychology Industry Snapshot (I)
- 2024-11-11 一次snapshot迁移引发的Hbase RIT(hbase2.1.0-cdh6.3.0)
- 2024-11-11 mac截图工具推荐:Screen Snapshot mac版
- 2024-11-11 maven发布jar包到nexus(maven将jar包打包到本地仓库中)
- 2024-11-11 maven依赖冲突以及解决方法(maven依赖冲突原则)
- 2024-11-11 心理行业速递》| 2019.10上 Psychology Industry Snapshot(下)
- 2024-11-11 为什么SpringBoot的 jar 可以直接运行?
- 2024-11-11 Physical Standby 和Snapshot Standby相互转换
- 2024-11-11 VR射击游戏《Snapshot VR》EA版本即将上线Steam
- 2024-11-11 Maven无法拉取SNAPSHOT依赖的解决办法
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)