HBase提供的工具
1 .压缩测试工具
hbase org.apache.hadoop.hbase.util.CompressionTest
1G数据不同的压缩算法得到的结果
+--------------------+--------------+
| MODIFIER | SIZE (bytes) |
+--------------------+--------------+
| none | 1108553612 |
+--------------------+--------------+
| compression:SNAPPY | 427335534 |
+--------------------+--------------+
| compression:LZO | 270422088 |
+--------------------+--------------+
| compression:GZ | 152899297 |
+--------------------+--------------+
| codec:PREFIX | 1993910969 |
+--------------------+--------------+
| codec:DIFF | 1960970083 |
+--------------------+--------------+
| codec:FAST_DIFF | 1061374722 |
+--------------------+--------------+
| codec:PREFIX_TREE | 1066586604 |
+--------------------+--------------+
(1)安装Sannpy 压缩
export HBASE_LIBRARY_PATH=/pathtoyourhadoop/lib/native/Linux-amd64-64
测试sannpy压缩hbase org.apache.hadoop.hbase.util.CompressionTest hdfs://host/path/to/hbase snappy(2)配置压缩
hbase-site.xml中,配置hbase.regionserver.codecs,可选的值有LZO,Snappy,GZIP
2.HFile工具
查看HFile
hbase org.apache.hadoop.hbase.io.hfile.HFile -v -f hdfs://10.81.47.41:8020/hbase/TEST/1418428042/DSMP/4759508618286845475
3.WAL工具
查看WAL文件(FSHLog文件)
hbase org.apache.hadoop.hbase.regionserver.wal.FSHLog --dump hdfs://example.org:8020/hbase/.logs/example.org,60020,1283516293161/10.10.21.10%3A60020.1283973724012
强制split WAL文件
hbase org.apache.hadoop.hbase.regionserver.wal.FSHLog --split hdfs://example.org:8020/hbase/.logs/example.org,60020,1283516293161/
HLogPrettyPrinter 打印HLog 内容
4.表拷贝工具
将一个集群中的表拷贝到另外一个表中,前提是目标集群中必须有同样的表存在。
hbase org.apache.hadoop.hbase.mapreduce.CopyTable --starttime=1265875194289 --endtime=1265878794289 --peer.adr=server1,server2,server3:2181:/hbase TestTable
其他选项:
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).
配置scan缓存:hbase.client.scanner.caching
通过表拷贝实现在线数据备份:http://blog.cloudera.com/blog/2012/06/online-hbase-backups-with-copytable-2/
5.导出表数据
hbase org.apache.hadoop.hbase.mapreduce.Export <tablename> <outputdir> [<versions> [<starttime> [<endtime>]]]
6.导入表数据
hbase org.apache.hadoop.hbase.mapreduce.Import <tablename> <inputdir>
不同hbase版本的表数据导入
hbase -Dhbase.import.version=0.94 org.apache.hadoop.hbase.mapreduce.Import <tablename> <inputdir>
7.WALPlayer
先生成HFile ,然后bulk 导入。
hbase org.apache.hadoop.hbase.mapreduce.WALPlayer /backuplogdir oldTable1,oldTable2 newTable1,newTable2
默认是分布式马屁reduce,可以改成本地模式。-Dmapred.job,traker=local
8.RowCounter CellCounter
RowCounter是一个MR程序,用于计算表的row数。
hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename> [<column1> <column2>...]
CellCount 得到的结果有:
- Total number of rows in the table.
- Total number of CFs across all rows.
- Total qualifiers across all rows.
- Total occurrence of each CF.
- Total occurrence of each qualifier.
- Total number of versions of each qualifier.
hbase org.apache.hadoop.hbase.mapreduce.CellCounter <tablename> <outputDir> [regex or prefix]
9.mlockall
export HBASE_REGIONSERVER_OPTS="-agentpath:./libmlockall_agent.so=user=hbase"
hbase --mlock user=hbase regionserver start
JDK必须是root用户安装的
10.先下紧缩工具
hbase org.apache.hadoop.hbase.regionserver.CompactionTool
11.region合并工具
hbase org.apache.hadoop.hbase.util.Merge <tablename> <region1> <region2>
HBase提供的工具的更多相关文章
- ImportTsv-HBase数据导入工具
一.概述 HBase官方提供了基于Mapreduce的批量数据导入工具:Bulk load和ImportTsv.关于Bulk load大家可以看下我另一篇博文. 通常HBase用户会使用HBase A ...
- ftrace 提供的工具函数
内核头文件 include/linux/kernel.h 中描述了 ftrace 提供的工具函数的原型,这些函数包括 trace_printk.tracing_on/tracing_off 等.本文通 ...
- MongoDB 提供的工具
MongoDB 提供的工具 官网 https://www.mongodb.com/ 工具 MongoDB 提供了一些工具,: MongoDB Compass: MongoDB数据库可视化工具(类似PL ...
- HBase 健康检查工具
在HBase运维中 最常用的工具就是hbck. 查看整个集群的表状况.如果region很多,建议慎重使用,会比较慢,而采用(3). (1)hbase hbck 详细显示集群状况. (2)hbase ...
- 项目ITP(四) javaweb http json 交互 in action (服务端 spring 手机端 提供各种工具类)勿喷!
前言 系列文章:[传送门] 洗了个澡,准备写篇博客.然后看书了.时间 3 7 分.我慢慢规律生活,向目标靠近. 很喜欢珍惜时间像叮当猫一样 正文 慢慢地,二维码实现签到将要落幕了.下篇文章出二维码实 ...
- Hbase javaAPI(工具类)表的增删改查
建立连接: package Init; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; i ...
- Hbase记录-Hbase Web管理工具
1.Hmaster的Web接口-端口参数:hbase.master.info.port 默认为16010 http://hbase_master_server:16010 可查看hbase的版本信息 ...
- 超大整数运算算法——为RSA加密算法提供运算工具
/* program: Large integer operations * Made by: Daiyyr * date: 2013/07/09 * This software is licen ...
- Java中提供的工具类
System.arraycopy介绍 (1).System.arraycopy用于拷贝数组 arraycopy(Object src, int srcPos, Object dest, int des ...
随机推荐
- lucene查询索引库、分页、过滤、排序、高亮
2.查询索引库 插入测试数据 xx.xx. index. ArticleIndex @Test public void testCreateIndexBatch() throws Exception{ ...
- CentOS升级Svn到最新版
CentOS升级Svn到最新版(金庆的专栏)CentOS/RHEL yum 安装的 subversion 是 1.6.11 版本,连VisulaSVN服务器时会有"Key usage vio ...
- 一个ExtJS实例
聊聊ExtJS 这几天接触了一个项目 前台用的是extjs 发现这个东西还是有点意思的 就把前台的部分 剥离了下来 有兴趣的朋友可以当做模板学习 不多说先上效果图 这篇文章 可以看作是ext知识的一 ...
- EBS开发技术之Patch安装
Contents Document Control........................................................................ ...
- HMAC
Hash-based Message Authentication Code HMAC是IP安全里必须实现的MAC方案,并且其他Internet协议中(如SSL)也使用了HMAC.HMAC已作为NIS ...
- Unity UGUI基础之Button
UGUI Button,可以说是真正的使用最广泛.功能最全面.几乎涵盖任何模块无所不用无所不能的组件,掌握了它的灵巧使用,你就几乎掌握了大半个UGUI! 一.Button组件: Interactabl ...
- python类:类方法和静态方法
http://blog.csdn.net/pipisorry/article/details/49516185 面相对象程序设计中,类方法和静态方法是经常用到的两个术语.逻辑上讲:类方法是只能由类名调 ...
- Unable to handle 'index' format version '2', please update rosdistro的解决办法
之前安装的ROS是Fuerte版本的,好久没有更新,不知不觉又出来了好几个新的版本,今天删除了Fuerte,计划安装Hydro版本的尝尝新,按照官网的安装流程,很快就可以把新版本安装上去了,但是在&q ...
- Android反编译获取资源文件-android学习之旅(69)
有时候你看到一些很好看的布局,会考虑别人怎么实现的,回想参考一下,那么这时候反编译一下是很必要的. 要用到的工具apktool.bat和aapt.exe和apktool.jar(要最新版本) 下载前两 ...
- MySQL数据库写入图片并读取图片显示到JLabel上的详解
相较于Oracle,MySQL作为一个轻量级的开源的数据库,可谓是大大简化了我们的操作.这次我就来写一个关于数据库存入图片,获取图片的例子吧,也为了今后的复习使用.(我们一般采取存入路径的方式,而不是 ...