vincentlbh commented on issue #18093:
URL:
https://github.com/apache/shardingsphere/issues/18093#issuecomment-1142058693
> Can you provide your configuration with text format?
spring:
shardingsphere:
datasource:
names: orderdemo0,orderdemo1
orderdemo0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url:
jdbc:mysql://10.126.124.51:3306/order_demo0?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
username: root
password: root
hikari:
auto-commit: true
connection-test-query: SELECT 1
connection-timeout: 9000
idle-timeout: 600000
max-lifetime: 1800000
maximum-pool-size: 15
minimum-idle: 10
pool-name: ${spring.application.name}1
orderdemo1:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url:
jdbc:mysql://10.126.124.51:3306/order_demo1?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
username: root
password: root
hikari:
auto-commit: true
connection-test-query: SELECT 1
connection-timeout: 9000
idle-timeout: 600000
max-lifetime: 1800000
maximum-pool-size: 15
minimum-idle: 10
pool-name: ${spring.application.name}2
rules:
sharding:
tables:
order_info:
actual-data-nodes: orderdemo$->{0..1}.order_info$->{0..1}
database-strategy:
standard:
sharding-column: order_id
sharding-algorithm-name: db-algorithm
table-strategy:
standard:
sharding-column: user_id
sharding-algorithm-name: tb-algorithm
sharding-algorithms:
db-algorithm:
type: INLINE
props:
algorithm-expression: orderdemo$->{order_id % 2}
tb-algorithm:
# type: INLINE
# props:
# algorithm-expression: order_info$->{user_id % 2}
type: CLASS_BASED
props:
strategy: standard
algorithmClassName:
com.tcl.sharding.order.infrastructure.algorithm.OrderAlgorithm
--
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]