hbase 中除了有查看hfile文件的命令,也提供也查看hlog文件的命令: 在 hbase 的根目录下有个.logs目录,里面就是hlog文件,一台RegionServer机器对应一个文件。老的hlog文件会被移到.oldlogs目录: [admin@bufer108081.tbc ~/dev/baoniu]$ hadoop fs -ls /hb
hbase中除了有查看hfile文件的命令,也提供也查看hlog文件的命令:
在hbase的根目录下有个.logs目录,里面就是hlog文件,一台RegionServer机器对应一个文件。老的hlog文件会被移到.oldlogs目录:
[admin@bufer108081.tbc ~/dev/baoniu]$ hadoop fs -ls /hbase-0.90/.logs Found 49 items drwxrwxr-x - hadoop hadoop,admin 0 2014-05-20 20:43 /hbase-0.90/.logs/bufer108056.tbc,30020,1400049798389 drwxrwxr-x - hadoop hadoop,admin 0 2014-05-20 20:43 /hbase-0.90/.logs/bufer108057.tbc,30020,1400049798399 drwxrwxr-x - hadoop hadoop,admin 0 2014-05-20 20:43 /hbase-0.90/.logs/bufer108058.tbc,30020,1400049798425
命令的参数:
主要功能:基本设置:站点常规属性设置。导航管理:添加/删除导航菜单,隐藏与显示。单页管理:增加修改单页,通过强大的编辑器可插入动画图片视频等内容。新闻管理:新闻分类管理,增加/删除/修改新闻。产品管理:产品二级分类,产品略缩图,产品推荐,增/删/改产品。订单管理:前台对相应的产品下订单,后台查看与处理订单信息。下载管理:下载分类管理,可做软件下载,文件下载等功能。幻灯管理:幻灯添加、幻灯修改等。招
0
[admin@bufer108081.tbc ~/dev/baoniu]$ ~/hbase/bin/hbase org.apache.hadoop.hbase.regionserver.wal.HLog --dump
Usage: HLog <ARGS>
Arguments:
--dump Dump textual representation of passed one or more files
For example: HLog --dump hdfs://example.com:9000/hbase/.logs/MACHINE/LOGFILE
--split Split the passed directory of WAL logs
For example: HLog --split hdfs://example.com:9000/hbase/.logs/DIR
[admin@bufer108081.tbc ~/dev/baoniu]$ ~/hbase/bin/hbase org.apache.hadoop.hbase.regionserver.wal.HLog --dump -h usage: HLog <filename...> [-h] [-j] [-p] [-r <arg>] [-s <arg>] [-w <arg>]
-h,--help Output help message
-j,--json Output JSON
-p,--printvals Print values
-r,--region <arg> Region to filter by. Pass region name; e.g.
'.META.,,1'
-s,--sequence <arg> Sequence to filter by. Pass sequence number.
-w,--row <arg> Row to filter by. Pass row name.
通过以下命令就可以查看hlog文件的内容:
[admin@bufer108081.tbc ~/dev/baoniu]$ ~/hbase/bin/hbase org.apache.hadoop.hbase.regionserver.wal.HLog --dump -p /hbase-0.90/.logs/bufer108118.tbc,30020,1400049798450/bufer108118.tbc%2C30020%2C1400049798450.1400557412298
14/05/20 15:06:49 INFO Configuration.deprecation: fs.default.name is deprecated. Instead, use fs.defaultFS
Sequence 8347119 from region a98994dbcf5b1fcd47f69efcf804c385 in table test
Action:
row: 0042:2100520170149
column: a:title
at time: Tue May 20 11:43:45 CST 2014
value: xE5x95x86xE5x93x81xE4xB8xADxE8xAFx95xE5xAEx9DxE8xB4x9D
Action:
row: 0042:2100520170149
column: a:user_id
at time: Tue May 20 11:43:45 CST 2014
value: 778896
Action:
row: 0042:2100520170149
column: a:pict_url
at time: Tue May 20 11:43:45 CST 2014
value: 19/60/74/196074.jpg
Action:
row: 0042:2100520170149
column: a:categ
at time: Tue May 20 11:43:45 CST 2014
value: 1101
Action:
row: 0042:2100520170149
column: a:minimum_bid
at time: Tue May 20 11:43:45 CST 2014
value: 2000.00
Action:
row: 0042:2100520170149
column: a:reserve_price
at time: Tue May 20 11:43:45 CST 2014
value: 2000.00
原文地址:hbase中查看hlog文件内容, 感谢原作者分享。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号