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/03/10 10:24:38 UTC

[GitHub] [incubator-shardingsphere] Zhumingj opened a new issue #4697: Cannot find table rule and default data source with logic tables

Zhumingj opened a new issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697
 
 
   Please, when only databases need to shard and tables need not to shard, how can I omit the following configuration, 
   such as: spring.shardingsphere.sharding.tables.tb_order.actual-data-nodes=
   If it has to be configured, if there are hundreds of tables, does it need to be configured hundreds of times?

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597719152
 
 
   spring.shardingsphere.datasource.names=tenant-meituan,tenant-taobao,tenant-jd,tenant-common
   
   spring.shardingsphere.datasource.tenant-meituan.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-meituan.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-meituan.url=jdbc:mysql://localhost:3306/tenant_meituan
   spring.shardingsphere.datasource.tenant-meituan.username=root
   spring.shardingsphere.datasource.tenant-meituan.password=password
   
   spring.shardingsphere.datasource.tenant-taobao.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-taobao.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-taobao.url=jdbc:mysql://localhost:3306/tenant_taobao
   spring.shardingsphere.datasource.tenant-taobao.username=root
   spring.shardingsphere.datasource.tenant-taobao.password=password
   
   spring.shardingsphere.datasource.tenant-jd.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-jd.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-jd.url=jdbc:mysql://localhost:3306/tenant_jd
   spring.shardingsphere.datasource.tenant-jd.username=root
   spring.shardingsphere.datasource.tenant-jd.password=password
   
   
   spring.shardingsphere.datasource.tenant-common.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-common.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-common.url=jdbc:mysql://localhost:3306/tenant_common
   spring.shardingsphere.datasource.tenant-common.username=root
   spring.shardingsphere.datasource.tenant-common.password=password
   
   
   spring.shardingsphere.sharding.default-data-source-name=tenant-common
   
   ## hundreds of tables
   spring.shardingsphere.sharding.tables.tb_order.actual-data-nodes=tenant-meituan.tb_order,tenant-taobao.tb_order,tenant-jd.tb_order
   spring.shardingsphere.sharding.tables.tb_order_item.actual-data-nodes=tenant-meituan.tb_order_item,tenant-taobao.tb_order_item,tenant-jd.tb_order_item
   spring.shardingsphere.sharding.tables.tb_user_info.actual-data-nodes=tenant-meituan.tb_user_info,tenant-taobao.tb_user_info,tenant-jd.tb_user_info
   ......
   spring.shardingsphere.sharding.tables.tb_sys_dict.actual-data-nodes=tenant-meituan.tb_sys_dict,tenant-taobao.tb_sys_dict,tenant-jd.tb_sys_dict
   
   
   spring.shardingsphere.sharding.default-database-strategy.standard.sharding-column=merchant
   spring.shardingsphere.sharding.default-database-strategy.standard.precise-algorithm-class-name=com.bsi.shardingsphere.demo.algorithm.DbShardingAlgorithm
   
   spring.shardingsphere.props.sql.show=true
   
   
   Above are all my configurations, there's no problem, but the configuration is troublesome,because I need to config actual-data-nodes for hundreds of tables.   Is there any other solution?
   
   
   
   
   
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597047106
 
 
   Configuration is a one-time job, and if needn't shard, you can config nothing for them as default tables.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597117852
 
 
   > You may try for inline expression, for example: `tb_order_$->{0...99}`
   
   it's not what i want.  i just want to shard databases,  but if there are many tables,  do i have to config all of these tables for inline expression? 

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu edited a comment on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
terrymanu edited a comment on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597112131
 
 
   You may try for inline expression, for example: `tb_order_$->{0...99}`

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597558247
 
 
   Sorry, I can't understand it. The situation is like this. I need to shard databases at present, and I don't need to shard tables. Now there are many tables with the sharding-column, which can be divided to the database. I need to configure actual-data-nodes for all of these tables to query. If you don't configure them, an error will be reported.  Can you tell me how to simplify the configuration?

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597554572
 
 
   not at all, as default tables, no need to config.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking edited a comment on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
kimmking edited a comment on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597666580
 
 
   You can config nothing for tables.
   Those non-sharding tables will be configured as default tables automically.
   If they're sharding tables, you can do this to gather all tables' name:
   ```
   use information_schema
   select group_concat(table_name) from tables where table_schema='database name';
   ```
   ![image](https://user-images.githubusercontent.com/807508/76428257-67027c00-63e8-11ea-8d2c-7a21dfbee938.png)
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597112131
 
 
   You may try for inline expression, for example: `$tb_order{0...99}`

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu edited a comment on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
terrymanu edited a comment on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597112131
 
 
   You may try for inline expression, for example: `tb_order$->{0...99}`

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
Zhumingj commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597059091
 
 
   if i config nothing,  when i query ,  the system will report an error:Cannot find table rule and default data source with logic table: 'tb_order'

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking commented on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597666580
 
 
   You can config nothing for tables.
   Those non-sharding tables will be configured as default tables automically.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] Zhumingj edited a comment on issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
Zhumingj edited a comment on issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697#issuecomment-597719152
 
 
   spring.shardingsphere.datasource.names=tenant-meituan,tenant-taobao,tenant-jd,tenant-common
   
   spring.shardingsphere.datasource.tenant-meituan.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-meituan.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-meituan.url=jdbc:mysql://localhost:3306/tenant_meituan
   spring.shardingsphere.datasource.tenant-meituan.username=root
   spring.shardingsphere.datasource.tenant-meituan.password=password
   
   spring.shardingsphere.datasource.tenant-taobao.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-taobao.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-taobao.url=jdbc:mysql://localhost:3306/tenant_taobao
   spring.shardingsphere.datasource.tenant-taobao.username=root
   spring.shardingsphere.datasource.tenant-taobao.password=password
   
   spring.shardingsphere.datasource.tenant-jd.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-jd.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-jd.url=jdbc:mysql://localhost:3306/tenant_jd
   spring.shardingsphere.datasource.tenant-jd.username=root
   spring.shardingsphere.datasource.tenant-jd.password=password
   
   
   spring.shardingsphere.datasource.tenant-common.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.tenant-common.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.tenant-common.url=jdbc:mysql://localhost:3306/tenant_common
   spring.shardingsphere.datasource.tenant-common.username=root
   spring.shardingsphere.datasource.tenant-common.password=password
   
   
   spring.shardingsphere.sharding.default-data-source-name=tenant-common
   
   ### hundreds of tables
   spring.shardingsphere.sharding.tables.tb_order.actual-data-nodes=tenant-meituan.tb_order,tenant-taobao.tb_order,tenant-jd.tb_order
   spring.shardingsphere.sharding.tables.tb_order_item.actual-data-nodes=tenant-meituan.tb_order_item,tenant-taobao.tb_order_item,tenant-jd.tb_order_item
   spring.shardingsphere.sharding.tables.tb_user_info.actual-data-nodes=tenant-meituan.tb_user_info,tenant-taobao.tb_user_info,tenant-jd.tb_user_info
   ......
   spring.shardingsphere.sharding.tables.tb_sys_dict.actual-data-nodes=tenant-meituan.tb_sys_dict,tenant-taobao.tb_sys_dict,tenant-jd.tb_sys_dict
   
   
   spring.shardingsphere.sharding.default-database-strategy.standard.sharding-column=merchant
   spring.shardingsphere.sharding.default-database-strategy.standard.precise-algorithm-class-name=com.bsi.shardingsphere.demo.algorithm.DbShardingAlgorithm
   
   spring.shardingsphere.props.sql.show=true
   
   
   Above are all my configurations, there's no problem, but the configuration is troublesome,because I need to config actual-data-nodes for hundreds of tables.   Is there any other solution?
   
   
   
   
   
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] Zhumingj closed issue #4697: Cannot find table rule and default data source with logic tables

Posted by GitBox <gi...@apache.org>.
Zhumingj closed issue #4697: Cannot find table rule and default data source with logic tables
URL: https://github.com/apache/incubator-shardingsphere/issues/4697
 
 
   

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


With regards,
Apache Git Services