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

rules.tables,What about too many tables #24115

Closed
zhoubin7 opened this issue Feb 11, 2023 · 3 comments
Closed

rules.tables,What about too many tables #24115

zhoubin7 opened this issue Feb 11, 2023 · 3 comments
Assignees

Comments

@zhoubin7
Copy link

zhoubin7 commented Feb 11, 2023

Question

For English only, other languages will not accept.

Before asking a question, make sure you have:

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.
shardingsphere: 5.3.0
mysql: 8.0

dataSources:
  ds_jnmt:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    jdbcUrl: jdbc:mysql://localhost:3306/ds_jnmt
    username: root
    password: root
  ds_jnmt_ymlj:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.mysql.jdbc.Driver
    jdbcUrl: jdbc:mysql://localhost:3306/ds_jnmt_ymlj
    username: root
    password: root

rules:
- !SHARDING
  tables:
    sys_user:
      actualDataNodes: ds_${['jnmt','jnmt_ymlj']}.sys_user
    sys_dept:
        actualDataNodes: ds_${['jnmt','jnmt_ymlj']}.sys_dept
    sys_role:
        actualDataNodes: ds_${['jnmt','jnmt_ymlj']}.sys_role
    sys_user_role:
        actualDataNodes: ds_${['jnmt','jnmt_ymlj']}.sys_user_role
  bindingTables:
    - t_orders,t_order_item
  broadcastTables:
    - sys_tenant
    - qrtz_blob_triggers
    - qrtz_calendars
    - qrtz_cron_triggers
    - qrtz_fired_triggers
    - qrtz_job_details
    - qrtz_locks
    - qrtz_paused_trigger_grps
    - qrtz_scheduler_state
    - qrtz_simple_triggers
    - qrtz_simprop_triggers
    - qrtz_triggers
  defaultDatabaseStrategy:
    standard:
      shardingColumn: tenant_id
      shardingAlgorithmName: database-inline
  defaultTableStrategy:
    none:
  defaultShardingColumn: tenant_id

  shardingAlgorithms:
    database-inline:
      type: CLASS_BASED
      props:
        strategy: STANDARD
        algorithmClassName: com.my.DatabasePreciseShardingAlgorithm

  keyGenerators:
      snowflake:
          type: SNOWFLAKE
props:
  sql-show: true
  sql-simple: true

I have over 200 shard tables. Do I have to configure them here? It's too low level

@strongduanmu
Copy link
Member

@zhoubin7
Copy link
Author

你好@zhoubin7,可以尝试使用distsql来执行CREATE SHARDING TABLE RULE—— https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding/create-sharding -表规则/

I didn't use shardingsphere-proxy.
I'm using this shardingsphere 5.3.0

@github-actions github-actions bot added the stale label Jul 12, 2023
@linghengqian
Copy link
Member

@linghengqian linghengqian self-assigned this Sep 28, 2023
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

3 participants