You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zhaojinchao95 (via GitHub)" <gi...@apache.org> on 2023/07/20 08:28:55 UTC
[GitHub] [shardingsphere] zhaojinchao95 opened a new issue, #27329: org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException
zhaojinchao95 opened a new issue, #27329:
URL: https://github.com/apache/shardingsphere/issues/27329
[ecb1e64985142fe8f96d2edd8e148ca98f56ded7](https://github.com/apache/shardingsphere/commit/ecb1e64985142fe8f96d2edd8e148ca98f56ded7)
```
org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException: `database-inline` algorithm does not exist in database `sharding_db`.
at org.apache.shardingsphere.sharding.checker.ShardingRuleConfigurationChecker.lambda$checkShardingStrategy$6(ShardingRuleConfigurationChecker.java:106)
at org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:41)
at org.apache.shardingsphere.sharding.checker.ShardingRuleConfigurationChecker.checkShardingStrategy(ShardingRuleConfigurationChecker.java:105)
at org.apache.shardingsphere.sharding.checker.ShardingRuleConfigurationChecker.check(ShardingRuleConfigurationChecker.java:54)
at org.apache.shardingsphere.sharding.checker.ShardingRuleConfigurationChecker.check(ShardingRuleConfigurationChecker.java:44)
at org.apache.shardingsphere.infra.rule.builder.database.DatabaseRulesBuilder.build(DatabaseRulesBuilder.java:63)
at org.apache.shardingsphere.metadata.factory.NewInternalMetaDataFactory.create(NewInternalMetaDataFactory.java:55)
at org.apache.shardingsphere.metadata.factory.NewInternalMetaDataFactory.createDatabases(NewInternalMetaDataFactory.java:80)
at org.apache.shardingsphere.metadata.factory.NewInternalMetaDataFactory.create(NewInternalMetaDataFactory.java:69)
at org.apache.shardingsphere.mode.metadata.NewMetaDataContextsFactory.create(NewMetaDataContextsFactory.java:96)
at org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder.build(NewClusterContextManagerBuilder.java:58)
at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:68)
at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:58)
at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:55)
```
`config-sharding.yaml:`
```
databaseName: sharding_db
dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !SHARDING
tables:
t_order:
actualDataNodes: ds_${0..1}.t_order_${0..1}
tableStrategy:
standard:
shardingColumn: order_id
shardingAlgorithmName: t_order_inline
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
auditStrategy:
auditorNames:
- sharding_key_required_auditor
allowHintDisable: true
t_order_item:
actualDataNodes: ds_${0..1}.t_order_item_${0..1}
tableStrategy:
standard:
shardingColumn: order_id
shardingAlgorithmName: t_order_item_inline
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
bindingTables:
- t_order,t_order_item
defaultDatabaseStrategy:
standard:
shardingColumn: user_id
shardingAlgorithmName: database-inline
defaultTableStrategy:
none:
defaultAuditStrategy:
auditorNames:
- sharding_key_required_auditor
allowHintDisable: true
shardingAlgorithms:
database-inline:
type: INLINE
props:
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
auditors:
sharding_key_required_auditor:
type: DML_SHARDING_CONDITIONS
- !BROADCAST
tables:
- t_address
```
`server.yaml : `
```
mode:
type: Cluster
repository:
type: ZooKeeper
props:
namespace: governance_ds
server-lists: localhost:2181
retryIntervalMilliseconds: 500
timeToLiveSeconds: 60
maxRetries: 3
operationTimeoutMilliseconds: 500
authority:
users:
- user: root@%
password: root
- user: sharding
password: sharding
privilege:
type: ALL_PERMITTED
```
Restrart ShardingSphere-Proxy two 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.
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] github-actions[bot] commented on issue #27329: org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException when algorithm name not separated by underscores
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27329:
URL: https://github.com/apache/shardingsphere/issues/27329#issuecomment-1685096715
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
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
Re: [I] org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException when algorithm name not separated by underscores [shardingsphere]
Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #27329:
URL: https://github.com/apache/shardingsphere/issues/27329#issuecomment-2227380337
The problem are resolved
--
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
Re: [I] org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException when algorithm name not separated by underscores [shardingsphere]
Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 closed issue #27329: org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException when algorithm name not separated by underscores
URL: https://github.com/apache/shardingsphere/issues/27329
--
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] zhaojinchao95 commented on issue #27329: org.apache.shardingsphere.sharding.exception.metadata.MissingRequiredShardingAlgorithmException when algorithm name not separated by underscores
Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #27329:
URL: https://github.com/apache/shardingsphere/issues/27329#issuecomment-1643503968
Now, ShardingSpherer is only support algorith name with `_`, the database-line is not allowed.
--
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