首页 > 解决方案 > 将数据从与一个 AWS 账户关联的实时 RDS 数据库实例迁移到与另一个 AWS 账户关联的新 RDS 数据库实例

问题描述

我正在使用托管在 AWS 上的 Sprint 启动应用程序。应用程序数据存储在 AWS RDS 中。现在我已经设置了另一个 AWS 账户,我想从与当前 AWS 账户关联的 RDS 实例中迁移数据。

在这方面,经过这里的几个帖子后,似乎,做同样的步骤如下:

1. Create a snapshot of the database in the RDS database instance associated with the current AWS account.
2. Share the snapshot with the new AWS account.
3. Import the data from this snapshot to the RDS instance associated with the new AWS account.

这种方法的一个问题是:我必须使应用程序对最终用户不可用,直到所有步骤都完成并且具有托管在新 AWS 账户中的数据库的应用程序开始运行,否则总会有一些增量剩余被迁移。

但是,我想将数据从现有实例迁移到新实例而不使应用程序对最终用户不可用,我没有找到任何合适的方法来实现相同的目标。

有人可以帮忙吗?谢谢。

标签: amazon-web-servicesamazon-rdsdatabase-migration

解决方案


创建只读副本

使用停止 MySQL.rds_stop_replication 在只读副本中停止从属

捕获 mysql_binary_log_file_name、mysql_binary_log_file_location

停止实例

拍摄快照

在另一个 AWS 账户中恢复

在 master 中创建复制用户名

在新创建的 RDS 中使用所需值运行以下命令

调用 mysql.rds_set_external_master ( host_name , host_port , replication_user_name , replication_user_password , mysql_binary_log_file_name , mysql_binary_log_file_location

);

移动连接和计划正确切换


推荐阅读