Durch die Nutzung von AWS re:Post stimmt du den AWS re:Post Nutzungsbedingungen

How do I migrate an Aurora MySQL-Compatible cluster that uses Aurora Serverless v1 to Aurora Serverless v2 with minimal downtime?

Lesedauer: 3 Minute
0

I want to migrate an Amazon Aurora MySQL-Compatible Edition cluster that uses Aurora Serverless v1 to Aurora Serverless v2 with minimal downtime.

Resolution

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

Convert your Aurora MySQL cluster to a provisioned cluster

Complete the following steps:

  1. If your Aurora MySQL cluster has a custom parameter group, first turn on binary logging, then set the binlog_format parameter to MIXED or ROW.
  2. (Optional) If your Aurora MySQL cluster uses a default parameter group, first create a custom parameter group and turn on binary logging. Then, set the binlog_format parameter to MIXED.
  3. Associate your custom parameter group with your Aurora MySQL cluster.
  4. To convert your Aurora MySQL Serverless v1 cluster to a provisioned cluster, run the modify-db-cluster command:
    Note: The following command requires downtime for the duration of the modification.
    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
    Note: Replace example-cluster-name with the name of your cluster.

Convert the provisioned cluster to use Aurora Serverless v2

Complete the following steps:

  1. To identify Aurora MySQL versions that support Aurora Serverless v2, run the describe-orderable-db-instance-options command:

    aws rds describe-orderable-db-instance-options \
    --engine aurora-mysql \
    --db-instance-class db.serverless \
    --region example-region \
    --query 'OrderableDBInstanceOptions[].[EngineVersion]' \
    --output text

    Note: Replace example-region with your AWS Region.

  2. To upgrade the provisioned cluster to a version that supports Aurora Serverless v2 with minimal downtime, 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 db.serverless instance class.

  4. To convert the added instance to a writer instance, select the green cluster.

  5. Choose Actions, and then choose Failover.

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

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

  8. Switch over to the green environment.

  9. Delete the blue/green deployment resources.

Related information

Upgrading from an Aurora Serverless v1 cluster to Aurora Serverless v2

AWS OFFICIAL
AWS OFFICIALAktualisiert vor 15 Tagen