From 061b49b7bfcd5d58bcd33c7cde7d92af541ccfff Mon Sep 17 00:00:00 2001 From: Xujian Duan <50550370+DarvenDuan@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:50:25 +0800 Subject: [PATCH] [doc](website) update SHOW-PROC doc (#12229) --- .../Show-Statements/SHOW-FRONTENDS.md | 1 + .../Show-Statements/SHOW-PROC.md | 65 ++++++++++++------ .../Show-Statements/SHOW-FRONTENDS.md | 1 + .../Show-Statements/SHOW-PROC.md | 66 +++++++++++++------ 4 files changed, 93 insertions(+), 40 deletions(-) diff --git a/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md b/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md index 4ee4fbc5e8..fe502f46fb 100644 --- a/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md +++ b/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md @@ -49,6 +49,7 @@ illustrate: 5. LastHeartbeat is the last heartbeat. 6. IsHelper indicates whether the node is a helper node in bdbje. 7. ErrMsg is used to display the error message when the heartbeat fails. +8. CurrentConnected indicates whether the FE node is currently connected ### Example diff --git a/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md b/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md index 9409d76246..6b555cbb07 100644 --- a/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md +++ b/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md @@ -73,8 +73,11 @@ mysql> show proc "/"; | load_error_hub | | current_backend_instances | | tasks | +| cluster_health | +| current_query_stmts | +| stream_loads | +---------------------------+ -19 rows in set (0.00 sec) +22 rows in set (0.00 sec) ```` illustrate: @@ -98,34 +101,37 @@ illustrate: 17. load_error_hub: Doris supports centralized storage of error information generated by load jobs in an error hub. Then view the error message directly through the SHOW LOAD WARNINGS; statement. Shown here is the configuration information of the error hub. 18. current_backend_instances : Displays a list of be nodes that are currently executing jobs 19. tasks : Displays the total number of tasks of various jobs and the number of failures. +20. Cluster_health: Run SHOW PROC '/cluster_health/tablet_health'; statement to view the replica status of the entire cluster. +21. Current_query_stmts: Returns the currently executing query. +22. Stream_loads: Returns the stream load task being executed. ### Example 1. For example, "/dbs" displays all databases, and "/dbs/10002" displays all tables under the database with id 10002 -```sql -mysql> show proc "/dbs/10002"; -+---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ -| TableId | TableName | IndexNum | PartitionColumnName | PartitionNum | State | Type | LastConsistencyCheckTime | ReplicaCount | -+---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ -| 10065 | dwd_product_live | 1 | dt | 9 | NORMAL | OLAP | NULL | 18 | -| 10109 | ODS_MR_BILL_COSTS_DO | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | -| 10119 | test | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | -| 10124 | test_parquet_import | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | -+---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ -4 rows in set (0.00 sec) -```` + ```sql + mysql> show proc "/dbs/10002"; + +---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ + | TableId | TableName | IndexNum | PartitionColumnName | PartitionNum | State | Type | LastConsistencyCheckTime | ReplicaCount | + +---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ + | 10065 | dwd_product_live | 1 | dt | 9 | NORMAL | OLAP | NULL | 18 | + | 10109 | ODS_MR_BILL_COSTS_DO | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | + | 10119 | test | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | + | 10124 | test_parquet_import | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | + +---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ + 4 rows in set (0.00 sec) + ```` 2. Display information about the number of all database tables in the cluster. ```sql mysql> show proc '/statistic'; - +-------+----------------------+----------+--------------+----------+-----------+------------+--------------------+-----------------------+------------------+--------------+ - | DbId | DbName | TableNum | PartitionNum | IndexNum | TabletNum | ReplicaNum | UnhealthyTabletNum | InconsistentTabletNum | CloningTabletNum | BadTabletNum | - +-------+----------------------+----------+--------------+----------+-----------+------------+--------------------+-----------------------+------------------+--------------+ - | 10002 | default_cluster:test | 4 | 12 | 12 | 21 | 21 | 0 | 0 | 0 | 0 | - | Total | 1 | 4 | 12 | 12 | 21 | 21 | 0 | 0 | 0 | 0 | - +-------+----------------------+----------+--------------+----------+-----------+------------+--------------------+-----------------------+------------------+--------------+ + +-------+----------------------+----------+--------------+----------+-----------+------------+ + | DbId | DbName | TableNum | PartitionNum | IndexNum | TabletNum | ReplicaNum | + +-------+----------------------+----------+--------------+----------+-----------+------------+ + | 10002 | default_cluster:test | 4 | 12 | 12 | 21 | 21 | + | Total | 1 | 4 | 12 | 12 | 21 | 21 | + +-------+----------------------+----------+--------------+----------+-----------+------------+ 2 rows in set (0.00 sec) ```` @@ -171,7 +177,7 @@ mysql> show proc "/dbs/10002"; - BucketIndex: The index of the bucket sequence. - BackendIds: The list of BE node IDs where the data shards in the bucket are located. -5. Display the total number of tasks of various jobs and the number of failures +5. Display the total number of tasks of various jobs and the number of failures. ```sql mysql> show proc '/tasks'; @@ -208,6 +214,25 @@ mysql> show proc "/dbs/10002"; 26 rows in set (0.01 sec) ```` +5. Display the replica status of the entire cluster. + ```sql + mysql> show proc '/cluster_health/tablet_health'; + +----------+---------------------------+-----------+------------+-------------------+----------------------+----------------------+--------------+----------------------------+-------------------------+-------------------+---------------------+----------------------+----------------------+------------------+-----------------------------+-----------------+-------------+------------+ + | DbId | DbName | TabletNum | HealthyNum | ReplicaMissingNum | VersionIncompleteNum | ReplicaRelocatingNum | RedundantNum | ReplicaMissingInClusterNum | ReplicaMissingForTagNum | ForceRedundantNum | ColocateMismatchNum | ColocateRedundantNum | NeedFurtherRepairNum | UnrecoverableNum | ReplicaCompactionTooSlowNum | InconsistentNum | OversizeNum | CloningNum | + +----------+---------------------------+-----------+------------+-------------------+----------------------+----------------------+--------------+----------------------------+-------------------------+-------------------+---------------------+----------------------+----------------------+------------------+-----------------------------+-----------------+-------------+------------+ + | 25852112 | default_cluster:bowen | 1920 | 1920 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + | 25342914 | default_cluster:bw | 128 | 128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + | 2575532 | default_cluster:cps | 1440 | 1440 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 0 | + | 26150325 | default_cluster:db | 38374 | 38374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 453 | 0 | + +----------+---------------------------+-----------+------------+-------------------+----------------------+----------------------+--------------+----------------------------+-------------------------+-------------------+---------------------+----------------------+----------------------+------------------+-----------------------------+-----------------+-------------+------------+ + 4 rows in set (0.01 sec) + ``` + + View the replica status under a database, such as a database with a DbId of 25852112. + + ```sql + mysql> show proc '/cluster_health/tablet_health/25852112'; + ``` ### Keywords SHOW, PROC diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md b/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md index 1b676a422c..5681d755a2 100644 --- a/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md +++ b/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-FRONTENDS.md @@ -48,6 +48,7 @@ SHOW FRONTENDS; 5. LastHeartbeat 是最近一次心跳。 6. IsHelper 表示该节点是否是 bdbje 中的 helper 节点。 7. ErrMsg 用于显示心跳失败时的错误信息。 +8. CurrentConnected 表示是否是当前连接的FE节点 ### Example diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md b/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md index 87e094fa11..ba46b4b630 100644 --- a/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md +++ b/docs/zh-CN/docs/sql-manual/sql-reference/Show-Statements/SHOW-PROC.md @@ -73,8 +73,11 @@ mysql> show proc "/"; | load_error_hub | | current_backend_instances | | tasks | +| cluster_health | +| current_query_stmts | +| stream_loads | +---------------------------+ -19 rows in set (0.00 sec) +22 rows in set (0.00 sec) ``` 说明: @@ -98,34 +101,37 @@ mysql> show proc "/"; 17. load_error_hub :Doris 支持将 load 作业产生的错误信息集中存储到一个 error hub 中。然后直接通过 SHOW LOAD WARNINGS; 语句查看错误信息。这里展示的就是 error hub 的配置信息。 18. current_backend_instances :显示当前正在执行作业的be节点列表 19. tasks : 显示现在各种作业的任务总量,及失败的数量。 +20. cluster_health : 通过 SHOW PROC '/cluster_health/tablet_health'; 命令可以查看整个集群的副本状态。 +21. current_query_stmts : 返回当前正在执行的 query。 +22. stream_loads : 返回当前正在执行的stream load 任务。 ### Example 1. 如 "/dbs" 展示所有数据库,而 "/dbs/10002" 展示 id 为 10002 的数据库下的所有表 -```sql -mysql> show proc "/dbs/10002"; -+---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ -| TableId | TableName | IndexNum | PartitionColumnName | PartitionNum | State | Type | LastConsistencyCheckTime | ReplicaCount | -+---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ -| 10065 | dwd_product_live | 1 | dt | 9 | NORMAL | OLAP | NULL | 18 | -| 10109 | ODS_MR_BILL_COSTS_DO | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | -| 10119 | test | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | -| 10124 | test_parquet_import | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | -+---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ -4 rows in set (0.00 sec) -``` + ```sql + mysql> show proc "/dbs/10002"; + +---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ + | TableId | TableName | IndexNum | PartitionColumnName | PartitionNum | State | Type | LastConsistencyCheckTime | ReplicaCount | + +---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ + | 10065 | dwd_product_live | 1 | dt | 9 | NORMAL | OLAP | NULL | 18 | + | 10109 | ODS_MR_BILL_COSTS_DO | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | + | 10119 | test | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | + | 10124 | test_parquet_import | 1 | NULL | 1 | NORMAL | OLAP | NULL | 1 | + +---------+----------------------+----------+---------------------+--------------+--------+------+--------------------------+--------------+ + 4 rows in set (0.00 sec) + ``` 2. 展示集群中所有库表个数相关的信息。 ```sql mysql> show proc '/statistic'; - +-------+----------------------+----------+--------------+----------+-----------+------------+--------------------+-----------------------+------------------+--------------+ - | DbId | DbName | TableNum | PartitionNum | IndexNum | TabletNum | ReplicaNum | UnhealthyTabletNum | InconsistentTabletNum | CloningTabletNum | BadTabletNum | - +-------+----------------------+----------+--------------+----------+-----------+------------+--------------------+-----------------------+------------------+--------------+ - | 10002 | default_cluster:test | 4 | 12 | 12 | 21 | 21 | 0 | 0 | 0 | 0 | - | Total | 1 | 4 | 12 | 12 | 21 | 21 | 0 | 0 | 0 | 0 | - +-------+----------------------+----------+--------------+----------+-----------+------------+--------------------+-----------------------+------------------+--------------+ + +-------+----------------------+----------+--------------+----------+-----------+------------+ + | DbId | DbName | TableNum | PartitionNum | IndexNum | TabletNum | ReplicaNum | + +-------+----------------------+----------+--------------+----------+-----------+------------+ + | 10002 | default_cluster:test | 4 | 12 | 12 | 21 | 21 | + | Total | 1 | 4 | 12 | 12 | 21 | 21 | + +-------+----------------------+----------+--------------+----------+-----------+------------+ 2 rows in set (0.00 sec) ``` @@ -171,7 +177,7 @@ mysql> show proc "/dbs/10002"; - BucketIndex: 分桶序列的下标。 - BackendIds: 分桶中数据分片所在的 BE 节点 id 列表。 -5. 显示现在各种作业的任务总量,及失败的数量 +5. 显示现在各种作业的任务总量,及失败的数量。 ```sql mysql> show proc '/tasks'; @@ -208,6 +214,26 @@ mysql> show proc "/dbs/10002"; 26 rows in set (0.01 sec) ``` +6. 显示整个集群的副本状态。 + + ```sql + mysql> show proc '/cluster_health/tablet_health'; + +----------+---------------------------+-----------+------------+-------------------+----------------------+----------------------+--------------+----------------------------+-------------------------+-------------------+---------------------+----------------------+----------------------+------------------+-----------------------------+-----------------+-------------+------------+ + | DbId | DbName | TabletNum | HealthyNum | ReplicaMissingNum | VersionIncompleteNum | ReplicaRelocatingNum | RedundantNum | ReplicaMissingInClusterNum | ReplicaMissingForTagNum | ForceRedundantNum | ColocateMismatchNum | ColocateRedundantNum | NeedFurtherRepairNum | UnrecoverableNum | ReplicaCompactionTooSlowNum | InconsistentNum | OversizeNum | CloningNum | + +----------+---------------------------+-----------+------------+-------------------+----------------------+----------------------+--------------+----------------------------+-------------------------+-------------------+---------------------+----------------------+----------------------+------------------+-----------------------------+-----------------+-------------+------------+ + | 25852112 | default_cluster:bowen | 1920 | 1920 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + | 25342914 | default_cluster:bw | 128 | 128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + | 2575532 | default_cluster:cps | 1440 | 1440 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 0 | + | 26150325 | default_cluster:db | 38374 | 38374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 453 | 0 | + +----------+---------------------------+-----------+------------+-------------------+----------------------+----------------------+--------------+----------------------------+-------------------------+-------------------+---------------------+----------------------+----------------------+------------------+-----------------------------+-----------------+-------------+------------+ + 4 rows in set (0.01 sec) + ``` + + 查看某个数据库下面的副本状态, 如 DbId 为 25852112 的数据库。 + + ```sql + mysql> show proc '/cluster_health/tablet_health/25852112'; + ``` ### Keywords SHOW, PROC