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 2022/12/05 08:34:51 UTC

[GitHub] [shardingsphere] joychen1579 opened a new issue, #22665: 请看配制与错误

joychen1579 opened a new issue, #22665:
URL: https://github.com/apache/shardingsphere/issues/22665

   ## Bug Report
   readwrite and sharding report errors together,I don't know which data source name to use。
   Please see the configuration and errors:
   
   config-meixiorder.yam:
   ```
   schemaName: meixiorder_db
   
   dataSources:
     primary_order:
       url: jdbc:mysql://192.168.31.156:3306/joy_sharding_order?serverTimezone=UTC&useSSL=false
       username: root
       password: meixi123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     replica_order_0:
       url: jdbc:mysql://192.168.31.151:3306/joy_sharding_order?serverTimezone=UTC&useSSL=false
       username: root
       password: meixi123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !READWRITE_SPLITTING
     dataSources:
       readwrite_order:
         type: Static
         props:
           write-data-source-name: primary_order
           read-data-source-names: replica_order_0
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: readwrite_order.t_order{0..3}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_order_item:
         actualDataNodes: readwrite_order.t_order_item{0..7}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_item_inline
         keyGenerateStrategy:
           column: o_id
           keyGeneratorName: snowflake
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_depository_address
    # defaultDatabaseStrategy:
          
     defaultTableStrategy:
       none:
   
     shardingAlgorithms:
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order${order_id % 4}
       t_order_item_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item${user_id % 8}
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
   
   ```
   
    report error:
   ```
   Exception in thread "main" org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException: Invalid format for actual data nodes: 'readwrite_order.t_order{0..3}'
           at org.apache.shardingsphere.infra.datanode.DataNode.<init>(DataNode.java:51)
           at org.apache.shardingsphere.sharding.rule.ShardingRule.lambda$getDataSourceNames$5(ShardingRule.java:174)
           at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
           at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
           at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
           at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
           at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
           at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
           at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
           at org.apache.shardingsphere.sharding.rule.ShardingRule.getDataSourceNames(ShardingRule.java:174)
           at org.apache.shardingsphere.sharding.rule.ShardingRule.lambda$getDataSourceNames$3(ShardingRule.java:162)
           at java.lang.Iterable.forEach(Iterable.java:75)
           at org.apache.shardingsphere.sharding.rule.ShardingRule.getDataSourceNames(ShardingRule.java:162)
           at org.apache.shardingsphere.sharding.rule.ShardingRule.<init>(ShardingRule.java:112)
           at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:41)
           at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:35)
           at org.apache.shardingsphere.infra.rule.builder.schema.SchemaRulesBuilder.buildRules(SchemaRulesBuilder.java:63)
           at org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder.getSchemaRules(MetaDataContextsBuilder.java:105)
           at org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder.addSchema(MetaDataContextsBuilder.java:83)
           at org.apache.shardingsphere.mode.manager.memory.MemoryContextManagerBuilder.build(MemoryContextManagerBuilder.java:55)
           at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:72)
           at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:57)
           at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:47)
   
   ```
   
   
   
   
   
   
   
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] joychen1579 commented on issue #22665: 请看配制与错误

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

   This question is my own fault.One symbol is missing.
   Look
   ```
         actualDataNodes: readwrite_order.t_order{0..3}
   ```
   It should be
   ```
   actualDataNodes: readwrite_order.t_order${0..3}
   ```
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN closed issue #22665: 请看配制与错误

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #22665: 请看配制与错误
URL: https://github.com/apache/shardingsphere/issues/22665


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org