算法配置

分片算法

  1. shardingAlgorithms:
  2. # algorithmName 由用户指定,需要和分片策略中的 shardingAlgorithmName 属性一致
  3. <algorithmName>:
  4. # type 和 props,请参考分片内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/sharding/
  5. type: xxx
  6. props:
  7. xxx: xxx

加密算法

  1. encryptors:
  2. # encryptorName 由用户指定,需要和加密规则中的 encryptorName 属性一致
  3. <encryptorName>:
  4. # type 和 props,请参考加密内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/encrypt/
  5. type: xxx
  6. props:
  7. xxx: xxx

读写分离负载均衡算法

  1. loadBalancers:
  2. # loadBalancerName 由用户指定,需要和读写分离规则中的 loadBalancerName 属性一致
  3. <loadBalancerName>:
  4. # type 和 props,请参考读写分离负载均衡内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/load-balance/
  5. type: xxx
  6. props:
  7. xxx: xxx

影子算法

  1. shadowAlgorithms:
  2. # shadowAlgorithmName 由用户指定,需要和影子库规则中的 shadowAlgorithmNames 属性一致
  3. <shadowAlgorithmName>:
  4. # type 和 props,请参考影子库内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/shadow/
  5. type: xxx
  6. props:
  7. xxx: xxx

高可用

  1. discoveryTypes:
  2. # discoveryTypeName 由用户指定,需要和数据库发现规则中的 discoveryTypeName 属性一致
  3. <discoveryTypeName>:
  4. type: xxx
  5. props:
  6. xxx: xxx

脱敏算法

  1. maskAlgorithms:
  2. # maskAlgorithmName 由用户指定,需要和脱敏规则中的 maskAlgorithm 属性一致
  3. <maskAlgorithmName>:
  4. # type 和 props,请参考脱敏内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/mask/
  5. type: xxx
  6. props:
  7. xxx: xxx