apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.99k stars 6.75k forks source link

Storage units `[ds_0]` do not exist in database `database_name`. #29323

Open wnose opened 11 months ago

wnose commented 11 months ago
IMPORT DATABASE CONFIGURATION FROM FILE "/opt/shardingsphere-proxy/conf/config-xxx.yaml"; 

I have same error. [44000][19001] Storage units [ds_0] do not exist in database database_name.

version 5.7.21-log-ShardingSphere-Proxy 5.4.1. docker image apache/shardingsphere-proxy

databaseName: database_name

dataSources:
 ds_0:
   url: jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=convertToNull      
   username: root
   password: 123456
   connectionTimeoutMilliseconds: 30000
   idleTimeoutMilliseconds: 60000
   maxLifetimeMilliseconds: 1800000
   maxPoolSize: 50
   minPoolSize: 1

rules:
- !SINGLE
  tables:
    - ds_0.*
  defaultDataSource: ds_0
- !SHARDING
 tables:
   lingxing_amz_order_list:
     actualDataNodes: ds_0.lingxing_amz_order_list_${0..2}
     tableStrategy:
       standard:
         shardingColumn: amazon_order_id
         shardingAlgorithmName: order_hash_mod
     keyGenerateStrategy:
        column: id
        keyGeneratorName: snowflake
     auditStrategy:
       auditorNames:
         - sharding_key_required_auditor
       allowHintDisable: true
   lingxing_amz_order_list_item:
     actualDataNodes: ds_0.lingxing_amz_order_list_item_${0..2}
     tableStrategy:
       standard:
         shardingColumn: amazon_order_id
         shardingAlgorithmName: order_hash_mod
     keyGenerateStrategy:
        column: id
        keyGeneratorName: snowflake
     auditStrategy:
       auditorNames:
         - sharding_key_required_auditor
       allowHintDisable: true
   lingxing_amz_order_detail_item:
     actualDataNodes: ds_0.lingxing_amz_order_detail_item_${0..2}
     tableStrategy:
       standard:
         shardingColumn: amazon_order_id
         shardingAlgorithmName: order_hash_mod
     keyGenerateStrategy:
        column: id
        keyGeneratorName: snowflake
     auditStrategy:
       auditorNames:
         - sharding_key_required_auditor
       allowHintDisable: true
 bindingTables:
   - lingxing_amz_order_list,lingxing_amz_order_list_item,lingxing_amz_order_detail_item
 shardingAlgorithms:
   order_hash_mod:
     type: HASH_MOD
     props:
       sharding-count: 128
 keyGenerators:
   snowflake:
     type: SNOWFLAKE
 auditors:
   sharding_key_required_auditor:
     type: DML_SHARDING_CONDITIONS

Originally posted by @wnose in https://github.com/apache/shardingsphere/issues/23576#issuecomment-1845196767

Pace2Car commented 11 months ago

link to #29574

Pace2Car commented 10 months ago

Thanks for your feedback, this is an occasional problem of metadata refresh and will be dealt with centrally.