Adding a DB instance to an active-active cluster
You can add a DB instance to an Amazon RDS for MySQL active-active cluster by restoring a DB snapshot or by restoring a DB instance to a point in time. An active-active cluster can include up to nine DB instances.
When you recover a DB instance to a point in time, it usually includes more recent transactions than a DB instance that was restored from a DB snapshot. When the DB instance has more recent transactions, fewer transactions need to be applied when you start replication. So, using point-in-time recovery to add a DB instance to a cluster is usually faster than restoring from a DB snapshot.
Topics
Adding a DB instance to an active-active cluster using point-in-time recovery
You can add a DB instance to an active-active cluster by performing point-in-time recovery on a DB instance in the cluster.
For information about recovering a DB instance to a point in time in a different AWS Region, see Replicating automated backups to another AWS Region.
To add a DB instance to an active-active cluster using point-in-time recovery
-
Create a new DB instance by performing point-in-time recovery on a DB instance in the active-active cluster.
You can perform point-in-time recovery on any DB instance in the cluster to create the new DB instance. For instructions, see Restoring a DB instance to a specified time for Amazon RDS.
Important
During point-in-time-recovery, associate the new DB instance with a DB parameter group that has the active-active cluster parameters set. Otherwise, Group Replication won't start on the new DB instance. For information about the parameters and the required setting for each one, see Required parameter settings for active-active clusters.
Tip
If you take a snapshot of the DB instance before you start point-in-time recovery, you might be able to reduce the amount of time required to apply transactions on the new DB instance.
-
Add the DB instance to the
group_replication_group_seeds
parameter in each DB parameter group associated with a DB instance in the active-active cluster, including the DB parameter group that you associated with the new DB instance.For more information about setting parameters, see Modifying parameters in a DB parameter group in Amazon RDS.
-
In a SQL client, connect to the new DB instance, and call the mysql.rds_group_replication_set_recovery_channel stored procedure. Replace
group_replication_user_password
with the password for therdsgrprepladmin
user.call mysql.rds_group_replication_set_recovery_channel('
group_replication_user_password
'); -
Using the SQL client, call the mysql.rds_group_replication_start stored procedure to start replication:
call mysql.rds_group_replication_start(0);
Adding a DB instance to an active-active cluster using a DB snapshot
You can add a DB instance to an active-active cluster by creating a DB snapshot of a DB instance in the cluster and then restoring the DB snapshot.
For information about copying a snapshot to a different AWS Region, see Considerations for cross-Region snapshot copying.
To add a DB instance to an active-active cluster using a DB snapshot
-
Create a DB snapshot of a DB instance in the active-active cluster.
You can create a DB snapshot of any DB instance in the cluster. For instructions, see Creating a DB snapshot for a Single-AZ DB instance for Amazon RDS.
-
Restore a DB instance from the DB snapshot.
During the snapshot restore operation, associate the new DB instance with a DB parameter group that has the active-active cluster parameters set. For information about the parameters and the required setting for each one, see Required parameter settings for active-active clusters.
For information about restoring a DB instance from a DB snapshot, see Restoring to a DB instance.
-
Add the DB instance to the
group_replication_group_seeds
parameter in each DB parameter group associated with a DB instance in the active-active cluster, including the DB parameter group that you associated with the new DB instance.For more information about setting parameters, see Modifying parameters in a DB parameter group in Amazon RDS.
-
In a SQL client, connect to the new DB instance, and call the mysql.rds_group_replication_set_recovery_channel stored procedure. Replace
group_replication_user_password
with the password for therdsgrprepladmin
user.call mysql.rds_group_replication_set_recovery_channel('
group_replication_user_password
'); -
Using the SQL client, call the mysql.rds_group_replication_start stored procedure to start replication:
call mysql.rds_group_replication_start(0);