跳到主要内容
跳到主要内容

BACKENDS

backends

Name

backends

description

表函数,生成 backends 临时表,可以查看当前 doris 集群中的 BE 节点信息。

该函数用于 from 子句中。

syntax

backends()

backends() 表结构:

mysql> desc function backends();
+-------------------------+---------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------+---------+------+-------+---------+-------+
| BackendId | BIGINT | No | false | NULL | NONE |
| Host | TEXT | No | false | NULL | NONE |
| HeartbeatPort | INT | No | false | NULL | NONE |
| BePort | INT | No | false | NULL | NONE |
| HttpPort | INT | No | false | NULL | NONE |
| BrpcPort | INT | No | false | NULL | NONE |
| LastStartTime | TEXT | No | false | NULL | NONE |
| LastHeartbeat | TEXT | No | false | NULL | NONE |
| Alive | BOOLEAN | No | false | NULL | NONE |
| SystemDecommissioned | BOOLEAN | No | false | NULL | NONE |
| TabletNum | BIGINT | No | false | NULL | NONE |
| DataUsedCapacity | BIGINT | No | false | NULL | NONE |
| AvailCapacity | BIGINT | No | false | NULL | NONE |
| TotalCapacity | BIGINT | No | false | NULL | NONE |
| UsedPct | DOUBLE | No | false | NULL | NONE |
| MaxDiskUsedPct | DOUBLE | No | false | NULL | NONE |
| RemoteUsedCapacity | BIGINT | No | false | NULL | NONE |
| Tag | TEXT | No | false | NULL | NONE |
| ErrMsg | TEXT | No | false | NULL | NONE |
| Version | TEXT | No | false | NULL | NONE |
| Status | TEXT | No | false | NULL | NONE |
| HeartbeatFailureCounter | INT | No | false | NULL | NONE |
| NodeRole | TEXT | No | false | NULL | NONE |
+-------------------------+---------+------+-------+---------+-------+
23 rows in set (0.002 sec)

backends() tvf 展示出来的信息基本与 show backends 语句展示出的信息一致,但是 backends() tvf 的各个字段类型更加明确,且可以利用 tvf 生成的表去做过滤、join 等操作。

backends() tvf 信息展示进行了鉴权,与 show backends 行为保持一致,要求用户具有 ADMIN/OPERATOR 权限。

example

mysql> select * from backends()\G
*************************** 1. row ***************************
BackendId: 10002
Host: 10.xx.xx.90
HeartbeatPort: 9053
BePort: 9063
HttpPort: 8043
BrpcPort: 8069
LastStartTime: 2023-06-15 16:51:02
LastHeartbeat: 2023-06-15 17:09:58
Alive: 1
SystemDecommissioned: 0
TabletNum: 21
DataUsedCapacity: 0
AvailCapacity: 5187141550081
TotalCapacity: 7750977622016
UsedPct: 33.077583202570978
MaxDiskUsedPct: 33.077583202583881
RemoteUsedCapacity: 0
Tag: {"location" : "default"}
ErrMsg:
Version: doris-0.0.0-trunk-4b18cde0c7
Status: {"lastSuccessReportTabletsTime":"2023-06-15 17:09:02","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
HeartbeatFailureCounter: 0
NodeRole: mix
1 row in set (0.038 sec)

keywords

backends