Bucket

Bucket组件是一个用于查看对象存储桶中数据块内容的命令集合。它通常作為獨立命令運行,以幫助進行故障排除。

可选参数

usage: thanos bucket [<flags>] <command> [<args> ...]

Bucket utility commands

Flags:
  -h, --help               Show context-sensitive help (also try --help-long and
                           --help-man).
      --version            Show application version.
      --log.level=info     Log filtering level.
      --log.format=logfmt  Log format to use. Possible options: logfmt or json.
      --tracing.config-file=<file-path>
                           Path to YAML file with tracing configuration. See
                           format details:
                           https://thanos.io/tracing.md/#configuration
      --tracing.config=<content>
                           Alternative to 'tracing.config-file' flag (lower
                           priority). Content of YAML file with tracing
                           configuration. See format details:
                           https://thanos.io/tracing.md/#configuration
      --objstore.config-file=<file-path>
                           Path to YAML file that contains object store
                           configuration. See format details:
                           https://thanos.io/storage.md/#configuration
      --objstore.config=<content>
                           Alternative to 'objstore.config-file' flag (lower
                           priority). Content of YAML file that contains object
                           store configuration. See format details:
                           https://thanos.io/storage.md/#configuration

Subcommands:
  bucket verify [<flags>]
    Verify all blocks in the bucket against specified issues

  bucket ls [<flags>]
    List all blocks in the bucket

  bucket inspect [<flags>]
    Inspect all blocks in the bucket in detailed, table-like way

  bucket web [<flags>]
    Web interface for remote storage bucket

可以在/cmd/thanos/bucket.go添加新的命令以用于帮助我们更好地使用对象存储桶。

web

bucket web模块提供了可交互的web界面用于查看对象存储桶中的数据块。服务启动后会定期地刷新并更新视图内容。

显示列表分为多行,每一行表示一个数据推送源实例(如sidecar或rule)。每行又从左到右分为多个时间区间,按时间由远及近将数据块进行排序,在每个时间区间中又分为多行块(最多3行),每行块的不同颜色表示不同的压缩级别和解析度,块的长度表示其存储数据的时间区间长度。

例子:$ thanos bucket web --objstore.config-file="..."

verify

bucket verify用于验证和选择性地修复指定存储桶中的数据块

例子:thanos bucket verify --objstore.config-file="..."

ls

bucket ls用于列出指定存储中的所有数据块

例子:$ thanos bucket ls -o json --objstore.config-file="..."

inspect

bucket inspect用于将存储桶中的指定数据块信息以表格形式打印到标准输出控制台中

例子:$ thanos bucket inspect -l environment=\"prod\" --objstore.config-file="..."

最后更新于