Kudu常用命令

这篇博客详细介绍了Kudu大数据存储系统的一些常用命令,包括查看Master列表、TServer列表、集群健康状态、Table列表及内容,以及如何检查集群的Metrics,对于理解和管理Kudu集群非常有帮助。
摘要由CSDN通过智能技术生成

查看Master列表

kudu master list --help
Usage:
        /opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/bin/../lib/kudu/bin/kudu
        master list <master_addresses> [-columns=<columns>] [-format=<format>]
        [-timeout_ms=<ms>]

List masters in a Kudu cluster

    master_addresses (Either comma-separated list of Kudu master addresses
      where each address is of form 'hostname:port', or a cluster name if it
      has been configured in ${KUDU_CONFIG}/kudurc) type: string default: ""

    -columns (Comma-separated list of master info fields to include in output.
      Possible values: uuid, rpc-addresses, http-addresses, version, seqno,
      start_time and role) type: string default: "uuid,rpc-addresses,role"

    -format (Format to use for printing list output tables.
      Possible values: pretty, space, tsv, csv, and json) type: string
      default: "pretty"

    -timeout_ms (RPC timeout in milliseconds) type: int64 default: 60000

示例如下:

查看TServer列表

kudu tserver list --help
Usage:
        /opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/bin/../lib/kudu/bin/kudu
        tserver list <master_addresses> [-columns=<columns>]
        [-format=<format>] [-timeout_ms=<ms>]

List tablet servers in a Kudu cluster

    master_addresses (Either comma-separated list of Kudu master addresses
      where each address is of form 'hostname:port', or a cluster name if it
      has been configured in ${KUDU_CONFIG}/kudurc) type: string default: ""

    -columns (Comma-separated list of tserver info fields to include in output.
      Possible values: uuid, rpc-addresses, http-addresses, version, seqno,
      heartbeat and start_time) type: string default: "uuid,rpc-addresses"

    -format (Format to use for printing list output tables.
      Possible values: pretty, space, tsv, csv, and json) type: string
      default: "pretty"

    -timeout_ms (RPC timeout in milliseconds) type: int64 default: 60000

示例如下:

查看集群健康状态

kudu cluster ksck --help
Usage:
        /opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/bin/../lib/kudu/bin/kudu
        cluster ksck <master_addresses> [-checksum_cache_blocks]
        [-checksum_scan] [-checksum_scan_concurrency=<concurrency>]
        [-nochecksum_snapshot] [-checksum_timeout_sec=<sec>] [-color=<color>]
        [-noconsensus] [-fetch_info_concurrency=<concurrency>]
        [-ksck_format=<format>] [-sections=<sections>] [-tables=<tables>]
        [-tablets=<tablets>]

Check the health of a Kudu cluster

By default, ksck checks that master and tablet server processes are running,
and that table metadata is consistent. Use the 'checksum' flag to check that
tablet data is consistent (also see the 'tables' and 'tablets' flags). Use the
'checksum_snapshot' along with 'checksum' if the table or tablets are actively
receiving inserts or updates. Use the 'verbose' flag to output detailed
information on cluster status even if no inconsistency is found in metadata.

    master_addresses (Either comma-separated list of Kudu master addresses
      where each address is of form 'hostname:port', or a cluster name if it
      has been configured in ${KUDU_CONFIG}/kudurc) type: string default: ""

    -checksum_cache_blocks (Should the checksum scanners cache the read blocks)
      type: bool default: false

    -checksum_scan (Perform a checksum scan on data in the cluster.) type: bool
      default: false

    -checksum_scan_concurrency (Number of concurrent checksum scans to execute
      per tablet server.) type: int32 default: 4

    -checksum_snapshot (Should the checksum scanner use a snapshot scan?)
      type: bool default: true

    -checksum_timeout_sec (Maximum total seconds to wait for a checksum scan to
      complete before timing out.) type: int32 default: 86400

    -color (Specifies whether output should be colorized. The default value
      'auto' colorizes output if the output is a terminal. The other valid
      values are 'always' or 'never'.) type: string default: "auto"

    -consensus (Whether to check the consensus state from each tablet against
      the master.) type: bool default: true

    -fetch_info_concurrency (Number of threads to fetch info concurrently.)
      type: int32 default: 20

    -ksck_format (Output format for ksck. Available options are
      'plain_concise', 'plain_full', 'json_pretty', and 'json_compact'.
      'plain_concise' format is plain text, omitting most information about
      healthy tablets.
      'plain_full' is plain text with all results included.
      'json_pretty' produces pretty-printed json.
      'json_compact' produces json suitable for parsing by other programs.
      'json_pretty' and 'json_compact' differ in format, not content.)
      type: string default: "plain_concise"

    -sections (Sections to print (comma-separated list of sections, available
      sections are: MASTER_SUMMARIES, TSERVER_SUMMARIES, VERSION_SUMMARIES,
      TABLET_SUMMARIES, TABLE_SUMMARIES, CHECKSUM_RESULTS and TOTAL_COUNT.) If
      not specified, print all sections.) type: string default: "*"

    -tables (Tables to include (comma-separated list of table names)If not
      specified, includes all tables.) type: string default: ""

    -tablets (Tablets to check (comma-separated list of IDs) If not specified,
      checks all tablets.) type: string default: ""

示例如下:

su kudu kudu cluster ksck xxxxxx

查看Table列表

kudu table list --help
Usage:
        /opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/bin/../lib/kudu/bin/kudu
        table list <master_addresses> [-tables=<tables>] [-list_tablets]

List tables

    master_addresses (Either comma-separated list of Kudu master addresses
      where each address is of form 'hostname:port', or a cluster name if it
      has been configured in ${KUDU_CONFIG}/kudurc) type: string default: ""

    -tables (Tables to include (comma-separated list of table names)If not
      specified, includes all tables.) type: string default: ""

    -list_tablets (Include tablet and replica UUIDs in the output) type: bool
      default: false

示例如下:

kudu table list xxxxx

查看Table内容

kudu table describe --help
Usage:
        /opt/cloudera/parcels/CDH-6.3.1-1.cdh6.3.1.p0.1470567/bin/../lib/kudu/bin/kudu
        table describe <master_addresses> <table_name> [-show_attributes]

Describe a table

    master_addresses (Either comma-separated list of Kudu master addresses
      where each address is of form 'hostname:port', or a cluster name if it
      has been configured in ${KUDU_CONFIG}/kudurc) type: string default: ""

    table_name (Name of the table to describe) type: string default: ""

    -show_attributes (Whether to show column attributes, including column
      encoding type, compression type, and default read/write value.)
      type: bool default: false

示例如下:

kudu table describe master_ip table_name

检查集群Metrics

  • 查看Master Server的Metrics
kudu master --dump_metrics_json
  • 查看TServer的Metrics
kudu tserver --dump_metrics_json

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值