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/07/22 12:16:08 UTC

[GitHub] [shardingsphere] forlich opened a new issue #6401: springboot-starter 官方配置实例错误了

forlich opened a new issue #6401:
URL: https://github.com/apache/shardingsphere/issues/6401


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   SpringbootShardingSphere 4.x
   ShardingSphere-JDBC 
   按照官方配置应该能够启动,但是实际按照官方配置不能启动
   https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/configuration/spring-boot-starter/sharding/
   spring.shardingsphere.datasource.names= # 省略数据源配置
   
   spring.shardingsphere.rules.sharding.tables.<table-name>.actual-data-nodes= # 由数据源名 + 表名组成,以小数点分隔。多个表以逗号分隔,支持inline表达式。缺省表示使用已知数据源与逻辑表名称生成数据节点,用于广播表(即每个库中都需要一个同样的表用于关联查询,多为字典表)或只分库不分表且所有库的表结构完全一致的情况
   
   # 分库策略,缺省表示使用默认分库策略,以下的分片策略只能选其一
   
   # 用于单分片键的标准分片场景
   spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.standard.<sharding-algorithm-name>.sharding-column= # 分片列名称
   spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.standard.<sharding-algorithm-name>.sharding-algorithm-name= # 分片算法名称
   
   # 用于多分片键的复合分片场景
   spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.complex.<sharding-algorithm-name>.sharding-columns= # 分片列名称,多个列以逗号分隔
   spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.complex.<sharding-algorithm-name>.sharding-algorithm-name= # 分片算法名称
   
   # 用于Hint 的分片策略
   spring.shardingsphere.rules.sharding.tables.<table-name>.database-strategy.hint.<sharding-algorithm-name>.sharding-algorithm-name= # 分片算法名称
   
   # 分表策略,同分库策略
   spring.shardingsphere.rules.sharding.tables.<table-name>.table-strategy.xxx= # 省略
   
   # 分布式序列策略配置
   spring.shardingsphere.rules.sharding.tables.<table-name>.key-generate-strategy.column= # 分布式序列列名称
   spring.shardingsphere.rules.sharding.tables.<table-name>.key-generate-strategy.key-generator-name= # 分布式序列算法名称
   
   spring.shardingsphere.rules.sharding.binding-tables[0]= # 绑定表规则列表
   spring.shardingsphere.rules.sharding.binding-tables[1]= # 绑定表规则列表
   spring.shardingsphere.rules.sharding.binding-tables[x]= # 绑定表规则列表
   
   spring.shardingsphere.rules.sharding.broadcast-tables[0]= # 广播表规则列表
   spring.shardingsphere.rules.sharding.broadcast-tables[1]= # 广播表规则列表
   spring.shardingsphere.rules.sharding.broadcast-tables[x]= # 广播表规则列表
   
   spring.shardingsphere.sharding.default-database-strategy.xxx= # 默认数据库分片策略
   spring.shardingsphere.sharding.default-table-strategy.xxx= # 默认表分片策略
   spring.shardingsphere.sharding.default-key-generate-strategy.xxx= # 默认分布式序列策略
   
   # 分片算法配置
   spring.shardingsphere.rules.sharding.sharding-algorithms.<sharding-algorithm-name>.type= # 分片算法类型
   spring.shardingsphere.rules.sharding.sharding-algorithms.<sharding-algorithm-name>.props.xxx=# 分片算法属性配置
   
   # 分布式序列算法配置
   spring.shardingsphere.rules.sharding.key-generators.<key-generate-algorithm-name>.type= # 分布式序列算法类型
   spring.shardingsphere.rules.sharding.key-generators.<key-generate-algorithm-name>.props.xxx= # 分布式序列算法属性配置
   
   
   实际starter里面配置的前缀为
   @ConfigurationProperties(
       prefix = "spring.shardingsphere.sharding"
   )
   public class SpringBootShardingRuleConfigurationProperties extends YamlShardingRuleConfiguration {
       public SpringBootShardingRuleConfigurationProperties() {
       }
   }
   
   这里明显不一致,而且关于springboot-starter的配置指导写很模糊。麻烦重新整理下指导文档
   另外关于io.shardingsphere和org.apahce.shardingsphere的区别,官网希望也能写清楚区别
   还有就是springboot和springboot-starter配置的差异,尽量都写明白一些,现在参考官网文档让人看的一头雾水


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



[GitHub] [shardingsphere] terrymanu closed issue #6401: springboot-starter 官方配置实例错误了

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #6401:
URL: https://github.com/apache/shardingsphere/issues/6401


   


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



[GitHub] [shardingsphere] kimmking commented on issue #6401: springboot-starter 官方配置实例错误了

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #6401:
URL: https://github.com/apache/shardingsphere/issues/6401#issuecomment-662435879


   english only.
   


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



[GitHub] [shardingsphere] yu199195 commented on issue #6401: springboot-starter 官方配置实例错误了

Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #6401:
URL: https://github.com/apache/shardingsphere/issues/6401#issuecomment-662438286


   > https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/configuration/spring-boot-starter/sharding/
   
   this is 5.X, not 4.x 
   
   you can follow this : https://shardingsphere.apache.org/document/legacy/4.x/document/en/overview/


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