Commit b315ccc34ad5667020d8bdb1be2fc84fd3cbe569
1 parent
aeae8fc9
增加分库分表集成例子的 nacos配置文件
Showing
2 changed files
with
92 additions
and
0 deletions
jeecg-boot/jeecg-cloud-module/jeecg-cloud-nacos/docs/config/分库分表/jeecg-sharding-multi.yaml
0 → 100644
1 | +spring: | |
2 | + shardingsphere: | |
3 | + datasource: | |
4 | + names: ds0,ds1 | |
5 | + ds0: | |
6 | + driverClassName: com.mysql.cj.jdbc.Driver | |
7 | + url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai | |
8 | + type: com.alibaba.druid.pool.DruidDataSource | |
9 | + username: root | |
10 | + password: root | |
11 | + ds1: | |
12 | + driverClassName: com.mysql.cj.jdbc.Driver | |
13 | + url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot2?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai | |
14 | + type: com.alibaba.druid.pool.DruidDataSource | |
15 | + username: root | |
16 | + password: root | |
17 | + props: | |
18 | + sql-show: true | |
19 | + rules: | |
20 | + replica-query: | |
21 | + load-balancers: | |
22 | + round-robin: | |
23 | + type: ROUND_ROBIN | |
24 | + props: | |
25 | + default: 0 | |
26 | + data-sources: | |
27 | + prds: | |
28 | + primary-data-source-name: ds0 | |
29 | + replica-data-source-names: ds1 | |
30 | + load-balancer-name: round_robin | |
31 | + sharding: | |
32 | + binding-tables: | |
33 | + - sys_log | |
34 | + key-generators: | |
35 | + snowflake: | |
36 | + type: SNOWFLAKE | |
37 | + props: | |
38 | + worker-id: 123 | |
39 | + sharding-algorithms: | |
40 | + table-classbased: | |
41 | + props: | |
42 | + strategy: standard | |
43 | + algorithmClassName: org.jeecg.modules.test.sharding.algorithm.StandardModTableShardAlgorithm | |
44 | + type: CLASS_BASED | |
45 | + database-inline: | |
46 | + type: INLINE | |
47 | + props: | |
48 | + algorithm-expression: ds$->{operate_type % 2} | |
49 | + tables: | |
50 | + sys_log: | |
51 | + actual-data-nodes: ds$->{0..1}.sys_log$->{0..1} | |
52 | + database-strategy: | |
53 | + standard: | |
54 | + sharding-column: operate_type | |
55 | + sharding-algorithm-name: database-inline | |
56 | + table-strategy: | |
57 | + standard: | |
58 | + sharding-algorithm-name: table-classbased | |
59 | + sharding-column: log_type | |
0 | 60 | \ No newline at end of file |
... | ... |
jeecg-boot/jeecg-cloud-module/jeecg-cloud-nacos/docs/config/分库分表/jeecg-sharding.yaml
0 → 100644
1 | +spring: | |
2 | + shardingsphere: | |
3 | + datasource: | |
4 | + names: ds0 | |
5 | + ds0: | |
6 | + driverClassName: com.mysql.cj.jdbc.Driver | |
7 | + url: jdbc:mysql://jeecg-boot-mysql:3306/jeecg-boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai | |
8 | + username: root | |
9 | + password: root | |
10 | + type: com.alibaba.druid.pool.DruidDataSource | |
11 | + props: | |
12 | + sql-show: true | |
13 | + rules: | |
14 | + sharding: | |
15 | + binding-tables: sys_log | |
16 | + key-generators: | |
17 | + snowflake: | |
18 | + type: SNOWFLAKE | |
19 | + props: | |
20 | + worker-id: 123 | |
21 | + sharding-algorithms: | |
22 | + table-classbased: | |
23 | + props: | |
24 | + strategy: standard | |
25 | + algorithmClassName: org.jeecg.modules.test.sharding.algorithm.StandardModTableShardAlgorithm | |
26 | + type: CLASS_BASED | |
27 | + tables: | |
28 | + sys_log: | |
29 | + actual-data-nodes: ds0.sys_log$->{0..1} | |
30 | + table-strategy: | |
31 | + standard: | |
32 | + sharding-algorithm-name: table-classbased | |
33 | + sharding-column: log_type | |
0 | 34 | \ No newline at end of file |
... | ... |