ALTER READWRITE_SPLITTING RULE

描述

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

语法定义

语法 铁路图

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

补充说明

  • transactionalReadQueryStrategyType 指定事务内读请求路由策略,请参考YAML 配置
  • 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. );

保留字

ALTERREADWRITE_SPLITTINGRULEWRITE_STORAGE_UNITREAD_STORAGE_UNITSTYPENAMEPROPERTIESTRUEFALSE

相关链接