| ###################################################################################################### |
| # |
| # Here you can configure the rules for the proxy. |
| # This example is configuration of sharding rule. |
| # |
| # If you want to use sharding, please refer to this file; |
| # if you want to use master-slave, please refer to the config-proxy-rangerouting-masterslave.yaml. |
| # |
| ###################################################################################################### |
| |
| schemaName: sharding_db |
| |
| dataSourceCommon: |
| username: root |
| password: |
| connectionTimeoutMilliseconds: 30000 |
| idleTimeoutMilliseconds: 60000 |
| maxLifetimeMilliseconds: 1800000 |
| maxPoolSize: 200 |
| minPoolSize: 200 |
| maintenanceIntervalMilliseconds: 30000 |
| |
| dataSources: |
| press_test_0: |
| url: jdbc:mysql://ss.benchmark.fullrouting.sharding.ds0:3306/shardingsphere_benchmark?serverTimezone=UTC&useSSL=false |
| press_test_1: |
| url: jdbc:mysql://ss.benchmark.fullrouting.sharding.ds1:3306/shardingsphere_benchmark?serverTimezone=UTC&useSSL=false |
| press_test_2: |
| url: jdbc:mysql://ss.benchmark.fullrouting.sharding.ds2:3306/shardingsphere_benchmark?serverTimezone=UTC&useSSL=false |
| press_test_3: |
| url: jdbc:mysql://ss.benchmark.fullrouting.sharding.ds3:3306/shardingsphere_benchmark?serverTimezone=UTC&useSSL=false |
| |
| rules: |
| - !SHARDING |
| defaultTableStrategy: |
| none: |
| tables: |
| sbtest: |
| actualDataNodes: press_test_${0..3}.sbtest${0..99} |
| databaseStrategy: |
| standard: |
| shardingColumn: id |
| shardingAlgorithmName: database_inline |
| tableStrategy: |
| standard: |
| shardingColumn: k |
| shardingAlgorithmName: table_inline |
| keyGenerateStrategy: |
| column: id |
| keyGeneratorName: increment |
| |
| shardingAlgorithms: |
| database_inline: |
| type: INLINE |
| props: |
| algorithm-expression: press_test_${id % 4} |
| table_inline: |
| type: INLINE |
| props: |
| algorithm-expression: sbtest${k % 100} |
| |
| keyGenerators: |
| increment: |
| type: SNOWFLAKE |