# 数据源
|
dataSources:
|
sharding:
|
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
|
driverClassName: com.mysql.cj.jdbc.Driver
|
url: jdbc:mysql://192.168.2.29:7006/hazmat_manage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
username: root
|
password: 2farwL3yPXfbH2AP
|
maxTotal: 100
|
# ds_1:
|
# dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
|
# driverClassName: com.mysql.cj.jdbc.Driver
|
# url: jdbc:mysql://localhost:3306/ry-order2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# username: root
|
# password: root
|
# maxTotal: 100
|
rules:
|
- !SHARDING
|
tables:
|
hz_hazmat:
|
actualDataNodes: sharding.hz_hazmat_$->{0..19}
|
tableStrategy:
|
standard:
|
shardingColumn: company_id
|
shardingAlgorithmName: hz_hazmat_inline
|
hz_hazmat_flow:
|
actualDataNodes: sharding.hz_hazmat_flow_$->{0..19}
|
tableStrategy:
|
standard:
|
shardingColumn: company_id
|
shardingAlgorithmName: hz_hazmat_flow_inline
|
hz_product:
|
actualDataNodes: sharding.hz_product_$->{0..19}
|
tableStrategy:
|
standard:
|
shardingColumn: company_id
|
shardingAlgorithmName: hz_product_inline
|
hz_product_flow:
|
actualDataNodes: sharding.hz_product_flow_$->{0..19}
|
tableStrategy:
|
standard:
|
shardingColumn: company_id
|
shardingAlgorithmName: hz_product_flow_inline
|
shardingAlgorithms:
|
hz_hazmat_inline:
|
type: INLINE
|
props:
|
algorithm-expression: hz_hazmat_$->{company_id % 20}
|
hz_hazmat_flow_inline:
|
type: INLINE
|
props:
|
algorithm-expression: hz_hazmat_flow_$->{company_id % 20}
|
hz_product_inline:
|
type: INLINE
|
props:
|
algorithm-expression: hz_product_$->{company_id % 20}
|
hz_product_flow_inline:
|
type: INLINE
|
props:
|
algorithm-expression: hz_product_flow_$->{company_id % 20}
|
keyGenerators:
|
snowflake:
|
type: SNOWFLAKE
|
props:
|
sql-show: true # 是否打印sql
|