liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
spring:
  config:
    activate:
      on-profile: local
  autoconfigure:
    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
  token:
    secret: iymGhx1XkAAHrex2Zf4ASbiD9P2ksTam
 
  # 以下为本地数据库/中间件配置,后续迁移至 Nacos
  shardingsphere:
    datasource:
      names: xp0
      xp0:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: jdbc:mysql://pc-bp1o444934f546768po.rwlb.rds.aliyuncs.com:3306/xp_rt_account?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: xp_rt_account
        password: EqPf15_JIaotllpE
        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_app_user_coupon:
            actual-data-nodes: xp0.xp_app_user_coupon_${0..19}
            table-strategy:
              standard:
                sharding-column: app_user_id
                sharding-algorithm-name: xp-app-user-coupon-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_operations_user_notification:
            actual-data-nodes: xp0.xp_operations_user_notification_${0..19}
            table-strategy:
              standard:
                sharding-column: operations_user_id
                sharding-algorithm-name: xp-operations-user-notification-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
        sharding-algorithms:
          xp-app-user-coupon-inline:
            type: INLINE
            props:
              algorithm-expression: xp_app_user_coupon_${app_user_id % 20}
          xp-operations-user-notification-inline:
            type: INLINE
            props:
              algorithm-expression: xp_operations_user_notification_${operations_user_id % 20}
        key-generators:
          snowflake:
            type: SNOWFLAKE
      single-table:
        default-data-source-name: xp0
    props:
      sql-show: true
      sql-simple: true
 
seata:
  enabled: false