SHOW DB_DISCOVERY RULE

    语法

    • 未指定 databaseName 时,默认是当前使用的 DATABASE。 如果也未使用 DATABASE 则会提示 No database selected

    返回值说明

    • 查询指定逻辑库中的数据库发现规则
    1. SHOW DB_DISCOVERY RULES FROM discovery_db;
    1. mysql> SHOW DB_DISCOVERY RULES FROM discovery_db;
    2. | group_name | data_source_names | primary_data_source_name | discovery_type | discovery_heartbeat |
    3. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
    4. | 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 * * * * ?}} |
    5. 1 row in set (0.01 sec)
    • 查询当前逻辑库中的数据库发现规则
    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. 1 row in set (0.03 sec)
    • 查询指定逻辑库中的指定数据库发现规则
    1. SHOW DB_DISCOVERY RULE group_0 FROM discovery_db;
    • 查询当前逻辑库中的指定数据库发现规则
    1. SHOW DB_DISCOVERY RULE group_0;
    1. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
    2. | group_name | data_source_names | primary_data_source_name | discovery_type | discovery_heartbeat |
    3. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+
    4. | 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 * * * * ?}} |
    5. +------------+-------------------+--------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+

    保留字