zhangheng0027 opened a new issue, #28331:
URL: https://github.com/apache/shardingsphere/issues/28331
Rules can be run when using sharding,
But there was an error using SINGLE
```
spring:
datasource:
driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
url: jdbc:shardingsphere:classpath:sharding.yaml
```
sharding.yaml
```
dataSources:
master:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl:
jdbc:mysql://localhost:3406/oee?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=true
username:
password:
rules:
- !SINGLE
tables:
# MySQL 风格
- master.* # 加载指定数据源中的全部单表
defaultDataSource: master
```
```
dataSources:
master:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl:
jdbc:mysql://localhost:3406/oee?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=true
username:
password:
rules:
- !SHARDING
tables:
equipment_oee:
actualDataNodes: master.equipment_oee
tableStrategy:
complex:
shardingColumns: statistics_cycle,statistics_time,serial_no
shardingAlgorithmName: oeecyclealgorithmsharding
shardingAlgorithms:
oeecyclealgorithmsharding:
type: CLASS_BASED
props:
strategy: complex
algorithmClassName:
com.kstopa.dataServer.system.conf.sharding.OeeCycleAlgorithmSharding
```
--
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]