hbase数据导出导入,数据备份,数据迁移(仅解决非通信集群)
2017-05-11 10:32
567 查看
如题,只说明非通信集群,hbase版本是1.1.10,属于1.1.x系列,跨大版本这个事情另外讨论,参考官网。
面对的环境数据量较大(就是比较小没有几个PB的意思),新老集群无法通信。二步解决,export/import大量坑,在此不表,选用手动方式。
Usage: hadoop fs -copyFromLocal <localsrc> URI
Similar to the fs -put command, except that the source is restricted to a local file reference.
Options:
-p : Preserves access and modification times, ownership and the permissions. (assuming the permissions can be propagated across filesystems)
-f : Overwrites the destination if it already exists.
-l : Allow DataNode to lazily persist the file to disk, Forces a replication factor of 1. This flag will result in reduced durability. Use with care.
-d : Skip creation of temporary file with the suffix ._COPYING_.
copyToLocal
Usage: hadoop fs -copyToLocal [-ignorecrc] [-crc] URI <localdst>
Similar to get command, except that the destination is restricted to a local file reference.
找到你现在的hbase的数据在hdfs的位置
然后把数据转移到另外一个集群上去
值得注意的是如果是新集群,可能没有/hbase/data/default/这个文件夹,最好的方式是在hbase中建一个测试表,
查看确认下新的集群的hbase数据信息是否在对应位置。
数据导入到指定的文件夹之后,修复分区和表的元信息,(没有使用rbuy的各种脚本,0.9之后就D了,)
hbase hbck -fixTableOrphans 表名
hbase hbck -fixMeta 表名
hbase hbck -fixAssignments 表名
hbase hbck -repair 表名
list 、scan和get命令,测试数据在新集群中时候可用
面对的环境数据量较大(就是比较小没有几个PB的意思),新老集群无法通信。二步解决,export/import大量坑,在此不表,选用手动方式。
一、导出、导入数据
copyFromLocalUsage: hadoop fs -copyFromLocal <localsrc> URI
Similar to the fs -put command, except that the source is restricted to a local file reference.
Options:
-p : Preserves access and modification times, ownership and the permissions. (assuming the permissions can be propagated across filesystems)
-f : Overwrites the destination if it already exists.
-l : Allow DataNode to lazily persist the file to disk, Forces a replication factor of 1. This flag will result in reduced durability. Use with care.
-d : Skip creation of temporary file with the suffix ._COPYING_.
copyToLocal
Usage: hadoop fs -copyToLocal [-ignorecrc] [-crc] URI <localdst>
Similar to get command, except that the destination is restricted to a local file reference.
找到你现在的hbase的数据在hdfs的位置
hadoop fs -copyToLocal /hbase/data/default/表名 存放数据的路径
然后把数据转移到另外一个集群上去
Hadoop fs -copyFromLocal 准备导入的数据文件夹 /hbase/data/default/表名
值得注意的是如果是新集群,可能没有/hbase/data/default/这个文件夹,最好的方式是在hbase中建一个测试表,
查看确认下新的集群的hbase数据信息是否在对应位置。
二、修复数据meta与分区
因为分区信息发生了改变,元信息没有同步。数据导入到指定的文件夹之后,修复分区和表的元信息,(没有使用rbuy的各种脚本,0.9之后就D了,)
hbase hbck -fixTableOrphans 表名
hbase hbck -fixMeta 表名
hbase hbck -fixAssignments 表名
hbase hbck -repair 表名
list 、scan和get命令,测试数据在新集群中时候可用
相关文章推荐
- Hbase数据备份导入导出
- HBase数据备份及恢复(导入导出)的常用方法
- Mysql数据库备份,Mysql数据导入导出,命令行
- mysql导入导出数据中文乱码解决方法小结
- Hadoop数据工具sqoop,导入HDFS,HIVE,HBASE,导出到oracle
- 搞定linux上MySQL编程(四):数据导入导出和备份
- oracle数据导入、导出备份操作
- 《06. oracle 数据管理--导入&导出&备份&恢复》
- mysql导入导出数据中文乱码解决方法小结
- bugzilla如何备份数据,导入导出数据库
- HBase数据的导入和导出
- Oracle数据导入导出,定时备份
- mysql数据库的备份、导入、导出命令,以及数据的导入、导出
- 从零自学Hadoop(16):Hive数据导入导出,集群数据迁移上
- Linux环境中Oracle数据导入与导出备份创建用户操作
- HBase数据导入导出(export import)
- DB2数据库备份与恢复和导出表结构与导入导出表数据
- Sqoop_详细总结 使用Sqoop将HDFS/Hive/HBase与MySQL/Oracle中的数据相互导入、导出
- db2导入导出单表数据 db2备份恢复
- [forwarding] mysql数据库的备份、导入、导出命令,以及数据的导入、导出