daiyunqing edited a comment on issue #9352:
URL: https://github.com/apache/shardingsphere/issues/9352#issuecomment-774612929


   @Lucas-307 The source  rule config only read-write separation. new rule 
config is  read-write separation and  table sharding 。
   **Configuration is as follows:**
   
   
   **source rule config:**
   
   `schemaName: global_market
   dataSources:
     master0:
       url: 
jdbc:mysql://**:3306/global_market?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
     slave0:
       url: 
jdbc:mysql://**:3306/global_market?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   masterSlaveRule:
     name: global_market
     masterDataSourceName: master0
     slaveDataSourceNames: 
       - slave0 
   `
   
   **new dataBase rule config:**
   
   `schemaName: global_market_master0
   
   dataSources:
     master0:
       url: 
jdbc:mysql://**:3306/global_market?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
     slave0:
       url: 
jdbc:mysql://**:3306/global_market?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   masterSlaveRule:
     name: global_market_master0
     masterDataSourceName: master0
     slaveDataSourceNames:
         - slave0
   shardingRule:
   tables:
       t_coupon:
         actualDataNodes: global_market_master0.t_coupon_${0..1}
         tableStrategy:
           inline:
             shardingColumn: user_id
             algorithmExpression: t_coupon_${user_id % 2}`
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to