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 ...
随机推荐
- RxJava(七) 使用debounce操作符 优化app搜索功能
欢迎转载,转载请标明出处: http://blog.csdn.net/johnny901114/article/details/51555203 本文出自:[余志强的博客] 一.抛出问题 现在几乎所有 ...
- Android Multimedia框架总结(五)多媒体基础概念
转载请把头部出处链接和尾部二维码一起转载,本文出自: http://blog.csdn.net/hejjunlin/article/details/52431887 上篇中介绍了MediaPlayer ...
- Unity3D核心技术详解
在这里将多年游戏研发经验的积累写成一本书奉献给读者,目前已经开始预售,网址: http://www.broadview.com.cn/article/70 该书主要是将游戏中经常使用的技术给大家做了一 ...
- Apache commons email 使用过程中遇到的问题
apache-commons-email是对mail的一个封装,所以使用起来确实是很方便.特别的,官网上的tutorial也是极其的简单.但是我也仍然是遇到了没有解决的问题. jar包的添加 mail ...
- Android4.3 屏蔽HOME按键返回桌面详解(源码环境下)
点击打开链接 首先声明我是做系统开发的(高通平台),所以下面介绍的方法并不适合应用开发者. 最经有个需求要屏蔽HOME按键返回桌面并且实现自己的功能,发现以前的方式报错用不了,上网搜索了一下,发现都是 ...
- introduction of velocity
一.velocity 简介 基于java 的模板引擎,apache 旗下的开源软件项目. 目的在于隔离 表示层和业务逻辑层,当然现在做的不仅仅是这些. 二.应用场景 web 应用程序:创建html页面 ...
- 剑指Offer——滴滴笔试题+知识点总结
剑指Offer--滴滴笔试题+知识点总结 情景回顾 时间:2016.9.18 15:00-17:00 地点:山东省网络环境智能计算技术重点实验室 事件:滴滴笔试 总体来说,滴滴笔试内容体量不算多, ...
- FFmpeg源代码简单分析:av_write_trailer()
===================================================== FFmpeg的库函数源代码分析文章列表: [架构图] FFmpeg源代码结构图 - 解码 F ...
- Linux设备驱动编程---miscdevice杂类设备的使用方法
miscdev简称杂类设备杂类设备就是对字符设备驱动做一个封装,方便简单使用杂类设备封装字符设备需要包含的头文件:#include <linux/miscdevice.h>(1)杂类设备的 ...
- iOS中 如何将自己的框架更新到cocopods上 韩俊强的博客
每日更新关注:http://weibo.com/hanjunqiang 新浪微博! 为了更方便的集成第三方框架有了cocopods 的, 当我们有了相对比较好的框架的时候如何更新到cocopods ...