Promoting a read replica to a DB cluster for Aurora MySQL
You can promote an Aurora MySQL read replica to a standalone DB cluster. When you promote an Aurora MySQL read replica, its DB instances are rebooted before they become available.
Typically, you promote an Aurora MySQL read replica to a standalone DB cluster as a data recovery scheme if the source DB cluster fails.
To do this, first create a read replica and then monitor the source DB cluster for failures. In the event of a failure, do the following:
-
Promote the read replica.
-
Direct database traffic to the promoted DB cluster.
-
Create a replacement read replica with the promoted DB cluster as its source.
When you promote a read replica, the read replica becomes a standalone Aurora DB cluster. The promotion process can take several minutes or longer to complete, depending on the size of the read replica. After you promote the read replica to a new DB cluster, it's just like any other DB cluster. For example, you can create read replicas from it and perform point-in-time restore operations. You can also create Aurora Replicas for the DB cluster.
Because the promoted DB cluster is no longer a read replica, you can't use it as a replication target.
The following steps show the general process for promoting a read replica to a DB cluster:
-
Stop any transactions from being written to the read replica source DB cluster, and then wait for all updates to be made to the read replica. Database updates occur on the read replica after they have occurred on the source DB cluster, and this replication lag can vary significantly. Use the
ReplicaLag
metric to determine when all updates have been made to the read replica. TheReplicaLag
metric records the amount of time a read replica DB instance lags behind the source DB instance. When theReplicaLag
metric reaches0
, the read replica has caught up to the source DB instance. -
Promote the read replica by using the Promote option on the Amazon RDS console, the AWS CLI command promote-read-replica-db-cluster, or the PromoteReadReplicaDBCluster Amazon RDS API operation.
You choose an Aurora MySQL DB instance to promote the read replica. After the read replica is promoted, the Aurora MySQL DB cluster is promoted to a standalone DB cluster. The DB instance with the highest failover priority is promoted to the primary DB instance for the DB cluster. The other DB instances become Aurora Replicas.
Note
The promotion process takes a few minutes to complete. When you promote a read replica, replication is stopped and the DB instances are rebooted. When the reboot is complete, the read replica is available as a new DB cluster.
To promote an Aurora MySQL read replica to a DB cluster
-
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
On the console, choose Instances.
The Instance pane appears.
-
In the Instances pane, choose the read replica that you want to promote.
The read replicas appear as Aurora MySQL DB instances.
-
For Actions, choose Promote read replica.
-
On the acknowledgment page, choose Promote read replica.
To promote a read replica to a DB cluster, use the AWS CLI promote-read-replica-db-cluster command.
Example
For Linux, macOS, or Unix:
aws rds promote-read-replica-db-cluster \ --db-cluster-identifier
mydbcluster
For Windows:
aws rds promote-read-replica-db-cluster ^ --db-cluster-identifier
mydbcluster
To promote a read replica to a DB cluster, call PromoteReadReplicaDBCluster.