spring:
|
config:
|
activate:
|
on-profile: local
|
autoconfigure:
|
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
token:
|
secret: iymGhx1XkAAHrex2Zf4ASbiD9P2ksTam
|
|
# 以下为本地数据库/中间件配置,后续迁移至 Nacos
|
shardingsphere:
|
mode:
|
type: Standalone
|
repository:
|
type: File
|
overwrite: true
|
datasource:
|
names: xp0
|
xp0:
|
type: com.alibaba.druid.pool.DruidDataSource
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
url: jdbc:mysql://192.168.110.34:3306/xprt_order?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
username: root
|
password: 123456
|
druid:
|
initial-size: 10
|
min-idle: 10
|
max-active: 100
|
max-wait: 60000
|
time-between-eviction-runs-millis: 60000
|
min-evictable-idle-time-millis: 300000
|
validation-query: SELECT 1
|
test-while-idle: true
|
test-on-borrow: false
|
test-on-return: false
|
pool-prepared-statements: true
|
max-pool-prepared-statement-per-connection-size: 20
|
filters: stat,wall,log4j
|
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
remove-abandoned: true
|
remove-abandoned-timeout: 1800
|
log-abandoned: true
|
stat-view-servlet:
|
enabled: true
|
url-pattern: /druid/*
|
login-username: admin
|
login-password: admin
|
reset-enable: false
|
wall:
|
config:
|
multi-statement-allow: false
|
rules:
|
sharding:
|
tables:
|
xp_order:
|
actual-data-nodes: xp0.xp_order_$->{0..19}
|
table-strategy:
|
standard:
|
sharding-column: app_user_id
|
sharding-algorithm-name: xp_order_inline
|
key-generate-strategy:
|
column: id
|
key-generator-name: snowflake
|
xp_order_cancel:
|
actual-data-nodes: xp0.xp_order_cancel_$->{0..19}
|
table-strategy:
|
standard:
|
sharding-column: order_id
|
sharding-algorithm-name: xp_order_cancel_inline
|
key-generate-strategy:
|
column: id
|
key-generator-name: snowflake
|
xp_order_evaluate:
|
actual-data-nodes: xp0.xp_order_evaluate_$->{0..19}
|
table-strategy:
|
standard:
|
sharding-column: order_id
|
sharding-algorithm-name: xp_order_evaluate_inline
|
key-generate-strategy:
|
column: id
|
key-generator-name: snowflake
|
xp_order_payment:
|
actual-data-nodes: xp0.xp_order_payment_$->{0..19}
|
table-strategy:
|
standard:
|
sharding-column: order_id
|
sharding-algorithm-name: xp_order_payment_inline
|
key-generate-strategy:
|
column: id
|
key-generator-name: snowflake
|
xp_order_reassign:
|
actual-data-nodes: xp0.xp_order_reassign_$->{0..9}
|
table-strategy:
|
standard:
|
sharding-column: order_id
|
sharding-algorithm-name: xp_order_reassign_inline
|
key-generate-strategy:
|
column: id
|
key-generator-name: snowflake
|
sharding-algorithms:
|
xp_order_inline:
|
type: INLINE
|
props:
|
algorithm-expression: xp_order_$->{app_user_id % 20}
|
xp_order_cancel_inline:
|
type: INLINE
|
props:
|
algorithm-expression: xp_order_cancel_$->{order_id % 20}
|
xp_order_evaluate_inline:
|
type: INLINE
|
props:
|
algorithm-expression: xp_order_evaluate_$->{order_id % 20}
|
xp_order_payment_inline:
|
type: INLINE
|
props:
|
algorithm-expression: xp_order_payment_$->{order_id % 20}
|
xp_order_reassign_inline:
|
type: INLINE
|
props:
|
algorithm-expression: xp_order_reassign_$->{order_id % 10}
|
key-generators:
|
snowflake:
|
type: SNOWFLAKE
|
single-table:
|
default-data-source-name: xp0
|
props:
|
sql-show: true
|
sql-simple: true
|
|
seata:
|
enabled: false
|