skyjilygao opened a new issue, #18401:
URL: https://github.com/apache/shardingsphere/issues/18401

   English:
   Configure multiple data sources: DS1, ds1slave0, DS2, ds2slave0, DS3, DS4
   Only DS1 is configured with fragmentation rules, and DS1 and DS2 are 
configured with read / write separation; DS3 and DS4 are not configured.
   Question:
   dws_ shop_ The key table exists in DS3. Other DS do not have this table.
   But DWS is always read from DS2 during execution_ shop_ The key table 
indicates that there is no error in the table.
   Configuring multiple data sources reports an error: the table does not exist.
   
   中文:
   配置多数据源:ds1,ds1slave0,ds2,ds2slave0,ds3,ds4
   只有ds1配置分片规则,ds1,ds2配置了读写分离;ds3,ds4没有任何配置。
   
   问题:
   dws_shop_key表存在于ds3,其他ds都没有这张表。
   但执行时总是从ds2中读取dws_shop_key表,提示表不存在错误。
   
   配置多数据源报错:表不存在。
   
   application conmon file:
   spring:
     shardingsphere:
       props:
         sql-show: true
       datasource:
         names: ds1,ds1slave0,ds2,ds2slave0,ds3,ds4
         ds1:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
         ds1slave0:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
         ds2:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
         ds2slave0:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
         ds3:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
         ds4:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
       rules:
         sharding:
           sharding-algorithms:
             # 分片算法名称 不能使用下划线
             record-inline:
               type: CLASS_BASED
               props:
                 strategy: standard
                 algorithmClassName: 
com.sky.center.wb.sharding.CustomStandardShardingAlgorithm
           tables:
             bg_inside_month:
               actual-data-nodes: ds1.xxx忽略
               table-strategy:
                 standard:
                   sharding-column: b_date
                   sharding-algorithm-name: record-inline
             bg_inside_country_month:
               actual-data-nodes: ds1..xxx忽略
               table-strategy:
                 standard:
                   sharding-column: b_date
                   sharding-algorithm-name: record-inline
             bg_goods_country_month:
               actual-data-nodes: ds1.xxx忽略
               table-strategy:
                 standard:
                   sharding-column: b_date
                   sharding-algorithm-name: record-inline
             bg_goods_month:
               actual-data-nodes: ds1.xxx忽略
               table-strategy:
                 standard:
                   sharding-column: b_date
                   sharding-algorithm-name: record-inline
         readwrite-splitting:
           data-sources:
             ds1: # 逻辑数据源名字 不要乱写名字,否则读写分离不生效
               type: Static
               props:
                 write-data-source-name: ds1
                 # 从库
                 read-data-source-names: ds1slave0
                 # 负载均衡算法名称
                 load-balancer-name: round
             #            # 负载均衡算法
             ds2: # 逻辑数据源名字 不要乱写名字,否则读写分离不生效
               type: Static
               props:
                 write-data-source-name: ds2
                 # 从库
                 read-data-source-names: ds2slave0
                 # 负载均衡算法名称
                 load-balancer-name: round
           # 负载均衡算法
           load-balancers:
             round: # 负载均衡算法名称
               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.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to