DB Discovery

Definition

  1. CREATE DB_DISCOVERY RULE databaseDiscoveryRuleDefinition [, databaseDiscoveryRuleDefinition] ...
  2. ALTER DB_DISCOVERY RULE databaseDiscoveryRuleDefinition [, databaseDiscoveryRuleDefinition] ...
  3. DROP DB_DISCOVERY RULE ruleName [, ruleName] ...
  4. databaseDiscoveryRuleDefinition:
  5. ruleName(resources, discoveryTypeDefinition)
  6. resources:
  7. RESOURCES(resourceName [, resourceName] ...)
  8. discoveryTypeDefinition:
  9. TYPE(NAME=discoveryType [, PROPERTIES([algorithmProperties] )] )
  10. algorithmProperties:
  11. algorithmProperty [, algorithmProperty] ...
  12. algorithmProperty:
  13. key=value
  • discoveryType specifies the database discovery service type, ShardingSphere has built-in support for MGR
  • Duplicate ruleName will not be created

Example

  1. CREATE DB_DISCOVERY RULE ha_group_0 (
  2. RESOURCES(resource_0,resource_1),
  3. TYPE(NAME=mgr,PROPERTIES(groupName='92504d5b-6dec',keepAliveCron=''))
  4. );
  5. ALTER DB_DISCOVERY RULE ha_group_0 (
  6. RESOURCES(resource_0,resource_1,resource_2),
  7. TYPE(NAME=mgr,PROPERTIES(groupName='92504d5b-6dec' ,keepAliveCron=''))
  8. );
  9. DROP DB_DISCOVERY RULE ha_group_0;