You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/24 09:22:06 UTC

[GitHub] [shardingsphere] duzhanfei commented on issue #8314: Is the config of Data Sharding + Read-Write Split correct in?

duzhanfei commented on issue #8314:
URL: https://github.com/apache/shardingsphere/issues/8314#issuecomment-732767704


   config in config-replica-query.yaml 
   
   
   schemaName: replica_query_db
   
   dataSourceCommon:
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
     maxPoolSize: 50
     minPoolSize: 1
     maintenanceIntervalMilliseconds: 30000
   
   dataSources:
     primary_ds:
       url: jdbc:mysql://127.5.2.31:3306/crm_customer_db_master0?serverTimezone=UTC&useSSL=false
       username: root
       password: root
     replica_ds_0:
       url: jdbc:mysql://127.5.2.32:3306/crm_customer_db_master0_slave0?serverTimezone=UTC&useSSL=false
       username: root
       password: root
     replica_ds_1:
       url: jdbc:mysql://127.5.2.33:3306/crm_customer_db_master0_slave1?serverTimezone=UTC&useSSL=false
       username: root
       password: root
     ds_default:
       url: jdbc:mysql://127.5.2.34:3306/cdsp_crm_db?serverTimezone=UTC&useSSL=false
       username: root
       password: root
   
   rules:
   - !SHARDING
     tables:
       pbcst_qry_info:
         actualDataNodes: ms_ds.pbcst_qry_info_${0..15}
         tableStrategy:
           standard:
             shardingColumn: ecif_cust_no
             shardingAlgorithmName: pbcst_qry_info_inline
         databaseStrategy:
           standard:
             shardingColumn: ecif_cust_no
             shardingAlgorithmName: database_inline
         keyGenerateStrategy:
           column: ecif_cust_no
           keyGeneratorName: snowflake
   		
     defaultDatabaseStrategy:
       standard:
         shardingColumn: ecif_cust_no
         shardingAlgorithmName: ds_default
     defaultTableStrategy:
       none:
   
     shardingAlgorithms:
       database_default_inline:
         type: INLINE
         props:
           algorithm-expression: ms_ds
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ms_ds
       pbcst_qry_info_inline:
         type: INLINE
         props:
           algorithm-expression: pbcst_qry_info_${Math.abs(ecif_cust_no.hashCode() % 16)}
   		
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   		
   - !REPLICA_QUERY
     dataSources:
       ms_ds:
         name: ms_ds
         primaryDataSourceName: primary_ds
         replicaDataSourceNames:
           - replica_ds_0
           - replica_ds_1


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