首批通过分布式安全可靠测评,为关键业务系统打造
dumpsst
更新时间:2026-05-25 16:01:32
dumpsst 用来显示 block_file 文件中的内容,可以通过 macro block 调查追溯线上问题,定位数据问题等。本文将介绍如何使用 dumpsst。
您可使用该命令输出 dumpsst 的使用方法。
$ ./ob_admin dumpsst --help
succ to open, filename=ob_admin.log, fd=3, wf_fd=2
old log_file need close, old = ob_admin.log new = ob_admin.log
succ to open, filename=ob_admin.log, fd=3, wf_fd=2
succ to open, filename=ob_admin_rs.log, fd=4, wf_fd=2
Usage: dumpsst command [command args] [options]
commands:
-d,--dump dump, arg:[macro_block]
-h,--help display this message.
options:
-f,--data-file-name data file path or the ofs address
-a,--macro-id macro block id
-i,--micro-id micro block id, -1 means all micro blocks
-n,--macro-size macro block size, in bytes
-q,--quiet log level: ERROR
-x,--hex-print print obj value in hex mode
-k,--master_key master key, hex str
-m,--master_key_id master key id
-t,--tablet_id tablet id
-s,--logical_version macro block logical version
samples:
dump all rows in macro:
ob_admin -d macro_block -f block_file_path -a macro_id
dump specified block in the shared block:
ob_admin -d macro_block -f block_file_path -a macro_id -t tablet_id -s logical_version
下面介绍一个 dumpsst 的常见用法。
macro_block
您可使用以下命令显示 SSTable 数据块内容,包括宏块 common header,macro header,微块索引信息,微块头和每条数据。这是一条最常用的命令,格式如下:
# 本地模式:
./ob_admin dumpsst -d macro_block -f <block_file_path> -a <macro_id>
./ob_admin dumpsst -d macro_block -f <block_file_path> -a <macro_id> -t <tablet_id> -s <logical_version>
参数说明:
-d:dump 宏块类型,目前只支持macro_block。-f:指定数据文件所在文件夹的绝对路径。-a:指定宏块的下标。-t:指定分片的下标。-s:指定宏块的逻辑版本号。