Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure default data sources in version 5.* #31195

Open
robben009 opened this issue May 10, 2024 · 1 comment
Open

How to configure default data sources in version 5.* #31195

robben009 opened this issue May 10, 2024 · 1 comment

Comments

@robben009
Copy link

robben009 commented May 10, 2024

I have some tables that do not require splitting, how should I configure the default data source? As shown in the figure below, I hope that all tables except the tbreorder table do not need to be split. How should I configure it at this time?

dataSources:
  ds_0:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.mysql.jdbc.Driver
    jdbcUrl: jdbc:mysql://***
    username: ***
    password: ***
    hikari:
      minimum-idle: 200 
      maximum-pool-size: 200 
      idle-timeout: 600000 
      auto-commit: true 
      pool-name: playHikariPool 
      max-lifetime: 1800000 
      connection-timeout: 30000 
      connection-test-query: Select 1

rules:
  - !SHARDING
    tables:
      tb_order:
        actualDataNodes: ds_0.tb_order_${0..1}
        tableStrategy:
          standard:
            shardingColumn: customer_id
            shardingAlgorithmName: LastCharShardingAlgorithm
        keyGenerateStrategy:
          column: id
          keyGeneratorName: snowflake
    bindingTables:
      - tb_order
    shardingAlgorithms:
      LastCharShardingAlgorithm:
        type: CLASS_BASED
        props:
          strategy: STANDARD
          algorithmClassName: *
    keyGenerators:
      snowflake:
        type: SNOWFLAKE
@RaigorJiang
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants