breezeLoganGithub commented on issue #15979:
URL:
https://github.com/apache/shardingsphere/issues/15979#issuecomment-1064185610
````
server:
port: 8080
spring:
shardingsphere:
datasource:
names: db0,db1
db0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url:
jdbc:mysql://192.168.18.128:3307/shardingsphere?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: 123456
db1:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url:
jdbc:mysql://192.168.18.128:3308/shardingsphere?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: 123456
rules:
replica-query:
data-sources:
shardingsphere:
primary-data-source-name: db0
replica-data-source-names: db1
load-balancer-name: msdb
load-balancers:
round-robin:
type: ROUND_ROBIN
props:
default: 0
sharding:
tables:
t_order:
actual-data-nodes: msdb.t_order$->{def lst=[];for (int
i=0;i<100;i++){if(i==0){lst.add('')}else{lst.add('_'+i)}};lst}
table-strategy:
standard:
sharding-column: sharding_id
sharding-algorithm-name: table-inline
sharding-algorithms:
table-inline:
type: INLINE
props:
algorithm-expression:
t_order$->{if(sharding_id==0){''}else{'_'+sharding_id}}
key-generators:
snowflake:
type: SNOWFLAKE
props:
worker-id: 123
props:
sql-show: true
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]