$ ./bin/hbase org.apache.hadoop.hbase.mapreduce.CopyTable --help
/bin/hbase org.apache.hadoop.hbase.mapreduce.CopyTable --help
Usage: CopyTable [general options] [--starttime=X] [--endtime=Y] [--new.name=NEW] [--peer.adr=ADR] <tablename>
Options:
rs.class hbase.regionserver.class of the peer cluster,
specify if different from current cluster
rs.impl hbase.regionserver.impl of the peer cluster,
startrow the start row
stoprow the stop row
starttime beginning of the time range (unixtime in millis)
without endtime means from starttime to forever
endtime end of the time range. Ignored if no starttime specified.
versions number of cell versions to copy
new.name new table's name
peer.adr Address of the peer cluster given in the format
hbase.zookeeer.quorum:hbase.zookeeper.client.port:zookeeper.znode.parent
families comma-separated list of families to copy
To copy from cf1 to cf2, give sourceCfName:destCfName.
To keep the same name, just give "cfName"
all.cells also copy delete markers and deleted cells
Args:
tablename Name of the table to copy
Examples:
To copy 'TestTable' to a cluster that uses replication for a 1 hour window:
$ bin/hbase org.apache.hadoop.hbase.mapreduce.CopyTable --starttime=1265875194289 --endtime=1265878794289 --peer.adr=server1,server2,server3:2181:/hbase --families=myOldCf:myNewCf,cf2,cf3 TestTable
2条答案
按热度按时间uubf1zoe1#
我得补充一些信息。如果用hadoop命令而不是hbase命令复制表,请运行以下命令(假设版本相同)。基本上,数据在hdfs中,但在.meta文件中没有信息。所以下面就来做这个工作。
bin/hbase hbck-维修孔
但请记住,如果使用此方法进行hbase表备份,则可能存在某些数据不一致的情况。
agxfikkp2#
目前已有一些工具可用于管理此类任务(所有这些工具都记录在此处:http://hbase.apache.org/book/ops_mgt.html).
hbase copytable工具
http://hbase.apache.org/book/ops_mgt.html#copytable
hbase导出/导入工具
http://hbase.apache.org/book/ops_mgt.html#export
http://hbase.apache.org/book/ops_mgt.html#import
a) 导出数据
b) 将数据发送到远程机器
c) 导入数据
使用快照
建议用于hbase 0.94.6+。您可以在此处找到所有信息:http://hbase.apache.org/book/ops.snapshots.html