Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 2.7 KB

information-schema-cluster-systeminfo.md

File metadata and controls

55 lines (45 loc) · 2.7 KB
title summary aliases
CLUSTER_SYSTEMINFO
了解 TiDB 集群负载表 `CLUSTER_SYSTEMINFO`。
/docs-cn/dev/system-tables/system-table-cluster-systeminfo/
/docs-cn/dev/reference/system-databases/cluster-systeminfo/
/zh/tidb/dev/system-table-cluster-systeminfo/
/dev/information-schema/information-schema-cluster-systeminfo/

CLUSTER_SYSTEMINFO

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

{{< copyable "sql" >}}

USE information_schema;
DESC cluster_systeminfo;
+-------------+--------------+------+------+---------+-------+
| Field       | Type         | Null | Key  | Default | Extra |
+-------------+--------------+------+------+---------+-------+
| TYPE        | varchar(64)  | YES  |      | NULL    |       |
| INSTANCE    | varchar(64)  | YES  |      | NULL    |       |
| SYSTEM_TYPE | varchar(64)  | YES  |      | NULL    |       |
| SYSTEM_NAME | varchar(64)  | YES  |      | NULL    |       |
| NAME        | varchar(256) | YES  |      | NULL    |       |
| VALUE       | varchar(128) | YES  |      | NULL    |       |
+-------------+--------------+------+------+---------+-------+
6 rows in set (0.00 sec)

字段解释:

  • TYPE:对应于节点信息表 information_schema.cluster_info 中的 TYPE 字段,可取值为 tidbpdtikv
  • INSTANCE:对应于节点信息表 information_schema.cluster_info 中的 INSTANCE 字段。
  • SYSTEM_TYPE:系统类型,目前可以查询的系统类型有 system
  • SYSTEM_NAME:目前可以查询的 SYSTEM_NAMEsysctl
  • NAMEsysctl 对应的配置名。
  • VALUEsysctl 对应配置项的值。

查询集群所有服务器的内核版本示例如下:

SELECT * FROM cluster_systeminfo WHERE name LIKE '%kernel.osrelease%'
+------+-------------------+-------------+-------------+------------------+----------------------------+
| TYPE | INSTANCE          | SYSTEM_TYPE | SYSTEM_NAME | NAME             | VALUE                      |
+------+-------------------+-------------+-------------+------------------+----------------------------+
| tidb | 172.16.5.40:4008  | system      | sysctl      | kernel.osrelease | 3.10.0-862.14.4.el7.x86_64 |
| pd   | 172.16.5.40:20379 | system      | sysctl      | kernel.osrelease | 3.10.0-862.14.4.el7.x86_64 |
| tikv | 172.16.5.40:21150 | system      | sysctl      | kernel.osrelease | 3.10.0-862.14.4.el7.x86_64 |
+------+-------------------+-------------+-------------+------------------+----------------------------+