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 2019/11/26 08:46:52 UTC

[GitHub] [incubator-shardingsphere] infinite-m commented on issue #3601: sharding-jdbc-spring-boot-starter upgraded to 4.0.0-RC3 failed

infinite-m commented on issue #3601: sharding-jdbc-spring-boot-starter upgraded to 4.0.0-RC3 failed
URL: https://github.com/apache/incubator-shardingsphere/issues/3601#issuecomment-558525792
 
 
   application.yml
   ```
   spring:
     shardingsphere:
       datasource:
         names: master,slave0 #数据源名称,多数据源以逗号分隔
         master:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           url: jdbc:mysql://xxx?useUnicode=true&useSSL=false&characterEncoding=utf8&tinyInt1isBit=false&serverTimezone=Asia/Shanghai
           username: 
           password: 
           # 连接池配置
           initial-size: 1
           max-active: 200
           min-idle: 1
           max-wait: 60000
           pool-prepared-statements: true
           max-pool-prepared-statement-per-connection-size: 20
           validation-query: select 'x' FROM DUAL
           test-on-borrow: false
           test-on-return: false
           test-while-idle: true
           time-between-eviction-runs-millis: 60000
           min-evictable-idle-time-millis: 30000
           async-init: true
         slave0:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           url: jdbc:mysql://xxx?useUnicode=true&useSSL=false&characterEncoding=utf8&tinyInt1isBit=false&serverTimezone=Asia/Shanghai
           username: 
           password: 
           # 连接池配置
           initial-size: 1
           max-active: 200
           min-idle: 1
           max-wait: 60000
           pool-prepared-statements: true
           max-pool-prepared-statement-per-connection-size: 20
           validation-query: select 'x' FROM DUAL
           test-on-borrow: false
           test-on-return: false
           test-while-idle: true
           time-between-eviction-runs-millis: 60000
           min-evictable-idle-time-millis: 30000
           async-init: true
       props:
         sql.show: true #是否开启SQL显示,默认值: false
       sharding:
         default-table-strategy: #默认表分片策略
           complex:
             sharding-columns: id,created_time
             algorithm-class-name: xxx.YearComplexShardingAlgorithm
         tables:
           case_object:
             actual-data-nodes: ds0.case_object_$->{2017..2022}
             table-strategy: #分表策略
               complex:
                 sharding-columns: id,created_time
                 algorithm-class-name: xxxYearComplexShardingAlgorithm
         master-slave-rules:
           ds0:
             master-data-source-name: master #主库数据源名称
             slave-data-source-names: slave0 #从库数据源名称列表
         broadcast-tables: 
         binding-tables:
           - case_object, case_node
           - case_node, case_node_att
   ```
   table info
   ```
   CREATE TABLE `case_object_2017` (
     `id` varchar(32) NOT NULL COMMENT 'id',
     `case_code` varchar(20) DEFAULT NULL COMMENT '',
     `sub_dis_id` varchar(12) NOT NULL COMMENT '',
     `created_by` varchar(32) NOT NULL COMMENT '',
     `created_time` timestamp NOT NULL COMMENT '',
     `del_flag` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '',
     PRIMARY KEY (`id`),
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='';
   ```

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


With regards,
Apache Git Services