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.

CLUSTER_INFO - 图1

Note

This table is not available on TiDB Serverless clusters.

  1. USE information_schema;
  2. desc cluster_info;
  1. +----------------+-------------+------+------+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +----------------+-------------+------+------+---------+-------+
  4. | TYPE | varchar(64) | YES | | NULL | |
  5. | INSTANCE | varchar(64) | YES | | NULL | |
  6. | STATUS_ADDRESS | varchar(64) | YES | | NULL | |
  7. | VERSION | varchar(64) | YES | | NULL | |
  8. | GIT_HASH | varchar(64) | YES | | NULL | |
  9. | START_TIME | varchar(32) | YES | | NULL | |
  10. | UPTIME | varchar(32) | YES | | NULL | |
  11. | SERVER_ID | bigint(21) | YES | | NULL | |
  12. +----------------+-------------+------+------+---------+-------+
  13. 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.
  1. SELECT * FROM cluster_info;
  1. +------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+---------------------+
  2. | TYPE | INSTANCE | STATUS_ADDRESS | VERSION | GIT_HASH | START_TIME | UPTIME |
  3. +------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+---------------------+
  4. | 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 |
  5. | 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 |
  6. | 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 |
  7. +------+-----------------+-----------------+--------------+------------------------------------------+---------------------------+---------------------+
  8. 3 rows in set (0.00 sec)