hbase中查看hlog文件内容

59 篇文章 0 订阅

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

命令的参数:

[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 --dumphdfs://example.com:9000/hbase/.logs/MACHINE/LOGFILE
 --split Split the passed directory of WAL logs
         For example: HLog --splithdfs://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 intable test
  Action:
    row: 0042:2100520170149
    column: a:title
    at time: Tue May 20 11:43:45 CST 2014
    value: \xE5\x95\x86\xE5\x93\x81\xE4\xB8\xADxE8\xAF\x95\xE5\xAE\x9D\xE8\xB4\x9D
  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
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值