AWS RDS MySQL 跨区域复制

AWS RDS MySQL Cross-region replication

我需要在 us-east-1 中创建一个 RDS MySQL 实例,并想在另一个区域(例如 eu-west-1)复制此数据。我知道只读副本,我也会使用它们,但我想在另一个区域有一个备份的非只读副本。

有人做过吗?

是否有执行此复制的代码?

我强烈建议从 RDS MySQL 切换到 RDS Aurora, which is MySQL compatible. You won't have to change anything in your code, the database will still appear to be MySQL to any apps that connect to it. Among the many advantages Aurora has over MySQL is that it supports cross-region replication

有几种方法可以做到这一点。我将介绍两种简单的方法。 RDS 功能基于引擎(MySQL、Aurora、PostreSQL 等)。根据需要审核。

1) 在另一个区域创建现有 RDS 实例的只读副本。然后将该只读副本提升为 master。现在您在另一个区域有一个单独的实例 运行。然后您可以停止此实例以最大限度地减少计费(最多 7 天)。

2) 创建 RDS 快照。将该快照复制到另一个区域。需要时从快照启动新的 RDS 实例。