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/03/19 04:32:00 UTC

[GitHub] [incubator-shardingsphere] fantacy2001 commented on issue #4832: insert...ON DUPLICATE KEY UPDATE error

fantacy2001 commented on issue #4832: insert...ON DUPLICATE KEY  UPDATE  error  
URL: https://github.com/apache/incubator-shardingsphere/issues/4832#issuecomment-600983114
 
 
   > @fantacy2001
   > Hi how about sharding rule configuration?
   only split db 
      <sharding:standard-strategy id="databaseStrategy" sharding-column="tenant_id" precise-algorithm-ref="commonDBShardingAlgorithm"/>
     <sharding:table-rule logic-table="stock_age" actual-data-nodes="ds_ms$->{0..1}.stock_age" database-strategy-ref="databaseStrategy"  />
     <sharding:master-slave-rules>
                   <sharding:master-slave-rule id="ds_ms0" master-data-source-name="ds_0" slave-data-source-names="ds_0_slave_0, ds_0_slave_1" strategy-ref="roundStrategy" />
                   <sharding:master-slave-rule id="ds_ms1" master-data-source-name="ds_1" slave-data-source-names="ds_1_slave_0, ds_1_slave_1" strategy-ref="roundStrategy" />
               </sharding:master-slave-rules>
   
   the commonDBShardingAlgorithm is mapping by tenant_id, like 
     map.put("tenant_id","the suffix of dbname")
     map.put("CP0000028","1");
     map.put("CP0000030","1");
    

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


With regards,
Apache Git Services