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/06/15 13:46:45 UTC

[GitHub] [shardingsphere] jacksparrow414 commented on issue #5919: how to set broadcastTables with multi-datasources

jacksparrow414 commented on issue #5919:
URL: https://github.com/apache/shardingsphere/issues/5919#issuecomment-644145240


   you could config A as  defaultDataSource,and  config tb_config as the broadcast table for the other four databases.like this:
   ```yaml
   dataSources:
   names: ds0,ds1,ds2,ds3,de4,ds5
     ds0:
       driverClassName: com.mysql.jdbc.Driver
       url: jdbc:mysql://localhost:3306/A
       username: root
       password: 
     ds1: 
       driverClassName: com.mysql.jdbc.Driver
       url: jdbc:mysql://localhost:13306/B1
       username: root
       password: 
    ds2:
     url: jdbc:mysql://localhost:23306/B2
   ds3:
   url: jdbc:mysql://localhost:33306/B3
   ds4:
   url: jdbc:mysql://localhost:43306/B4
   sharding:  
         default-database-strategy:
           inline:
             sharding-column: id
             algorithm-expression: ds$->{id % 2}
         default-table-strategy:
           inline:
             sharding-column: age
             algorithm-expression: user_$->{age % 2}
         tables:
           user:
           # Configuration rules are not included database A
             actual-data-nodes: ds$->{1..5}.user_$->{1..5}
         default-data-source-name: ds0
         broadcast-tables: t_config
   ```


----------------------------------------------------------------
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