enoera00 opened a new issue #10127:
URL: https://github.com/apache/shardingsphere/issues/10127


   I use spring-boot 2.2.9.RELEASE , mybatis 2.1.3 and sharding-sphere 
5.0.0-alpha, below is my config file:
   **application.yml**
   ```
   server:
     port: 8080
   spring:
     profiles:
       active: rw
     application: sharding-sphere-demo
     shardingsphere:
       props:
         sql-show: true
         sql-simple: true
   mybatis:
     mapper-locations: classpath*:mapper/**/*.xml
     type-aliases-package: com.x.demo.sharding.sphere.model
     configuration:
       map-underscore-to-camel-case: true
       cache-enabled: true
   ```
   **application-rw.yml**
   ```
   spring:
     shardingsphere:
       datasource:
         names: master,slave,slavf
         common:
           type: com.zaxxer.hikari.HikariDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           username: root
           password: 123456
         master:
           jdbc-url: 
jdbc:mysql://localhost:3306/ssds?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&nullCatalogMeansCurrent=true
         slave:
           jdbc-url: 
jdbc:mysql://localhost:3307/ssds?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&nullCatalogMeansCurrent=true
         slavf:
           jdbc-url: 
jdbc:mysql://localhost:3308/ssds?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&nullCatalogMeansCurrent=true
       rules:
         read-write-splitting:
           load-balancers:
             round-robin:
               type: ROUND_ROBIN
           data-sources:
             ssds:
               write-data-source-name: master
               read-data-source-names: slave,slavf
               load-balancer-name: round-robin
   ```
   but when i run a query api, sql always execute in master db, i have checked 
my config many times, they are correct. I really don't know what went wrong, 
please help me, thanks.
   


-- 
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:
[email protected]


Reply via email to