简体   繁体   English

在AWS RDS Mysql 5.6上进行少量迁移后,Flyway挂起

[英]Flyway hanging after few migrations on AWS RDS Mysql 5.6

I can't seem to figure this one out... Up until now we are using Flyway with Percona XtraDB Cluster 5.6 on AWS, but since RDS is giving better performance and can be configured to be highly available we want to switch (there is no mysql compentence on our team). 我似乎无法弄清楚这一点...到目前为止,我们在AWS上将Flyway与Percona XtraDB Cluster 5.6结合使用,但是由于RDS提供了更好的性能并且可以配置为高可用性,因此我们想进行切换(我们的团队没有mysql能力)。

One would think once the RDS is up and running, one should be able to simply point flyway to the new server and set it up... One would be wrong! 有人会认为,一旦RDS启动并运行,就应该能够将Flyway指向新服务器并进行设置……这是错误的!

After 5 migration scripts flyway stops... Trying to query the DB isn't really working, so assuming some kind of locking which has gone wrong. 在5个迁移脚本停止之后,flyway停止了。。。尝试查询数据库并没有真正起作用,因此假定某种锁定已出错。

Flyway -X tells me this: Flyway -X告诉我:

Migrating schema common to version 1.1 迁移版本1.1 common架构

DEBUG: Found statement at line 1: ALTER TABLE use... DEBUG:在第1行找到了语句:ALTER TABLE use ...

DEBUG: Found statement at line 2: ALTER TABLE use... 调试:在第2行找到了语句:ALTER TABLE使用...

DEBUG: Executing SQL: ALTER TABLE use... 调试:执行SQL:使用ALTER TABLE ...

DEBUG: Executing SQL: ALTER TABLE use... 调试:执行SQL:使用ALTER TABLE ...

DEBUG: Successfully completed and committed migration of schema common to version 1.1 调试:成功完成并提交了1.1版common模式的迁移

DEBUG: MetaData table common . 调试:MetaData表common schema_version successfully updated to reflect changes schema_version成功更新以反映更改

DEBUG: Locking table common . 调试: common锁定表。 schema_version ... schema_version ...

DEBUG: Lock acquired for table common . 调试:为表common锁定。 schema_version

Migrating schema common to version 1.2 迁移版本1.2 common架构

DEBUG: Found statement at line 1: ALTER TABLE use... DEBUG:在第1行找到了语句:ALTER TABLE use ...

DEBUG: Executing SQL: ALTER TABLE use...) 调试:执行SQL:使用ALTER TABLE ...)

DEBUG: Successfully completed and committed migration of schema common to version 1.2 调试:成功完成并提交了1.2版common模式的迁移

DEBUG: MetaData table common . 调试:MetaData表common schema_version successfully updated to reflect changes schema_version成功更新以反映更改

DEBUG: Locking table common . 调试: common锁定表。 schema_version ... schema_version ...

DEBUG: Lock acquired for table common . 调试:为表common锁定。 schema_version

Migrating schema common to version 1.3 迁移版本1.3 common架构

DEBUG: Found statement at line 2: CREATE TABLE rou... DEBUG:在第2行找到了语句:CREATE TABLE rou ...

DEBUG: Executing SQL: CREATE TABLE rou... 调试:执行SQL:创建表程序...

DEBUG: Successfully completed and committed migration of schema common to version 1.3 调试:成功完成并提交了1.3版common模式的迁移

DEBUG: MetaData table common . 调试:MetaData表common schema_version successfully updated to reflect changes schema_version成功更新以反映更改

DEBUG: Locking table common . 调试: common锁定表。 schema_version ... schema_version ...

DEBUG: Lock acquired for table common . 调试:为表common锁定。 schema_version

Migrating schema common to version 1.4 迁移版本1.4 common架构

DEBUG: Found statement at line 1: ALTER TABLE use... DEBUG:在第1行找到了语句:ALTER TABLE use ...

DEBUG: Executing SQL: ALTER TABLE use... 调试:执行SQL:使用ALTER TABLE ...

DEBUG: Successfully completed and committed migration of schema common to version 1.4 调试:成功完成并提交了版本1.4 common模式的提交

DEBUG: MetaData table common . 调试:MetaData表common schema_version successfully updated to reflect changes schema_version成功更新以反映更改

DEBUG: Locking table common . 调试: common锁定表。 schema_version ... schema_version ...

(hangs forever from here) (从这里永远悬挂)

There are lots of scripts remaining (10+) that aren't executed. 还有许多剩余的脚本(超过10个)没有执行。 Killing flyway and restarting it will make it hang on connecting to the DB. 杀死flyway并重新启动它会使它挂在连接到DB上。 The only way to fix this is to delete the schema, recreate the schema and then retry the flyway migrate. 解决此问题的唯一方法是删除架构,重新创建架构,然后重试flyway迁移。 It will always hang at the exact same spot. 它将始终挂在完全相同的位置。 it's also not something in the script, as I tried replacing the fourth and fifth script with another. 它也不是脚本中的内容,因为我尝试用另一个替换第四和第五个脚本。 When the SQL commands are run from MySQL Workbench they simply work, on both Percona and RDS. 当从MySQL Workbench运行SQL命令时,它们在Percona和RDS上都可以正常工作。

是AWS RDS问题,而不是Flyway问题: https : //github.com/flyway/flyway/issues/772

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM