• 沒有找到結果。

Restoring an Aurora Serverless v1 DB cluster

在文檔中 Amazon Aurora (頁 183-187)

aws rds create-db-cluster db-cluster-identifier sample-cluster engine aurora-mysql --engine-version 5.7.mysql_aurora.2.07.1 ^

--engine-mode serverless --scaling-configuration

MinCapacity=4,MaxCapacity=32,SecondsUntilAutoPause=1000,AutoPause=true ^ --master-username username --master-user-password password

Example for Aurora PostgreSQL

The following command creates a new PostgreSQL 10.12–compatible Serverless DB cluster. Valid capacity values for Aurora PostgreSQL are 2, 4, 8, 16, 32, 64, 192, and 384.

For Linux, macOS, or Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-postgresql --engine-version 10.12 \

--engine-mode serverless --scaling-configuration

MinCapacity=8,MaxCapacity=64,SecondsUntilAutoPause=1000,AutoPause=true \ --master-username username --master-user-password password

For Windows:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-postgresql --engine-version 10.12 ^

--engine-mode serverless --scaling-configuration

MinCapacity=8,MaxCapacity=64,SecondsUntilAutoPause=1000,AutoPause=true ^ --master-username username --master-user-password password

RDS API

To create a new Aurora Serverless v1 DB cluster with the RDS API, run the CreateDBCluster operation and specify serverless for the EngineMode parameter.

You can optionally specify the ScalingConfiguration parameter to configure the minimum capacity, maximum capacity, and automatic pause when there are no connections. Valid capacity values include the following:

• Aurora MySQL: 1, 2, 4, 8, 16, 32, 64, 128, and 256.

• Aurora PostgreSQL: 2, 4, 8, 16, 32, 64, 192, and 384.

Restoring an Aurora Serverless v1 DB cluster

You can configure an Aurora Serverless v1 DB cluster when you restore a provisioned DB cluster snapshot with the AWS Management Console, the AWS CLI, or the RDS API.

When you restore a snapshot to an Aurora Serverless v1 DB cluster, you can set the following specific values:

Minimum Aurora capacity unit – Aurora Serverless v1 can reduce capacity down to this capacity unit.

Maximum Aurora capacity unit – Aurora Serverless v1 can increase capacity up to this capacity unit.

Timeout action – The action to take when a capacity modification times out because it can't find a scaling point. Aurora Serverless v1 DB cluster can force your DB cluster to the new capacity settings if

Restoring an Aurora Serverless v1 DB cluster

set the Force scaling the capacity to the specified values... option. Or, it can roll back the capacity change to cancel it if you don't choose the option. For more information, see Timeout action for capacity changes (p. 156).

Pause after inactivity – The amount of time with no database traffic to scale to zero processing capacity. When database traffic resumes, Aurora automatically resumes processing capacity and scales to handle the traffic.

For general information about restoring a DB cluster from a snapshot, see Restoring from a DB cluster snapshot (p. 500).

Console

You can restore a DB cluster snapshot to an Aurora DB cluster with the AWS Management Console.

To restore a DB cluster snapshot to an Aurora DB cluster

1. Sign in to the AWS Management Console and open the Amazon RDS console at https://

console.aws.amazon.com/rds/.

2. In the upper-right corner of the AWS Management Console, choose the AWS Region that hosts your source DB cluster.

3. In the navigation pane, choose Snapshots, and choose the DB cluster snapshot that you want to restore.

4. For Actions, choose Restore Snapshot.

5. On the Restore DB Cluster page, choose Serverless for Capacity type.

6. In the DB cluster identifier field, type the name for your restored DB cluster, and complete the other fields.

7. In the Capacity settings section, modify the scaling configuration.

Restoring an Aurora Serverless v1 DB cluster

8. Choose Restore DB Cluster.

To connect to an Aurora Serverless v1 DB cluster, use the database endpoint. For details, see the instructions in Connecting to an Amazon Aurora DB cluster (p. 284).

NoteIf you encounter the following error message, your account requires additional permissions:

Unable to create the resource. Verify that you have permission to create service linked role. Otherwise wait and try again later.

For more information, see Using service-linked roles for Amazon Aurora (p. 1794).

AWS CLI

You can configure an Aurora Serverless v1 DB cluster when you restore from a snapshot of another DB cluster. You can do so with the AWS CLI by using the restore-db-cluster-from-snapshot CLI command.

With your command, you include the following required parameters:

• --db-cluster-identifier mynewdbcluster

• --snapshot-identifier mydbclustersnapshot

• --engine-mode serverless

To restore a snapshot to an Aurora Serverless v1 cluster with MySQL 5.7 compatibility, include the following additional parameters:

• --engine aurora-mysql

Restoring an Aurora Serverless v1 DB cluster

• --engine-version 5.7

The --engine and --engine-version parameters let you create a MySQL 5.7-compatible Aurora Serverless v1 cluster from a MySQL 5.6-compatible Aurora or Aurora Serverless v1 snapshot. The following example restores a snapshot from a MySQL 5.6-compatible cluster named mydbclustersnapshot to a MySQL 5.7-compatible Aurora Serverless v1 cluster named mynewdbcluster.

For Linux, macOS, or Unix:

aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifier mynewdbcluster \ --snapshot-identifier mydbclustersnapshot \ --engine-mode serverless \

--engine aurora-mysql \ --engine-version 5.7

For Windows:

aws rds restore-db-cluster-from-snapshot ^ --db-instance-identifier mynewdbcluster ^ --db-snapshot-identifier mydbclustersnapshot ^ --engine aurora-mysql ^

--engine-version 5.7

You can optionally specify the --scaling-configuration option to configure the minimum capacity, maximum capacity, and automatic pause when there are no connections. Valid capacity values include the following:

• Aurora MySQL: 1, 2, 4, 8, 16, 32, 64, 128, and 256.

• Aurora PostgreSQL: 2, 4, 8, 16, 32, 64, 192, and 384.

In the following example, you restore from a previously created DB cluster snapshot named mydbclustersnapshot to a new DB cluster named mynewdbcluster. You set the --scaling-configuration so that the new Aurora Serverless DB cluster can scale from 8 ACUs to 64 ACUs (Aurora capacity units) as needed to process the workload. After processing completes and after 1000 seconds with no connections to support, the cluster shuts down until connection requests prompt it to restart.

For Linux, macOS, or Unix:

aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifier mynewdbcluster \ --snapshot-identifier mydbclustersnapshot \ --engine-mode serverless --scaling-configuration

MinCapacity=8,MaxCapacity=64,TimeoutAction='ForceApplyCapacityChange',SecondsUntilAutoPause=1000,AutoPause=true

For Windows:

aws rds restore-db-cluster-from-snapshot ^ --db-instance-identifier mynewdbcluster ^ --db-snapshot-identifier mydbclustersnapshot ^ --engine-mode serverless --scaling-configuration

MinCapacity=8,MaxCapacity=64,TimeoutAction='ForceApplyCapacityChange',SecondsUntilAutoPause=1000,AutoPause=true

在文檔中 Amazon Aurora (頁 183-187)