ALTER READWRITE_SPLITTING RULE

描述

ALTER READWRITE_SPLITTING RULE 语法用于修改读写分离规则

语法定义

语法 铁路图

  1. AlterReadwriteSplittingRule ::=
  2. 'ALTER' 'READWRITE_SPLITTING' 'RULE' readwriteSplittingDefinition (',' readwriteSplittingDefinition)*
  3. readwriteSplittingDefinition ::=
  4. ruleName '(' (staticReadwriteSplittingDefinition | dynamicReadwriteSplittingDefinition) (',' loadBalancerDefinition)? ')'
  5. staticReadwriteSplittingDefinition ::=
  6. 'WRITE_STORAGE_UNIT' '=' writeStorageUnitName ',' 'READ_STORAGE_UNITS' '(' storageUnitName (',' storageUnitName)* ')'
  7. dynamicReadwriteSplittingDefinition ::=
  8. 'AUTO_AWARE_RESOURCE' '=' resourceName
  9. loadBalancerDefinition ::=
  10. 'TYPE' '(' 'NAME' '=' loadBalancerType (',' propertiesDefinition)? ')'
  11. ruleName ::=
  12. identifier
  13. writeStorageUnitName ::=
  14. identifier
  15. storageUnitName ::=
  16. identifier
  17. resourceName ::=
  18. identifier
  19. loadBalancerType ::=
  20. string
  21. propertiesDefinition ::=
  22. 'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
  23. key ::=
  24. string
  25. value ::=
  26. literal

补充说明

  • 动态读写分离规则依赖于数据库发现规则;
  • loadBalancerType 指定负载均衡算法类型,请参考负载均衡算法);

示例

修改静态读写分离规则

  1. ALTER READWRITE_SPLITTING RULE ms_group_0 (
  2. WRITE_STORAGE_UNIT=write_ds,
  3. READ_STORAGE_UNITS(read_ds_0,read_ds_1),
  4. TYPE(NAME="random")
  5. );

修改动态读写分离规则

  1. ALTER READWRITE_SPLITTING RULE ms_group_1 (
  2. AUTO_AWARE_RESOURCE=group_0
  3. TYPE(NAME="random")
  4. );

保留字

ALTERREADWRITE_SPLITTINGRULEWRITE_STORAGE_UNITREAD_STORAGE_UNITSAUTO_AWARE_RESOURCETYPENAMEPROPERTIESTRUEFALSE

相关链接