Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 3.71 KB

information-schema-cluster-info.md

File metadata and controls

64 lines (53 loc) · 3.71 KB
title summary aliases
CLUSTER_INFO
Learn the `CLUSTER_INFO` cluster topology information table.
/docs/dev/system-tables/system-table-cluster-info/
/docs/dev/reference/system-databases/cluster-info/
/tidb/dev/system-table-cluster-info/

CLUSTER_INFO

The CLUSTER_INFO cluster topology table provides the current topology information of the cluster, the version information of each instance, the Git Hash corresponding to the instance version, the starting time of each instance, and the running time of each instance.

Note:

This table is not available on TiDB Cloud Serverless clusters.

{{< copyable "sql" >}}

USE information_schema;
desc cluster_info;
+----------------+-------------+------+------+---------+-------+
| Field          | Type        | Null | Key  | Default | Extra |
+----------------+-------------+------+------+---------+-------+
| TYPE           | varchar(64) | YES  |      | NULL    |       |
| INSTANCE       | varchar(64) | YES  |      | NULL    |       |
| STATUS_ADDRESS | varchar(64) | YES  |      | NULL    |       |
| VERSION        | varchar(64) | YES  |      | NULL    |       |
| GIT_HASH       | varchar(64) | YES  |      | NULL    |       |
| START_TIME     | varchar(32) | YES  |      | NULL    |       |
| UPTIME         | varchar(32) | YES  |      | NULL    |       |
| SERVER_ID      | bigint(21)  | YES  |      | NULL    |       |
+----------------+-------------+------+------+---------+-------+
8 rows in set (0.01 sec)

Field description:

  • TYPE: The instance type. The optional values are tidb, pd, and tikv.
  • INSTANCE: The instance address, which is a string in the format of IP:PORT.
  • STATUS_ADDRESS: The service address of HTTP API. Some commands in tikv-ctl, pd-ctl, or tidb-ctl might use this API and this address. You can also get more cluster information via this address. Refer to TiDB HTTP API document for details.
  • VERSION: The semantic version number of the corresponding instance. To be compatible with the MySQL version number, the TiDB version is displayed in the format of ${mysql-version}-${tidb-version}.
  • GIT_HASH: The Git Commit Hash when compiling the instance version, which is used to identify whether two instances are of the absolutely consistent version.
  • START_TIME: The starting time of the corresponding instance.
  • UPTIME: The uptime of the corresponding instance.
  • SERVER_ID: The server ID of the corresponding instance.

{{< copyable "sql" >}}

SELECT * FROM cluster_info;
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+---------------------+
| 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.2 | 0df3b74f55f8f8fbde39bbd5d471783f49dc10f7 | 2020-07-05T09:25:53-06:00 | 26h39m4.352862693s  |
| pd   | 127.0.0.1:2379  | 127.0.0.1:2379  | 4.1.0-alpha  | 1ad59bcbf36d87082c79a1fffa3b0895234ac862 | 2020-07-05T09:25:47-06:00 | 26h39m10.352868103s |
| tikv | 127.0.0.1:20165 | 127.0.0.1:20180 | 4.1.0-alpha  | b45e052df8fb5d66aa8b3a77b5c992ddbfbb79df | 2020-07-05T09:25:50-06:00 | 26h39m7.352869963s  |
+------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+---------------------+
3 rows in set (0.00 sec)