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/05/09 02:01:41 UTC

[GitHub] [shardingsphere] whmmm opened a new issue #5483: defaultDataSourceName cofing is not use

whmmm opened a new issue #5483:
URL: https://github.com/apache/shardingsphere/issues/5483


   ### Which version of ShardingSphere did you use?
   
   4.1.0
   ![image](https://user-images.githubusercontent.com/22763406/81461009-9e6c8980-91db-11ea-8a57-60428a92b879.png)
   
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-Proxy
   ### Expected behavior
   route to ds0
   ### Actual behavior
   no route, actual sql is the logical database
   ![image](https://user-images.githubusercontent.com/22763406/81461059-df649e00-91db-11ea-8b87-f2e80a5f1dbc.png)
   
   ![image](https://user-images.githubusercontent.com/22763406/81461072-fc00d600-91db-11ea-8ace-cd6640057825.png)
   
   ### Reason analyze (If you can)
   i dont't know
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   config file
   ```yaml
   
   schemaName: ly_tcdc
   
   dataSources:
     ds0:
       url: jdbc:mysql://192.168.0.193:3307/ly_tcdc_0?serverTimezone=GMT%2B8&useSSL=false
       username: root
       password: yxl16888
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 30
     ds1:
       url: jdbc:mysql://192.168.0.193:3307/ly_tcdc_1?serverTimezone=GMT%2B8&useSSL=false
       username: root
       password: yxl16888
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 30
     ds2:
       url: jdbc:mysql://192.168.0.193:3307/ly_tcdc_2?serverTimezone=GMT%2B8&useSSL=false
       username: root
       password: yxl16888
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 30
     ds3:
       url: jdbc:mysql://192.168.0.193:3307/ly_tcdc_3?serverTimezone=GMT%2B8&useSSL=false
       username: root
       password: yxl16888
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 30
     ds4:
       url: jdbc:mysql://192.168.0.193:3307/ly_tcdc_4?serverTimezone=GMT%2B8&useSSL=false
       username: root
       password: yxl16888
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 30
   
     ds5:
       url: jdbc:mysql://192.168.0.193:3307/ly_tcdc_5?serverTimezone=GMT%2B8&useSSL=false
       username: root
       password: yxl16888
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 30
   
   
   shardingRule:
     tables:
       
       tcdc_sn_jqssklltj:
         actualDataNodes: ds${0..5}.tcdc_sn_jqssklltj_2020_0${5..9}, ds${0..5}.tcdc_sn_jqssklltj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_jqfxskhlyhztj:
         actualDataNodes: ds${0..5}.tcdc_sn_jqfxskhlyhztj_2020_0${5..9}, ds${0..5}.tcdc_sn_jqfxskhlyhztj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_jqgnkyrfxsj:
         actualDataNodes: ds${0..5}.tcdc_sn_jqgnkyrfxsj_2020_0${5..9}, ds${0..5}.tcdc_sn_jqgnkyrfxsj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_xysskhlyhztj:
         actualDataNodes: ds${0..5}.tcdc_sn_xysskhlyhztj_2020_0${5..9}, ds${0..5}.tcdc_sn_xysskhlyhztj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_dsfxskhlyhztj:
         actualDataNodes: ds${0..5}.tcdc_sn_dsfxskhlyhztj_2020_0${5..9}, ds${0..5}.tcdc_sn_dsfxskhlyhztj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_qgyhjqdlsc:
         actualDataNodes: ds${0..5}.tcdc_sn_qgyhjqdlsc_2020_0${5..9}, ds${0..5}.tcdc_sn_qgyhjqdlsc_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_kyrqtzsj:
         actualDataNodes: ds${0..5}.tcdc_sn_kyrqtzsj_2020_0${5..9}, ds${0..5}.tcdc_sn_kyrqtzsj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_mcyhmddhz:
         actualDataNodes: ds${0..5}.tcdc_sn_mcyhmddhz_2020_0${5..9}, ds${0..5}.tcdc_sn_mcyhmddhz_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_zzczrkfzsj:
         actualDataNodes: ds${0..5}.tcdc_sn_zzczrkfzsj_2020_0${5..9}, ds${0..5}.tcdc_sn_zzczrkfzsj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_zzczrkxssj:
         actualDataNodes: ds${0..5}.tcdc_sn_zzczrkxssj_2020_0${5..9}, ds${0..5}.tcdc_sn_zzczrkxssj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_zzczrkrsj:
         actualDataNodes: ds${0..5}.tcdc_sn_zzczrkrsj_2020_0${5..9}, ds${0..5}.tcdc_sn_zzczrkrsj_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_city_flow_realtime:
         actualDataNodes: ds${0..5}.tcdc_sn_city_flow_realtime_2020_0${5..9}, ds${0..5}.tcdc_sn_city_flow_realtime_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_city_flow_hour:
         actualDataNodes: ds${0..5}.tcdc_sn_city_flow_hour_2020_0${5..9}, ds${0..5}.tcdc_sn_city_flow_hour_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
       tcdc_sn_city_flow_day:
         actualDataNodes: ds${0..5}.tcdc_sn_city_flow_day_2020_0${5..9}, ds${0..5}.tcdc_sn_city_flow_day_2020_10
         databaseStrategy:
           inline:
             shardingColumn: id
             algorithmExpression: ds${id % 6}
         tableStrategy:
           complex:
             shardingColumns:  ctime
             algorithmClassName: com.cjy.sharding.CtimeShardingAlgorithm
         keyGenerator:
           type: SNOWFLAKE
           column: id 
     bindingTables:
       - tcdc_sn_jqssklltj, tcdc_sn_jqfxskhlyhztj, tcdc_sn_jqgnkyrfxsj, tcdc_sn_xysskhlyhztj, tcdc_sn_dsfxskhlyhztj, tcdc_sn_qgyhjqdlsc, tcdc_sn_kyrqtzsj, tcdc_sn_mcyhmddhz, tcdc_sn_zzczrkfzsj, tcdc_sn_zzczrkxssj, tcdc_sn_zzczrkrsj, tcdc_sn_city_flow_realtime, tcdc_sn_city_flow_hour, tcdc_sn_city_flow_day
       - tcdc_sn_sceniccoderegion,tcdc_sn_unicom_job,tcdc_sn_quartzjob
     #defaultTableStrategy:
      # none: 
     defaultDataSourceName: ds1
   
   
   ```


----------------------------------------------------------------
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