tuohai666 commented on issue #2397: MasterSlaveDatasource and 
shardingDatasource could be used together in shardingproxy?
URL: 
https://github.com/apache/incubator-shardingsphere/issues/2397#issuecomment-494738974
 
 
   Try config as follow which will be updated in official website few days 
later.
   
   ### Data Sharding + Data Masking
   
   dataSources:
   
   ```yaml
   schemaName: sharding_db
   
   dataSources:
     ds0: 
       url: jdbc:postgresql://localhost:5432/ds0
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 65
     ds1:
       url: jdbc:postgresql://localhost:5432/ds1
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 65
   
   shardingRule:  
     tables:
       t_order: 
         actualDataNodes: ds${0..1}.t_order${0..1}
         tableStrategy: 
           inline:
             shardingColumn: order_id
             algorithmExpression: t_order${order_id % 2}
         keyGenerator:
           type: SNOWFLAKE
           columnn: order_id
       t_order_item:
         actualDataNodes: ds${0..1}.t_order_item${0..1}
         tableStrategy:
           inline:
             shardingColumn: order_id
             algorithmExpression: t_order_item${order_id % 2}
         keyGenerator:
           type: SNOWFLAKE
           columnn: order_item_id
     bindingTables:
       - t_order,t_order_item
     defaultDatabaseStrategy:
       inline:
         shardingColumn: user_id
         algorithmExpression: ds${user_id % 2}
     defaultTableStrategy:
       none:
       
     encryptRule:
       encryptors:
         order_encryptor:
           type: AES
           qualifiedColumns: t_order.order_id
           props:
             aes.key.value: 123456  
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to