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/04/27 02:20:20 UTC

[GitHub] [shardingsphere] nongchangzhu commented on issue #5317: ShardingSphere FAQ(常见问题与解决办法,有问题先看这里)

nongchangzhu commented on issue #5317:
URL: https://github.com/apache/shardingsphere/issues/5317#issuecomment-619672321


   sharding.jdbc.config.masterslave.name=ms #读写分离数据源名称 
    这句话咋理解呢????
   
   //---------------------------------------------------------------------------------------------
   sharding.jdbc.datasource.names=master,slave0,slave1
   
   sharding.jdbc.datasource.master.type=org.apache.commons.dbcp.BasicDataSource
   sharding.jdbc.datasource.master.driver-class-name=com.mysql.jdbc.Driver
   sharding.jdbc.datasource.master.url=jdbc:mysql://localhost:3306/master
   sharding.jdbc.datasource.master.username=root
   sharding.jdbc.datasource.master.password=
   
   sharding.jdbc.datasource.slave0.type=org.apache.commons.dbcp.BasicDataSource
   sharding.jdbc.datasource.slave0.driver-class-name=com.mysql.jdbc.Driver
   sharding.jdbc.datasource.slave0.url=jdbc:mysql://localhost:3306/slave0
   sharding.jdbc.datasource.slave0.username=root
   sharding.jdbc.datasource.slave0.password=
   
   sharding.jdbc.datasource.slave1.type=org.apache.commons.dbcp.BasicDataSource
   sharding.jdbc.datasource.slave1.driver-class-name=com.mysql.jdbc.Driver
   sharding.jdbc.datasource.slave1.url=jdbc:mysql://localhost:3306/slave1
   sharding.jdbc.datasource.slave1.username=root
   sharding.jdbc.datasource.slave1.password=
   
   sharding.jdbc.config.masterslave.load-balance-algorithm-type=round_robin
   sharding.jdbc.config.masterslave.name=ms
   sharding.jdbc.config.masterslave.master-data-source-name=master
   sharding.jdbc.config.masterslave.slave-data-source-names=slave0,slave1
   
   sharding.jdbc.config.props.sql.show=true
   
   
   
   对于上面这样一个官方给的配置, sharding.jdbc.config.masterslave.name=ms   中的ms  是怎样来的,可以随意写吗????


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