Green524 commented on issue #16806:
URL:
https://github.com/apache/shardingsphere/issues/16806#issuecomment-1189929026
>
datasource.initialSize=5
datasource.minIdle=5
datasource.maxActive=20
datasource.maxWait=60000
datasource.timeBetweenEvictionRunsMillis=60000
datasource.minEvictableIdleTimeMillis=300000
datasource.validationQuery=select current_timestamp()
datasource.testWhileIdle=true
datasource.testOnBorrow=true
datasource.testOnReturn=false
datasource.poolPreparedStatements=true
datasource.maxPoolPreparedStatementPerConnectionSize=20
spring.shardingsphere.datasource.ds-0.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-0.url=jdbc:mysql://${mysql.db.ds0}/db_transaction_n0?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
spring.shardingsphere.datasource.ds-0.username=root
spring.shardingsphere.datasource.ds-0.password=${MYSQL_PASSWORD:sql_mYpwd@123}
spring.shardingsphere.datasource.ds-0.initialSize=${datasource.initialSize}
spring.shardingsphere.datasource.ds-0.minIdle=${datasource.minIdle}
spring.shardingsphere.datasource.ds-0.maxActive=${datasource.maxActive}
spring.shardingsphere.datasource.ds-0.maxWait=${datasource.maxWait}
spring.shardingsphere.datasource.ds-0.timeBetweenEvictionRunsMillis=${datasource.timeBetweenEvictionRunsMillis}
spring.shardingsphere.datasource.ds-0.minEvictableIdleTimeMillis=${datasource.minEvictableIdleTimeMillis}
spring.shardingsphere.datasource.ds-0.validationQuery=${datasource.validationQuery}
spring.shardingsphere.datasource.ds-0.testWhileIdle=${datasource.testWhileIdle}
spring.shardingsphere.datasource.ds-0.testOnBorrow=${datasource.testOnBorrow}
spring.shardingsphere.datasource.ds-0.testOnReturn=${datasource.testOnReturn}
spring.shardingsphere.datasource.ds-0.poolPreparedStatements=${datasource.poolPreparedStatements}
spring.shardingsphere.datasource.ds-0.maxPoolPreparedStatementPerConnectionSize=${datasource.maxPoolPreparedStatementPerConnectionSize}
spring.shardingsphere.datasource.ds-1.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-1.url=jdbc:mysql://${mysql.db.ds1}/db_transaction_n1?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
spring.shardingsphere.datasource.ds-1.username=root
spring.shardingsphere.datasource.ds-1.password=${MYSQL_PASSWORD:sql_mYpwd@123}
spring.shardingsphere.datasource.ds-1.initialSize=${datasource.initialSize}
spring.shardingsphere.datasource.ds-1.minIdle=${datasource.minIdle}
spring.shardingsphere.datasource.ds-1.maxActive=${datasource.maxActive}
spring.shardingsphere.datasource.ds-1.maxWait=${datasource.maxWait}
spring.shardingsphere.datasource.ds-1.timeBetweenEvictionRunsMillis=${datasource.timeBetweenEvictionRunsMillis}
spring.shardingsphere.datasource.ds-1.minEvictableIdleTimeMillis=${datasource.minEvictableIdleTimeMillis}
spring.shardingsphere.datasource.ds-1.validationQuery=${datasource.validationQuery}
spring.shardingsphere.datasource.ds-1.testWhileIdle=${datasource.testWhileIdle}
spring.shardingsphere.datasource.ds-1.testOnBorrow=${datasource.testOnBorrow}
spring.shardingsphere.datasource.ds-1.testOnReturn=${datasource.testOnReturn}
spring.shardingsphere.datasource.ds-1.poolPreparedStatements=${datasource.poolPreparedStatements}
spring.shardingsphere.datasource.ds-1.maxPoolPreparedStatementPerConnectionSize=${datasource.maxPoolPreparedStatementPerConnectionSize}
spring.shardingsphere.datasource.ds-2.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.ds-2.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-2.url=jdbc:mysql://${mysql.db.ds2}/db_transaction_n2?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
spring.shardingsphere.datasource.ds-2.username=root
spring.shardingsphere.datasource.ds-2.password=${MYSQL_PASSWORD:sql_mYpwd@123}
spring.shardingsphere.datasource.ds-2.initialSize=${datasource.initialSize}
spring.shardingsphere.datasource.ds-2.minIdle=${datasource.minIdle}
spring.shardingsphere.datasource.ds-2.maxActive=${datasource.maxActive}
spring.shardingsphere.datasource.ds-2.maxWait=${datasource.maxWait}
spring.shardingsphere.datasource.ds-2.timeBetweenEvictionRunsMillis=${datasource.timeBetweenEvictionRunsMillis}
spring.shardingsphere.datasource.ds-2.minEvictableIdleTimeMillis=${datasource.minEvictableIdleTimeMillis}
spring.shardingsphere.datasource.ds-2.validationQuery=${datasource.validationQuery}
spring.shardingsphere.datasource.ds-2.testWhileIdle=${datasource.testWhileIdle}
spring.shardingsphere.datasource.ds-2.testOnBorrow=${datasource.testOnBorrow}
spring.shardingsphere.datasource.ds-2.testOnReturn=${datasource.testOnReturn}
spring.shardingsphere.datasource.ds-2.poolPreparedStatements=${datasource.poolPreparedStatements}
spring.shardingsphere.datasource.ds-2.maxPoolPreparedStatementPerConnectionSize=${datasource.maxPoolPreparedStatementPerConnectionSize}
#默认的数据库分片列(数据表列) 以及 自定义的分片算法名称(在文件指定)
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=account_id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=account-sharding
#绑定表的实际节点命名规则为(由数据源名 + 表名组成,以小数点分隔。多个表以逗号分隔,支持inline表达式。)
spring.shardingsphere.rules.sharding.tables.tb_transaction_detail.actual-data-nodes=ds-$->{0..2}.tb_transaction_detail
spring.shardingsphere.rules.sharding.tables.tb_sub_transaction_detail.actual-data-nodes=ds-$->{0..2}.tb_sub_transaction_detail
spring.shardingsphere.rules.sharding.tables.tb_pay_method.actual-data-nodes=ds-$->{0..2}.tb_pay_method
spring.shardingsphere.rules.sharding.tables.tb_pay_order.actual-data-nodes=ds-$->{0..2}.tb_pay_order
spring.shardingsphere.rules.sharding.tables.tb_business_process.actual-data-nodes=ds-$->{0..2}.tb_business_process
#商品服务实际数据节点
spring.shardingsphere.rules.sharding.tables.tb_assemble_split_item.actual-data-nodes=ds-$->{0..2}.tb_assemble_split_item
spring.shardingsphere.rules.sharding.tables.tb_assemble_split_rule.actual-data-nodes=ds-$->{0..2}.tb_assemble_split_rule
spring.shardingsphere.rules.sharding.tables.tb_break_reason.actual-data-nodes=ds-$->{0..2}.tb_break_reason
spring.shardingsphere.rules.sharding.tables.tb_commodity_break.actual-data-nodes=ds-$->{0..2}.tb_commodity_break
spring.shardingsphere.rules.sharding.tables.tb_commodity_break_item.actual-data-nodes=ds-$->{0..2}.tb_commodity_break_item
spring.shardingsphere.rules.sharding.tables.tb_commodity_cat.actual-data-nodes=ds-$->{0..2}.tb_commodity_cat
spring.shardingsphere.rules.sharding.tables.tb_commodity_check.actual-data-nodes=ds-$->{0..2}.tb_commodity_check
spring.shardingsphere.rules.sharding.tables.tb_commodity_check_item.actual-data-nodes=ds-$->{0..2}.tb_commodity_check_item
spring.shardingsphere.rules.sharding.tables.tb_commodity_info.actual-data-nodes=ds-$->{0..2}.tb_commodity_info
spring.shardingsphere.rules.sharding.tables.tb_stock_change.actual-data-nodes=ds-$->{0..2}.tb_stock_change
spring.shardingsphere.rules.sharding.tables.tb_stock_flow.actual-data-nodes=ds-$->{0..2}.tb_stock_flow
spring.shardingsphere.rules.sharding.tables.tb_stock_flow_item.actual-data-nodes=ds-$->{0..2}.tb_stock_flow_item
spring.shardingsphere.rules.sharding.tables.tb_supplier.actual-data-nodes=ds-$->{0..2}.tb_supplier
spring.shardingsphere.rules.sharding.tables.tb_custom_field.actual-data-nodes=ds-$->{0..2}.tb_custom_field
#指定的分片算法,自定义算法命名不能有下划线_
spring.shardingsphere.rules.sharding.sharding-algorithms.account-sharding.type=CLASS_BASED
spring.shardingsphere.rules.sharding.sharding-algorithms.account-sharding.props.strategy=STANDARD
spring.shardingsphere.rules.sharding.sharding-algorithms.account-sharding.props.algorithmClassName=com.liwen.pay.trans.sharding.StandardDBShardingStrategy
spring.shardingsphere.rules.sharding.binding-tables=tb_transaction_detail,tb_sub_transaction_detail
#打印日志
spring.shardingsphere.props.sql-show=true
#是否开启联邦查询
spring.shardingsphere.props.sql-federation-enabled=true
--
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]