You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/23 10:50:01 UTC
[GitHub] [shardingsphere] MrXionGe edited a comment on issue #8306: IT DOES NOT WORK WITH SPRING-BOOT 2.3.X ?
MrXionGe edited a comment on issue #8306:
URL: https://github.com/apache/shardingsphere/issues/8306#issuecomment-732081270
@terrymanu
## Config File
##### application.properties
```
spring.profiles.active=replica-query
```
##### application-replica-query.properties
```
spring.shardingsphere.datasource.names=primary_ds,replica_ds_0,replica_ds_1
spring.shardingsphere.datasource.primary_ds.jdbc-url=jdbc:mysql://127.0.0.1:3306/db_master?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.primary_ds.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.primary_ds.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.primary_ds.username=web_app
spring.shardingsphere.datasource.primary_ds.password=123456
spring.shardingsphere.datasource.replica_ds_0.jdbc-url=jdbc:mysql://127.0.0.1:3306/db_read_0?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.replica_ds_0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.replica_ds_0.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.replica_ds_0.username=web_app
spring.shardingsphere.datasource.replica_ds_0.password=123456
spring.shardingsphere.datasource.replica_ds_1.jdbc-url=jdbc:mysql://127.0.0.1:3306/db_read_1?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.replica_ds_1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.replica_ds_1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.replica_ds_1.username=web_app
spring.shardingsphere.datasource.replica_ds_1.password=123456
spring.shardingsphere.rules.replica-query.load-balancers.round-robin.type=ROUND_ROBIN
spring.shardingsphere.rules.replica-query.data-sources.pr_ds.primary-data-source-name=primary_ds
spring.shardingsphere.rules.replica-query.data-sources.pr_ds.replica-data-source-names=replica_ds_0,replica_ds_1
spring.shardingsphere.rules.replica-query.data-sources.pr_ds.load-balancer-name=round-robin
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org