HBase中的拷贝表功能,HBase拷贝表功能
在使用HBase时,建立表的记录数目很多,想对表进行split操作,但又想以一个大的region来进行比较。所以想到拷贝表。找找命令,HBase有拷贝表的命令:CopyTable
CopyTable is a utility that can copy part or of all of a table, either to the same cluster or another cluster. The target table must first exist. The usage is as follows:
$ bin/hbase org.apache.hadoop.hbase.mapreduce.CopyTable [--starttime=X] [--endtime=Y] [--new.name=NEW] [--peer.adr=ADR] tablename
Options:
starttimeBeginning of the time range. Without endtime means starttime to forever.endtimeEnd of the time range. Without endtime means starttime to forever.versionsNumber of cell versions to copy.new.nameNew table's name.peer.adrAddress of the peer cluster given in the format hbase.zookeeper.quorum:hbase.zookeeper.client.port:zookeeper.znode.parentfamiliesComma-separated list of ColumnFamilies to copy.all.cellsAlso copy delete markers and uncollected deleted cells (advanced option).
Args:
- tablename Name of table to copy.
Example of copying '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 TestTable
注意:若用到--new.name =xxx,首先这个新表要之前就被定义。
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。