How do I migrate an Amazon Aurora MySQL Serverless v1 cluster to Amazon MySQL Serverless v2 with minimal downtime?

3 minuti di lettura
0

I want to migrate an Amazon Aurora MySQL Serverless v1 (Amazon Aurora MySQL Serverless version 1) cluster to Amazon MySQL Serverless v2 (Amazon Aurora MySQL Serverless version 2) with minimal downtime.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

To migrate an Aurora MySQL Serverless v1 cluster to an Aurora MySQL Serverless v2 cluster, complete the following steps:

Convert the Aurora MySQL Serverless v1 cluster to a provisioned cluster

To convert your Aurora MySQL Serverless v1 cluster to a provisioned cluster, complete the following steps:

  1. If your v1 cluster has a custom parameter group, then take the following actions:
    Turn on binary logging.
    Set the binlog_format parameter MIXED or ROW.
  2. (Optional) If your v1 cluster uses a default parameter group, then create a custom parameter group and take the following actions:
    Turn on binary logging.
    Set the binlog_format parameter to MIXED.
  3. Associate your custom parameter group with your Aurora MySQL Serverless v1 cluster.
  4. To convert your v1 cluster to a provisioned cluster, run the modify-db-cluster command:
    Note: The following command requires downtime for the duration of the modification. Replace example-cluster-name with your cluster's name.
    aws rds modify-db-cluster \
    --db-cluster-identifier example-cluster-name \
    --engine-mode provisioned \
    --allow-engine-mode-change \
    --db-cluster-instance-class db.r5.xlarge \
    ----apply-immediately

Convert the provisioned cluster to an Aurora MySQL Serverless v2 cluster

To convert the provisioned cluster to an Aurora MySQL Serverless v2 cluster, complete the following steps:

  1. To identify Aurora MySQL versions that support Aurora Serverless v2, run the describe-orderable-db-instance-options command:
    Note: Replace example-region with your AWS Region.

    aws rds describe-orderable-db-instance-options --engine aurora-mysql --db-instance-class db.serverless \
    --region example-region --query 'OrderableDBInstanceOptions[].[EngineVersion]'--output text
  2. To upgrade the provisioned cluster to a version that supports Aurora Serverless v2, create a blue/green deployment. Make sure that you select the new version for your green environment.
    Note: The blue/green environment takes time to create, but downtime doesn't occur. The upgrade occurs in the green environment.

  3. Add an Aurora Serverless reader to the green cluster with the v2 DB instance class.

  4. To convert the added instance to a writer instance, select the green cluster, and then choose Actions > Failover.

  5. (Optional) If you don't want to have a provisioned database within your cluster, then delete the provisioned database.

  6. To test the green environment with the new Aurora Serverless v2 cluster, use the blue instance that's available to the application.

  7. Switch over to the green environment.

  8. Delete the blue/green deployment resources.

Related information

Upgrading from an Aurora Serverless v1 cluster to Aurora Serverless v2

AWS UFFICIALE
AWS UFFICIALEAggiornata 2 mesi fa