CLUSTER_CONFIG

You can use the CLUSTER_CONFIG cluster configuration table to get the current configuration of all server components in the cluster. This simplifies the usage over earlier releases of TiDB, where obtaining similar information would require accessing the HTTP API endpoints of each instance.

CLUSTER_CONFIG - 图1

Note

This table is only applicable to TiDB Self-Hosted and not available on TiDB Cloud.

  1. USE information_schema;
  2. DESC cluster_config;
  1. +----------+--------------+------+------+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +----------+--------------+------+------+---------+-------+
  4. | TYPE | varchar(64) | YES | | NULL | |
  5. | INSTANCE | varchar(64) | YES | | NULL | |
  6. | KEY | varchar(256) | YES | | NULL | |
  7. | VALUE | varchar(128) | YES | | NULL | |
  8. +----------+--------------+------+------+---------+-------+

Field description:

  • TYPE: The instance type. The optional values are tidb, pd, and tikv.
  • INSTANCE: The service address of the instance.
  • KEY: The configuration item name.
  • VALUE: The configuration item value.

The following example shows how to query the coprocessor configuration on the TiKV instance using the CLUSTER_CONFIG table:

  1. SELECT * FROM cluster_config WHERE type='tikv' AND `key` LIKE 'coprocessor%';
  1. +------+-----------------+-----------------------------------+---------+
  2. | TYPE | INSTANCE | KEY | VALUE |
  3. +------+-----------------+-----------------------------------+---------+
  4. | tikv | 127.0.0.1:20165 | coprocessor.batch-split-limit | 10 |
  5. | tikv | 127.0.0.1:20165 | coprocessor.region-max-keys | 1440000 |
  6. | tikv | 127.0.0.1:20165 | coprocessor.region-max-size | 144MiB |
  7. | tikv | 127.0.0.1:20165 | coprocessor.region-split-keys | 960000 |
  8. | tikv | 127.0.0.1:20165 | coprocessor.region-split-size | 96MiB |
  9. | tikv | 127.0.0.1:20165 | coprocessor.split-region-on-table | false |
  10. +------+-----------------+-----------------------------------+---------+
  11. 6 rows in set (0.00 sec)