SHOW DB_DISCOVERY RULE

Description

The SHOW DB_DISCOVERY RULE syntax is used to query specified database discovery rules for specified database.

Syntax

Grammar Railroad diagram

  1. ShowDatabaseDiscoveryRule::=
  2. 'SHOW' 'DB_DISCOVERY' ('RULE' ruleName | 'RULES') ('FROM' databaseName)?
  3. ruleName ::=
  4. identifier
  5. databaseName ::=
  6. identifier

Supplement

  • When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.

Return value description

ColumnDescription
group_nameDatabase discovery Rule name
data_source_namesData source name list
primary_data_source_namePrimary data source name
discovery_typeDatabase discovery service type
discovery_heartbeatDatabase discovery service heartbeat

Example

  • Query database discovery rules for specified database.
  1. SHOW DB_DISCOVERY RULES FROM discovery_db;
  1. mysql> SHOW DB_DISCOVERY RULES FROM discovery_db;
  2. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  3. | group_name | data_source_names | primary_data_source_name | discovery_type | discovery_heartbeat |
  4. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  5. | group_0 | ds_0,ds_1,ds_2 | ds_0 | {name=group_0_MySQL.MGR, type=MySQL.MGR, props={group-name=558edd3c-02ec-11ea-9bb3-080027e39bd2}} | {name=group_0_heartbeat, props={keep-alive-cron=0/5 * * * * ?}} |
  6. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  7. 1 row in set (0.01 sec)
  • Query database discovery rules for current database.
  1. SHOW DB_DISCOVERY RULES;
  1. mysql> SHOW DB_DISCOVERY RULES;
  2. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  3. | group_name | data_source_names | primary_data_source_name | discovery_type | discovery_heartbeat |
  4. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  5. | group_0 | ds_0,ds_1,ds_2 | ds_0 | {name=group_0_MySQL.MGR, type=MySQL.MGR, props={group-name=558edd3c-02ec-11ea-9bb3-080027e39bd2}} | {name=group_0_heartbeat, props={keep-alive-cron=0/5 * * * * ?}} |
  6. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  7. 1 row in set (0.03 sec)
  • Query specified database discovery rule for specified database.
  1. SHOW DB_DISCOVERY RULE group_0 FROM discovery_db;
  1. mysql> SHOW DB_DISCOVERY RULE group_0 FROM discovery_db;
  2. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  3. | group_name | data_source_names | primary_data_source_name | discovery_type | discovery_heartbeat |
  4. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  5. | group_0 | ds_0,ds_1,ds_2 | ds_0 | {name=group_0_MySQL.MGR, type=MySQL.MGR, props={group-name=558edd3c-02ec-11ea-9bb3-080027e39bd2}} | {name=group_0_heartbeat, props={keep-alive-cron=0/5 * * * * ?}} |
  6. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  7. 1 row in set (0.01 sec)
  • Query specified database discovery rule for current database.
  1. SHOW DB_DISCOVERY RULE group_0;
  1. mysql> SHOW DB_DISCOVERY RULE group_0;
  2. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  3. | group_name | data_source_names | primary_data_source_name | discovery_type | discovery_heartbeat |
  4. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  5. | group_0 | ds_0,ds_1,ds_2 | ds_0 | {name=group_0_MySQL.MGR, type=MySQL.MGR, props={group-name=558edd3c-02ec-11ea-9bb3-080027e39bd2}} | {name=group_0_heartbeat, props={keep-alive-cron=0/5 * * * * ?}} |
  6. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
  7. 1 row in set (0.03 sec)

Reserved word

SHOW, DB_DISCOVERY, RULE, RULES, FROM