Closed 276234199 closed 5 years ago
server: port: 12601 spring: main: allow-bean-definition-overriding: true shardingsphere: props: sql: show: true sharding: tables: test_sharding: actual-data-nodes: ds$->{0..1}.test_sharding table-strategy: inline: sharding-column: id algorithm-expression: test_sharding default-database-strategy: inline: sharding-column: id algorithm-expression: master$->{id % 2} master-slave-rules: ds1: master-data-source-name: master1 slave-data-source-names: slave1 load-balance-algorithm-type: round_robin ds0: master-data-source-name: master0 slave-data-source-names: slave0 load-balance-algorithm-type: round_robin datasource: names: master1,slave1,master0,slave0 master1: name: master1 url: jdbc:mysql://localhost:30001/TestReadWrite?useSSL=false&serverTimezone=GMT%2B8 username: root password: 123456 # type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver master0: name: master0 url: jdbc:mysql://localhost:30003/TestReadWrite?useSSL=false&serverTimezone=GMT%2B8 username: root password: 123456 # type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver slave1: name: slave1 url: jdbc:mysql://localhost:30002/TestReadWrite?useSSL=false&serverTimezone=GMT%2B8 username: root password: 123456 # type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver slave0: name: slave0 url: jdbc:mysql://localhost:30004/TestReadWrite?useSSL=false&serverTimezone=GMT%2B8 username: root password: 123456 # type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver --------------------------------------------------------------------------------------------------- springboot+mybatisplus application.yml is shown above sharding is available but READ-WRITE SPLIT NOT WORKING always read master,never read slave version : 4.0.0-RC1
Please ref example first, all demos can run correctly. https://github.com/apache/incubator-shardingsphere-example/
Submit issue for common feature, please make sure examples are incorrect first.