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 2021/06/22 15:19:01 UTC

[GitHub] [shardingsphere] kxw07 commented on issue #10127: read-write-splitting doesn't work

kxw07 commented on issue #10127:
URL: https://github.com/apache/shardingsphere/issues/10127#issuecomment-866076363


   Not work.
   And it always uses spring.shardingsphere.datasource.names the first value for query.
   
   My yaml file content:
   ```yaml
   spring:
     shardingsphere:
       props:
         sql-show: true
       datasource:
         common:
           driver-class-name: com.mysql.cj.jdbc.Driver
           type: com.zaxxer.hikari.HikariDataSource
         names: write, read1, read2
         write:
           jdbc-url: jdbc:mysql://localhost:3316/java_course
           username: root
           password:
         read1:
           jdbc-url: jdbc:mysql://localhost:3316/java_course
           username: root
           password:
         read2:
           jdbc-url: jdbc:mysql://localhost:3326/java_course
           username: root
           password:
       rules:
         readwrite-splitting:
           dataSources:
             group1:
               primary-data-source-name: write
               replica-data-source-names: read1, read2
               load-balancer-name: round_robin
             load-balancers:
               round_robin:
                 type: 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