1- # ## \u914D\u7F6Enginx\u670D\u52A1\u7684binlog\u5730\u5740\uFF0C\u5982\u679C\u8FDE\u63A5\u591A\u4E2A\u8282\u70B9\u7684\u8BDD\uFF0C\u4F7F\u7528\u9017\u53F7\u5206\u9694
2- system.binlogAddress =http://127.0.0.1:5299/
3-
4- # ## 分库分表配置
5- # ### 打开开关
6- spring.shardingsphere.enabled =true
7- # ### 定义数据源
8- spring.shardingsphere.datasource.names = stash1,stash2,stash3
9- spring.shardingsphere.datasource.stash1.type =com.zaxxer.hikari.HikariDataSource
10- spring.shardingsphere.datasource.stash1.driver-class-name =com.mysql.cj.jdbc.Driver
11- spring.shardingsphere.datasource.stash1.jdbcUrl =jdbc:mysql://localhost:3306/stash1?autoReconnect=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8
12- spring.shardingsphere.datasource.stash1.username =root
13- spring.shardingsphere.datasource.stash1.password =123456
14-
15- spring.shardingsphere.datasource.stash2.type =com.zaxxer.hikari.HikariDataSource
16- spring.shardingsphere.datasource.stash2.driver-class-name =com.mysql.cj.jdbc.Driver
17- spring.shardingsphere.datasource.stash2.jdbcUrl =jdbc:mysql://localhost:3306/stash2?autoReconnect=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8
18- spring.shardingsphere.datasource.stash2.username =root
19- spring.shardingsphere.datasource.stash2.password =123456
20-
21- spring.shardingsphere.datasource.stash3.type =com.zaxxer.hikari.HikariDataSource
22- spring.shardingsphere.datasource.stash3.driver-class-name =com.mysql.cj.jdbc.Driver
23- spring.shardingsphere.datasource.stash3.jdbcUrl =jdbc:mysql://localhost:3306/stash3?autoReconnect=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8
24- spring.shardingsphere.datasource.stash3.username =root
25- spring.shardingsphere.datasource.stash3.password =123456
26-
27- # ### 不做分片的表,默认存储到stash1
28- spring.shardingsphere.sharding.default-data-source-name =stash1
29-
30- # ### 需分片的表,路由目标
31- spring.shardingsphere.sharding.tables._sys_hash_2_block_.actual‐data‐nodes = stash$->{1..3}._sys_hash_2_block_
32- spring.shardingsphere.sharding.tables._sys_hash_2_block_d_.actual‐data‐nodes = stash$->{1..3}._sys_hash_2_block_d_
33- spring.shardingsphere.sharding.tables._sys_tx_hash_2_block_.actual‐data‐nodes = stash$->{1..3}._sys_tx_hash_2_block_
34- spring.shardingsphere.sharding.tables._sys_tx_hash_2_block_d_.actual‐data‐nodes = stash$->{1..3}._sys_tx_hash_2_block_d_
35-
36- # ### 需分片的表,分片策略
37- spring.shardingsphere.sharding.default-database-strategy.standard.sharding-column = _num_
38- spring.shardingsphere.sharding.default-database-strategy.standard.precise-algorithm-class-name =com.webank.blockchain.data.stash.db.sharding.BlockShardingAlgorithm
39- spring.shardingsphere.sharding.default-database-strategy.standard.range-algorithm-class-name =com.webank.blockchain.data.stash.db.sharding.BlockShardingAlgorithm
40- # spring.shardingsphere.props.sql.show = false
41-
42-
43- # ## logback配置
44- logging.file =./logs/stash.log
45- logging.level.com.webank =INFO
1+ # ## 配置nginx服务的binlog地址,如果连接多个节点的话,使用逗号分隔
2+ system.binlogAddress =http://www.example.com:5299/,http://www.example.com:5300/
3+
4+ # ## 数据库连接配置
5+ # ### 禁用分库分表
6+ spring.shardingsphere.enabled =false
7+ spring.datasource.url =jdbc:mysql://127.0.0.1:3306/stash?autoReconnect=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8
8+ spring.datasource.username =root
9+ spring.datasource.password =123456
10+ spring.datasource.driverClassName =com.mysql.jdbc.Driver
0 commit comments