Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions reference/system-databases/cluster-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ summary: 了解 TiDB 集群配置表 `CLUSTER_CONFIG`。

# CLUSTER_CONFIG

集群配置表 `CLUSTER_CONFIG` 用于获取集群当前所有 TiDB/PD/TiKV 节点的配置。对于 TiDB 4.0 以前的版本,用户需要逐个访问各个节点的 HTTP API 才能收集到所有组件配置。
集群配置表 `CLUSTER_CONFIG` 用于获取集群当前所有 TiDB/PD/TiKV 实例的配置。对于 TiDB 4.0 以前的版本,用户需要逐个访问各个实例的 HTTP API 才能收集到所有组件配置。

{{< copyable "sql" >}}

```sql
desc cluster_config;
desc information_schema.cluster_config;
```

```
Expand All @@ -32,12 +32,12 @@ desc cluster_config;
* `KEY`:配置项名。
* `VALUE`:配置项值。

以下示例查询 TiKV 节点的 `coprocessor` 相关配置:
以下示例查询 TiKV 实例的 `coprocessor` 相关配置:

{{< copyable "sql" >}}

```sql
select * from cluster_config where type='tikv' and `key` like 'coprocessor%';
select * from information_schema.cluster_config where type='tikv' and `key` like 'coprocessor%';
```

```
Expand Down
14 changes: 7 additions & 7 deletions reference/system-databases/cluster-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ category: reference

# CLUSTER_HARDWARE

集群硬件表 `CLUSTER_HARDWARE` 提供了集群各节点所在服务器的硬件信息
集群硬件表 `CLUSTER_HARDWARE` 提供了集群各实例所在服务器的硬件信息

{{< copyable "sql" >}}

```sql
desc cluster_hardware;
desc information_schema.cluster_hardware;
```

```
Expand All @@ -29,8 +29,8 @@ desc cluster_hardware;

字段解释:

* `TYPE`:对应节点信息表 [`information_schema.cluster_info`](/reference/system-databases/cluster-info.md) 中的 `TYPE` 字段,可取值为 `tidb`,`pd` 和 `tikv`。
* `INSTANCE`:对应于节点信息表 `information_schema.cluster_info` 中的 `INSTANCE` 字段。
* `TYPE`:对应集群信息表 [`information_schema.cluster_info`](/reference/system-databases/cluster-info.md) 中的 `TYPE` 字段,可取值为 `tidb`,`pd` 和 `tikv`。
* `INSTANCE`:对应于集群信息表 `information_schema.cluster_info` 中的 `INSTANCE` 字段。
* `DEVICE_TYPE`:硬件类型。目前可以查询的硬件类型有 `cpu`、`memory`、`disk` 和 `net`。
* `DEVICE_NAME`:硬件名。对于不同的 `DEVICE_TYPE`,`DEVICE_NAME` 的取值不同。
* `cpu`:硬件名为 cpu。
Expand All @@ -45,15 +45,15 @@ desc cluster_hardware;
{{< copyable "sql" >}}

```sql
select * from cluster_hardware where device_type='cpu' and device_name='cpu' and name like '%cores';
select * from information_schema.cluster_hardware where device_type='cpu' and device_name='cpu' and name like '%cores';
```

```
+------+-----------------+-------------+-------------+--------------------+-------+
| TYPE | INSTANCE | DEVICE_TYPE | DEVICE_NAME | NAME | VALUE |
+------+-----------------+-------------+-------------+--------------------+-------+
| tidb | 127.0.0.1:10080 | cpu | cpu | cpu-logical-cores | 8 |
| tidb | 127.0.0.1:10080 | cpu | cpu | cpu-physical-cores | 4 |
| tidb | 0.0.0.0:4000 | cpu | cpu | cpu-logical-cores | 8 |
| tidb | 0.0.0.0:4000 | cpu | cpu | cpu-physical-cores | 4 |
| pd | 127.0.0.1:2379 | cpu | cpu | cpu-logical-cores | 8 |
| pd | 127.0.0.1:2379 | cpu | cpu | cpu-physical-cores | 4 |
| tikv | 127.0.0.1:20160 | cpu | cpu | cpu-logical-cores | 8 |
Expand Down
20 changes: 10 additions & 10 deletions reference/system-databases/cluster-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ category: reference

# CLUSTER_INFO

集群拓扑表 `CLUSTER_INFO` 提供集群当前的拓扑信息,以及各个节点的版本信息、版本对应的 Git Hash、各节点的启动时间、各节点的运行时间
集群拓扑表 `CLUSTER_INFO` 提供集群当前的拓扑信息,以及各个节点的版本信息、版本对应的 Git Hash、各节点的启动时间、各实例的运行时间

{{< copyable "sql" >}}

```sql
desc cluster_info;
desc information_schema.cluster_info;
```

```
Expand Down Expand Up @@ -42,15 +42,15 @@ desc cluster_info;
{{< copyable "sql" >}}

```sql
select * from cluster_info;
select * from information_schema.cluster_info;
```

```
+------+-----------------+-----------------+----------------------------------------+------------------------------------------+---------------------------+--------------+
| TYPE | INSTANCE | STATUS_ADDRESS | VERSION | GIT_HASH | START_TIME | UPTIME |
+------+-----------------+-----------------+----------------------------------------+------------------------------------------+---------------------------+--------------+
| tidb | 127.0.0.1:4000 | 127.0.0.1:10080 | 5.7.25-TiDB-v4.0.0-beta-195-gb5ea3232a | b5ea3232afa970f00db7a0fb13ed10857db1912e | 2020-03-02T16:27:28+08:00 | 4m18.845924s |
| pd | 127.0.0.1:2379 | 127.0.0.1:2379 | 4.1.0-alpha | 4b9bcbc1425c96848042b6d700eb63f84e72b338 | 2020-03-02T16:27:17+08:00 | 4m29.845928s |
| tikv | 127.0.0.1:20160 | 127.0.0.1:20180 | 4.1.0-alpha | 7c4202a1c8faf60eda659dfe0e64e31972488e78 | 2020-03-02T16:27:28+08:00 | 4m18.845929s |
+------+-----------------+-----------------+----------------------------------------+------------------------------------------+---------------------------+--------------+
+------+-----------------+-----------------+-------------+------------------------------------------+---------------------------+--------------+
| TYPE | INSTANCE | STATUS_ADDRESS | VERSION | GIT_HASH | START_TIME | UPTIME |
+------+-----------------+-----------------+-------------+------------------------------------------+---------------------------+--------------+
| tidb | 0.0.0.0:4000 | 0.0.0.0:10080 | 4.0.0-beta | b5ea3232afa970f00db7a0fb13ed10857db1912e | 2020-03-02T16:27:28+08:00 | 4m18.845924s |
| pd | 127.0.0.1:2379 | 127.0.0.1:2379 | 4.1.0-alpha | 4b9bcbc1425c96848042b6d700eb63f84e72b338 | 2020-03-02T16:27:17+08:00 | 4m29.845928s |
| tikv | 127.0.0.1:20160 | 127.0.0.1:20180 | 4.1.0-alpha | 7c4202a1c8faf60eda659dfe0e64e31972488e78 | 2020-03-02T16:27:28+08:00 | 4m18.845929s |
+------+-----------------+-----------------+-------------+------------------------------------------+---------------------------+--------------+
```
34 changes: 17 additions & 17 deletions reference/system-databases/cluster-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ category: reference

# CLUSTER_LOAD

集群负载表 `CLUSTER_LOAD` 提供集群各个节点所在服务器的的当前负载信息
集群负载表 `CLUSTER_LOAD` 提供集群各个实例所在服务器的的当前负载信息

{{< copyable "sql" >}}

```sql
desc cluster_load;
desc information_schema.cluster_load;
```

```
Expand All @@ -30,7 +30,7 @@ desc cluster_load;
字段解释:

* `TYPE`:对应于节点信息表 [`information_schema.cluster_info`](/reference/system-databases/cluster-info.md) 中的 `TYPE` 字段,可取值为 `tidb`,`pd` 和 `tikv`。
* `INSTANCE`:对应于节点信息表 `information_schema.cluster_info` 中的 `STATUS_ADDRESS` 字段。
* `INSTANCE`:对应于节点信息表 `information_schema.cluster_info` 中的 `INSTANCE` 字段。
* `DEVICE_TYPE`:硬件类型,目前可以查询的硬件类型有 `cpu`、`memory`、`disk` 和 `net`。
* `DEVICE_NAME`:硬件名。对于不同的 `DEVICE_TYPE`,`DEVICE_NAME` 取值不同。
* `cpu`:硬件名为 cpu。
Expand All @@ -45,21 +45,21 @@ desc cluster_load;
{{< copyable "sql" >}}

```sql
select * from cluster_load where device_type='cpu' and device_name='cpu';
select * from information_schema.cluster_load where device_type='cpu' and device_name='cpu';
```

```
+------+-----------------+-------------+-------------+--------+---------------+
| TYPE | INSTANCE | DEVICE_TYPE | DEVICE_NAME | NAME | VALUE |
+------+-----------------+-------------+-------------+--------+---------------+
| tidb | 127.0.0.1:10080 | cpu | cpu | load1 | 1.94 |
| tidb | 127.0.0.1:10080 | cpu | cpu | load5 | 2.16 |
| tidb | 127.0.0.1:10080 | cpu | cpu | load15 | 2.24 |
| pd | 127.0.0.1:2379 | cpu | cpu | load1 | 1.94 |
| pd | 127.0.0.1:2379 | cpu | cpu | load5 | 2.16 |
| pd | 127.0.0.1:2379 | cpu | cpu | load15 | 2.24 |
| tikv | 127.0.0.1:20160 | cpu | cpu | load1 | 1.94287109375 |
| tikv | 127.0.0.1:20160 | cpu | cpu | load5 | 2.15576171875 |
| tikv | 127.0.0.1:20160 | cpu | cpu | load15 | 2.2421875 |
+------+-----------------+-------------+-------------+--------+---------------+
+------+-----------------+-------------+-------------+--------+-------+
| TYPE | INSTANCE | DEVICE_TYPE | DEVICE_NAME | NAME | VALUE |
+------+-----------------+-------------+-------------+--------+-------+
| tidb | 0.0.0.0:4000 | cpu | cpu | load1 | 0.39 |
| tidb | 0.0.0.0:4000 | cpu | cpu | load5 | 0.36 |
| tidb | 0.0.0.0:4000 | cpu | cpu | load15 | 0.66 |
| pd | 127.0.0.1:2379 | cpu | cpu | load1 | 0.39 |
| pd | 127.0.0.1:2379 | cpu | cpu | load5 | 0.36 |
| pd | 127.0.0.1:2379 | cpu | cpu | load15 | 0.66 |
| tikv | 127.0.0.1:20160 | cpu | cpu | load1 | 0.39 |
| tikv | 127.0.0.1:20160 | cpu | cpu | load5 | 0.36 |
| tikv | 127.0.0.1:20160 | cpu | cpu | load15 | 0.66 |
+------+-----------------+-------------+-------------+--------+-------+
```
22 changes: 11 additions & 11 deletions reference/system-databases/cluster-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ TiDB 4.0 版本之前,要获取集群的日志,用户需要逐个登录各
{{< copyable "sql" >}}

```sql
desc cluster_log;
desc information_schema.cluster_log;
```

```
+----------+---------------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------------------+------+------+---------+-------+
| TIME | varchar(32) | YES | | NULL | |
| TYPE | varchar(64) | YES | | NULL | |
| INSTANCE | varchar(64) | YES | | NULL | |
| LEVEL | varchar(8) | YES | | NULL | |
| MESSAGE | var_string(1024) unsigned | YES | | NULL | |
+----------+---------------------------+------+------+---------+-------+
+----------+------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+------+---------+-------+
| TIME | varchar(32) | YES | | NULL | |
| TYPE | varchar(64) | YES | | NULL | |
| INSTANCE | varchar(64) | YES | | NULL | |
| LEVEL | varchar(8) | YES | | NULL | |
| MESSAGE | var_string(1024) | YES | | NULL | |
+----------+------------------+------+------+---------+-------+
5 rows in set (0.00 sec)
```

Expand All @@ -48,7 +48,7 @@ desc cluster_log;
{{< copyable "sql" >}}

```sql
select * from `CLUSTER_LOG` where message like '%ddl%' and message like '%job%58%' and type='tidb' and time > '2020-03-27 15:39:00';
select * from information_schema.cluster_log where message like '%ddl%' and message like '%job%58%' and type='tidb' and time > '2020-03-27 15:39:00';
```

```
Expand Down
6 changes: 3 additions & 3 deletions reference/system-databases/cluster-systeminfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ category: reference

# CLUSTER_SYSTEMINFO

集群负载表 `CLUSTER_SYSTEMINFO` 用于查询集群所有节点所在服务器的内核配置信息。目前支持查询 `sysctl` 的信息。
集群负载表 `CLUSTER_SYSTEMINFO` 用于查询集群所有实例所在服务器的内核配置信息。目前支持查询 `sysctl` 的信息。

{{< copyable "sql" >}}

```sql
desc cluster_systeminfo;
desc information_schema.cluster_systeminfo;
```

```
Expand Down Expand Up @@ -40,7 +40,7 @@ desc cluster_systeminfo;
查询集群所有服务器的内核版本示例如下:

```sql
select * from CLUSTER_SYSTEMINFO where name like '%kernel.osrelease%'
select * from information_schema.cluster_systeminfo where name like '%kernel.osrelease%'
```

```
Expand Down
Loading