XZX369 opened a new issue, #22884:
URL: https://github.com/apache/shardingsphere/issues/22884
```
chemaName: iot_plat_db
dataSources:
write_ds:
url:
jdbc:mysql://192.168.1.100:3306/testt?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
read_ds_0:
url: jdbc:mysql://192.168.1.101:3306/test?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
#读写分离
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
staticStrategy:
writeDataSourceName: write_ds
readDataSourceNames:
- read_ds_0
loadBalancerName: random
loadBalancers:
random:
type: RANDOM
#水平分片
- !SHARDING
tables:
test_log:
actualDataNodes: readwrite_ds.test_log_$->{202206..202406}
tableStrategy:
standard:
shardingColumn: CREATE_TIME
shardingAlgorithmName: test_interval
task:
actualDataNodes: readwrite_ds.task_$->{2022-06..2024-06}
tableStrategy:
standard:
shardingColumn: CREATE_TIME
shardingAlgorithmName: task_interval
#分片算法
shardingAlgorithms:
test_interval:
type: COSID_INTERVAL_SNOWFLAKE
props:
zone-id: "Asia/Shanghai"
logic-name-prefix: "test"
datetime-pattern: "yyyy-MM-dd HH:mm:ss" # 分片字段格式
datetime-lower: "2022-06-01 00:00:00" # 范围下限
datetime-upper: "2024-06-30 23:59:59" # 范围上限
sharding-suffix-pattern: "yyyy-MM" # 分片名后缀,可以是MM,yyyyMMdd等。
datetime-interval-amount: 6 # 分片间隔,这里指一个月
datetime-interval-unit: "MONTHS" # 分片间隔单位
task_interval:
type: INTERVAL
props:
datetime-pattern: "yyyy-MM" # 分片字段格式
datetime-lower: "2022-06" # 范围下限
datetime-upper: "2024-06" # 范围上限
sharding-suffix-pattern: "yyyy-MM" # 分片名后缀,可以是MM,yyyyMMdd等。
datetime-interval-amount: 1 # 分片间隔,这里指一个月
datetime-interval-unit: "MONTHS" # 分片间隔单位
```
test_log 生成的分片表后缀为: 202206,202207,,,202299,,,202399,,,202406
task 生成的分片表后缀为:2016,2017,2018
--
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]