ALTER TRAFFIC RULE

描述

ALTER TRAFFIC RULE 语法用于修改双路由规则。

语法定义

语法 铁路图

  1. AlterTrafficRule ::=
  2. 'ALTER' 'TRAFFIC' 'RULE' '(' 'LABELS' '(' lableName ')' ',' trafficAlgorithmDefinition ',' loadBalancerDefinition ')'
  3. lableName ::=
  4. identifier
  5. trafficAlgorithmDefinition ::=
  6. 'TRAFFIC_ALGORITHM' '(' 'TYPE' '(' 'NAME' '=' trafficAlgorithmTypeName (',' propertiesDefinition)? ')' ')'
  7. loadBalancerDefinition ::=
  8. 'LOAD_BALANCER' '(' 'TYPE' '(' 'NAME' '=' loadBalancerName (',' propertiesDefinition)? ')' ')'
  9. propertiesDefinition ::=
  10. 'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
  11. trafficAlgorithmTypeName ::=
  12. string
  13. loadBalancerTypeName ::=
  14. string
  15. key ::=
  16. string
  17. value ::=
  18. literal

补充说明

  • TRAFFIC_ALGORITHM 支持 SQL_MATCHSQL_HINT 两种类型

  • LOAD_BALANCER 支持 RANDOMROUND_ROBIN 两种类型

示例

  • 修改双路由规则
  1. ALTER TRAFFIC RULE sql_match_traffic (
  2. LABELS (OLTP),
  3. TRAFFIC_ALGORITHM(TYPE(NAME="SQL_MATCH",PROPERTIES("sql" = "SELECT * FROM t_order WHERE order_id = 1; UPDATE t_order SET order_id = 5;"))),
  4. LOAD_BALANCER(TYPE(NAME="RANDOM")));

保留字

ALTERTRAFFICRULELABELSTYPENAMEPROPERTIESTRAFFIC_ALGORITHMLOAD_BALANCER

相关链接