hbase0.98.9 Export工具使用
来源:互联网 发布:avast淘宝激活 编辑:程序博客网 时间:2024/06/05 02:48
最近,因为公司准备要更换数据中心;因此,需要将hbase数据库中的数据进行迁移。在进行hbase数据库数据迁移时,使用其自带的工具import和export是很方便的。只不过,在迁移大量数据时,可能需要运行很长的时间,甚至可能出错。这时,是可以通过指定行键范围和列族,来减少单次export工具的运行时间。
我们来看一下,export工具支持的参数,如下:
Usage: Export [-D <property=value>]* <tablename> <outputdir> [<versions> [<starttime> [<endtime>]] [^[regex pattern] or [Prefix] to filter]]
Note: -D properties will be applied to the conf used.
For example:
-D mapred.output.compress=true
-D mapred.output.compression.codec=org.apache.hadoop.io.compress.GzipCodec
-D mapred.output.compression.type=BLOCK
Additionally, the following SCAN properties can be specified
to control/limit what is exported..
-D hbase.mapreduce.scan.column.family=<familyName>
-D hbase.mapreduce.include.deleted.rows=true
-D hbase.mapreduce.scan.row.start=<ROWSTART>
-D hbase.mapreduce.scan.row.stop=<ROWSTOP>
For performance consider the following properties:
-Dhbase.client.scanner.caching=100
-Dmapred.map.tasks.speculative.execution=false
-Dmapred.reduce.tasks.speculative.execution=false
For tables with very wide rows consider setting the batch size as below:
-Dhbase.export.scanner.batch=10
可以看出,支持的选项有好几个。假如,我们想导出表test的数据,且只要列族Info,行键范围在000到001之间,可以这样写:
./hbase org.apache.hadoop.hbase.mapreduce.Export -D hbase.mapreduce.scan.column.family=Info -D hbase.mapreduce.scan.row.start=000 -D hbase.mapreduce.scan.row.stop=001 test /test_datas
这样就可以了,且数据将会保存在hdfs中。
通过指定列族和行键范围,可以只导出部分数据,避免export启动的mapreduce任务运行时间过长。也就是可以分多次导出数据。
- hbase0.98.9 Export工具使用
- Oracle Export/Import工具使用介绍
- Oracle Export/Import工具使用介绍
- Oracle工具使用(export,import,sql…
- Hbase0.98基本使用
- Oracle工具使用(export,import,sqlldr中文帮助及实例))
- Sqoop-1.4.4工具import和export使用详解
- Sqoop-1.4.4工具import和export使用详解
- Sqoop-1.4.4工具import和export使用详解
- Sqoop-1.4.4工具import和export使用详解
- Sqoop-1.4.4工具import和export使用详解
- Sqoop-1.4.4工具import和export使用详解
- hbase的export以及import工具使用练习
- Sqoop-1.4.4工具import和export使用详解
- Sqoop-1.4.4工具import和export使用详解
- HBase0.89常用API接口使用
- Hive0.10+Hbase0.96整合使用
- import export default export的使用
- 爬虫 取得站内最大页数
- 添加和处理动作(Adding and Handling Actions)
- (MFC)任务对话框CTaskDialog类
- android中的color文件
- MVC和MVP的梳理
- hbase0.98.9 Export工具使用
- __stdcall与__cdecl的区别
- ERROR: Cannot determine the location of the VS Common Tools folder.
- Java千百问_05面向对象(006)_is-a,has-a,like-a是什么
- 51Nod-1027-大数乘法
- xmpp开发IM即时通讯系列(二)--即时通讯服务器搭建(1)数据库搭建
- POJ 2186 Tarjan
- hiho 31 扫雷二
- VS用C语言连接SQL Server解决办法