You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/02/19 08:01:20 UTC
[GitHub] guowdxp commented on issue #1829: sharding-sphere is
4.0.0.M1-SNAPSHOT cann't configure multiple config-sharding files.
guowdxp commented on issue #1829: sharding-sphere is 4.0.0.M1-SNAPSHOT cann't configure multiple config-sharding files.
URL: https://github.com/apache/incubator-shardingsphere/issues/1829#issuecomment-465026438
first yaml config file :
schemaName: smp_gr_bcp_dev
dataSources:
ds_smp_gr_bcp_dev_0:
url: jdbc:mysql://url:3306/database_00?useSSL=false
username: username
password: password
maxPoolSize: 5
minPoolSize: 2
ds_smp_gr_bcp_dev_1:
url: jdbc:mysql://url:3306/database_01?useSSL=false
username: username
password: password
maxPoolSize: 5
minPoolSize: 2
shardingRule:
tables:
bcp_router:
actualDataNodes: ds_smp_gr_bcp_dev_0.bcp_router_000${0..1},ds_smp_gr_bcp_dev_1.bcp_router_000${2..3}
databaseStrategy:
inline:
shardingColumn: src_id
algorithmExpression: ds_smp_gr_bcp_dev_${(src_id.hashCode().abs() % 4).intdiv(2)}
tableStrategy:
inline:
shardingColumn: src_id
algorithmExpression: bcp_router_${"000" + (src_id.hashCode().abs() % 4)}
defaultDataSourceName: ds_smp_gr_bcp_dev_0
defaultDatabaseStrategy:
none:
defaultTableStrategy:
none:
second yaml config file :
schemaName: smp_gr_customer_dev
dataSources:
ds_smp_gr_customer_dev_0:
url: jdbc:mysql://url:3306/database_00?useSSL=false
username: username
password: password
maxPoolSize: 5
minPoolSize: 2
ds_smp_gr_customer_dev_1:
url: jdbc:mysql://url:3306/database_01?useSSL=false
username: username
password: password
maxPoolSize: 5
minPoolSize: 2
shardingRule:
tables:
trans_router:
actualDataNodes: ds_smp_gr_customer_dev_0.trans_router_000${0..1},ds_smp_gr_customer_dev_1.trans_router_000${2..3}
databaseStrategy:
inline:
shardingColumn: trans_no
algorithmExpression: ds_smp_gr_customer_dev_${(trans_no.hashCode().abs() % 4).intdiv(2)}
tableStrategy:
inline:
shardingColumn: trans_no
algorithmExpression: trans_router_${"000" + (trans_no.hashCode().abs() % 4)}
defaultDataSourceName: ds_smp_gr_customer_dev_0
defaultDatabaseStrategy:
none:
defaultTableStrategy:
none:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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