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 2022/10/10 06:30:45 UTC
[GitHub] [shardingsphere] makexiao113 opened a new issue, #13586: ShardingSphere and Flyway compatibility issues
makexiao113 opened a new issue, #13586:
URL: https://github.com/apache/shardingsphere/issues/13586
I used both shardingSphere and Flyway, which accesses other schemas during initialization, For example mysql information_schema,performance_schema,sys, but my data source is only configured with one schema. How can FLYway access other schemas ?
here is my exception
```
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.apache.shardingsphere.infra.exception.SchemaNotExistedException: Schema 'performance_schema' doesn't exist.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:771)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:763)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:339)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1318)
at com.yaoyaosan.membership.MembershipApplicationServer.main(MembershipApplicationServer.java:20)
Caused by: org.apache.shardingsphere.infra.exception.SchemaNotExistedException: Schema 'performance_schema' doesn't exist.
at org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.getSchema(SelectStatementContext.java:100)
at org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.<init>(SelectStatementContext.java:86)
at org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.getDMLStatementContext(SQLStatementContextFactory.java:127)
at org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:110)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createLogicSQL(ShardingSpherePreparedStatement.java:385)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:375)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery(ShardingSpherePreparedStatement.java:180)
at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForString(JdbcTemplate.java:197)
at org.flywaydb.core.internal.database.mysql.MySQLDatabase.isRunningInPerconaXtraDBClusterWithStrictMode(MySQLDatabase.java:90)
at org.flywaydb.core.internal.database.mysql.MySQLDatabase.<init>(MySQLDatabase.java:72)
at org.flywaydb.core.internal.database.mysql.MySQLDatabaseType.createDatabase(MySQLDatabaseType.java:100)
at org.flywaydb.core.internal.database.base.DatabaseType.createDatabase(DatabaseType.java:148)
at org.flywaydb.core.Flyway.execute(Flyway.java:511)
at org.flywaydb.core.Flyway.migrate(Flyway.java:164)
at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 19 common frames omitted
```
here is my yaml
```
spring:
application:
name: membership
cloud:
nacos:
config:
server-addr: 127.0.0.1:8848
file-extension: yaml # 必须修改成yaml
discovery:
server-addr: 127.0.0.1:8848
shardingsphere:
datasource:
names: membership
membership:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/membership
username: membership
password: membership
mode:
type: Memory
schema:
name: membership
rules:
sharding:
tables:
# 配置 t_order 表规则
user_info:
actualDataNodes: membership.user_info_${0..7}
# 配置分表策略
tableStrategy:
standard:
shardingColumn: user_id
shardingAlgorithmName: table-inline
# 配置分片算法
sharding-algorithms:
table-inline:
type: INLINE
props:
algorithm-expression: user_info_$->{user_id % 8}
```
--
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] closed issue #13586: ShardingSphere and Flyway compatibility issues
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #13586: ShardingSphere and Flyway compatibility issues
URL: https://github.com/apache/shardingsphere/issues/13586
--
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] RaigorJiang closed issue #13586: ShardingSphere and Flyway compatibility issues
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #13586: ShardingSphere and Flyway compatibility issues
URL: https://github.com/apache/shardingsphere/issues/13586
--
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] github-actions[bot] commented on issue #13586: ShardingSphere and Flyway compatibility issues
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #13586:
URL: https://github.com/apache/shardingsphere/issues/13586#issuecomment-1272350684
Hello , this issue has not received a reply for several days.
This issue is supposed to be closed.
--
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] RaigorJiang commented on issue #13586: ShardingSphere and Flyway compatibility issues
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #13586:
URL: https://github.com/apache/shardingsphere/issues/13586#issuecomment-1407420841
#16234 has already provided relevant functions, I will close this issue now.
If this problem persists, please reopen it or submit a new one.
--
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