balainit edited a comment on issue #11882:
URL: 
https://github.com/apache/shardingsphere/issues/11882#issuecomment-901740072


   
   shardingsphere   version    sharding-jdbc-core-4.1.1
   
   #数据源配置
   
   
   ```
   spring.shardingsphere.datasource.names=ds0,ds1
   
   spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource
   
spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.cj.jdbc.Driver
   
spring.shardingsphere.datasource.ds0.jdbc-url=jdbc:mysql://db:3306/xxx?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=true
   spring.shardingsphere.datasource.ds0.username=xxxx
   spring.shardingsphere.datasource.ds0.password=xxxx
   
   spring.shardingsphere.datasource.ds1.type=com.zaxxer.hikari.HikariDataSource
   
spring.shardingsphere.datasource.ds1.driver-class-name=com.mysql.cj.jdbc.Driver
   
spring.shardingsphere.datasource.ds1.jdbc-url=jdbc:mysql://db:3306/xxxxxx?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=true
   spring.shardingsphere.datasource.ds1.username=xxxx
   spring.shardingsphere.datasource.ds1.password=xxxxx
   
   spring.shardingsphere.datasource.ds0.hikari.minimum-idle=10
   spring.shardingsphere.datasource.ds0.hikari.maximum-pool-size=65
   spring.shardingsphere.datasource.ds0.hikari.connection-timeout=30000
   spring.shardingsphere.datasource.ds0.hikari.idle-timeout=60000
   spring.shardingsphere.datasource.ds0.hikari.max-lifetime=1800000
   
   spring.shardingsphere.sharding.default-data-source-name=ds0
   
spring.shardingsphere.sharding.default-database-strategy.inline.sharding-column=id
   
spring.shardingsphere.sharding.default-database-strategy.inline.algorithm-expression=ds$->{0}
   
   
spring.shardingsphere.sharding.tables.product_spu.actual-data-nodes=ds$->{0..0}.product_spu_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_spu.table-strategy.inline.sharding-column=id
   
spring.shardingsphere.sharding.tables.product_spu.table-strategy.inline.algorithm-expression=product_spu_$->{id
 % 2}
   
   
spring.shardingsphere.sharding.tables.product_sku.actual-data-nodes=ds0.product_sku_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_sku.table-strategy.inline.sharding-column=spu_id
   
spring.shardingsphere.sharding.tables.product_sku.table-strategy.inline.algorithm-expression=product_sku_$->{spu_id
 % 2}
   
   
spring.shardingsphere.sharding.tables.product_spu_snapshot.actual-data-nodes=ds0.product_spu_snapshot_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_spu_snapshot.table-strategy.inline.sharding-column=spu_id
   
spring.shardingsphere.sharding.tables.product_spu_snapshot.table-strategy.inline.algorithm-expression=product_spu_snapshot_$->{spu_id
 % 2}
   
   
spring.shardingsphere.sharding.tables.product_sku_snapshot.actual-data-nodes=ds0.product_sku_snapshot_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_sku_snapshot.table-strategy.inline.sharding-column=sku_id
   
spring.shardingsphere.sharding.tables.product_sku_snapshot.table-strategy.inline.algorithm-expression=product_sku_snapshot_$->{sku_id
 % 2}
   
   
spring.shardingsphere.sharding.tables.product_daily_calendar.actual-data-nodes=ds0.product_daily_calendar_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_daily_calendar.table-strategy.inline.sharding-column=product_id
   
spring.shardingsphere.sharding.tables.product_daily_calendar.table-strategy.inline.algorithm-expression=product_daily_calendar_$->{product_id
 % 2}
   
   
   
spring.shardingsphere.sharding.tables.product_distribution.actual-data-nodes=ds0.product_distribution_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_distribution.table-strategy.inline.sharding-column=product_id
   
spring.shardingsphere.sharding.tables.product_distribution.table-strategy.inline.algorithm-expression=product_distribution_$->{product_id
 % 2}
   
   
   
spring.shardingsphere.sharding.tables.product_warehouse_bills.actual-data-nodes=ds0.product_warehouse_bills_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_warehouse_bills.table-strategy.inline.sharding-column=id
   
spring.shardingsphere.sharding.tables.product_warehouse_bills.table-strategy.inline.algorithm-expression=product_warehouse_bills_$->{id
 % 2}
   
   
   
spring.shardingsphere.sharding.tables.product_warehouse_detail.actual-data-nodes=ds0.product_warehouse_detail_$->{0..1}
   
spring.shardingsphere.sharding.tables.product_warehouse_detail.table-strategy.inline.sharding-column=warehouse_bills_id
   
spring.shardingsphere.sharding.tables.product_warehouse_detail.table-strategy.inline.algorithm-expression=product_warehouse_detail_$->{warehouse_bills_id
 % 2}
   
   
   spring.shardingsphere.sharding.broadcast-tables[0]=product_category
   
spring.shardingsphere.sharding.tables.product_category.actual-data-nodes=ds$->{0}.product_category
   
   spring.shardingsphere.props.sql.show=true
   ```
   
   


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

To unsubscribe, e-mail: [email protected]

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


Reply via email to