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/.logsfound 49 itemsdrwxrwxr-x - hadoop hadoop,admin 0 2014-05-20 20:43 /hbase-0.90/.logs/bufer108056.tbc,30020,1400049798389drwxrwxr-x - hadoop hadoop,admin 0 2014-05-20 20:43 /hbase-0.90/.logs/bufer108057.tbc,30020,1400049798399drwxrwxr-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 --dumpusage: hlog 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 [-h] [-j] [-p] [-r ] [-s ] [-w ] -h,--help output help message -j,--json output json -p,--printvals print values -r,--region region to filter by. pass region name; e.g. '.meta.,,1' -s,--sequence sequence to filter by. pass sequence number. -w,--row 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.140055741229814/05/20 15:06:49 info configuration.deprecation: fs.default.name is deprecated. instead, use fs.defaultfssequence 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文件内容, 感谢原作者分享。