• 沒有找到結果。

Creating an Aurora Serverless v1 DB cluster

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

operations. Before scaling, Aurora Serverless looks for a scaling point and it does so for up to seven days if necessary.

At the end of each day that Aurora Serverless can't find a scaling point, it creates a cluster event. This event notifies you of the pending maintenance and the need to scale to perform maintenance. The notification includes the date when the Aurora Serverless can force the DB cluster to scale.

Until that time, your Aurora Serverless DB cluster continues looking for a scaling point and behaves according to its TimeoutAction setting. That is, if it can't find a scaling point before timing out, it abandons the capacity change if it's configured to RollbackCapacityChange. Or it forces the change if it's set to ForceApplyCapacityChange. As with any change that's forced without an appropriate scaling point, this might interrupt your workload.

For more information, see Timeout action for capacity changes (p. 156).

Aurora Serverless v1 and failover

If the DB instance for an Aurora Serverless v1 DB cluster becomes unavailable or the Availability Zone (AZ) it is in fails, Aurora recreates the DB instance in a different AZ. We refer to this capability as automatic multi-AZ failover.

This failover mechanism takes longer than for an Aurora provisioned cluster. The Aurora Serverless v1 failover time is currently undefined because it depends on demand and capacity availability in other AZs within the given AWS Region.

Because Aurora separates computation capacity and storage, the storage volume for the cluster is spread across multiple AZs. Your data remains available even if outages affect the DB instance or the associated AZ.

Aurora Serverless v1 and snapshots

The cluster volume for an Aurora Serverless v1 cluster is always encrypted. You can choose the

encryption key, but you can't disable encryption. To copy or share a snapshot of an Aurora Serverless v1 cluster, you encrypt the snapshot using your own AWS KMS key. For more information, see Copying a DB cluster snapshot . To learn more about encryption and Amazon Aurora, see Encrypting Amazon Aurora resources.

Creating an Aurora Serverless v1 DB cluster

When you create an Aurora Serverless v1 DB cluster, you can set the minimum and maximum capacity for the cluster. A capacity unit is equivalent to a specific compute and memory configuration. Aurora Serverless creates scaling rules for thresholds for CPU utilization, connections, and available memory and seamlessly scales to a range of capacity units as needed for your applications. For more information see Aurora Serverless v1 architecture (p. 154).

You can set the following specific values for your Aurora Serverless v1 DB cluster:

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.

You can also choose the following optional scaling configuration options:

Roll back the capacity change – To cancel capacity changes if Aurora Serverless v1 can't find a scaling point, choose this setting.

Force the capacity change – To force Aurora Serverless v1 to scale even if it can't find a scaling point before it times out, choose this setting.

Creating an Aurora Serverless v1 DB cluster

For more information, see Timeout action for capacity changes (p. 156).

Pause compute capacity after consecutive minutes of inactivity – You can choose this setting if you want Aurora Serverless v1 to scale to zero when there's no activity on your DB cluster for an amount of time you specify. With this setting enabled, your Aurora Serverless v1 DB cluster automatically resumes processing and scales to the necessary capacity to handle the workload when database traffic resumes. To learn more, see Pause and resume for Aurora Serverless v1 (p. 157).

Before you can create an Aurora Serverless v1 DB cluster, you need an AWS account. You also need to have completed the setup tasks for working with Amazon Aurora. For more information, see Setting up your environment for Amazon Aurora (p. 84). You also need to complete other preliminary steps for creating any Aurora DB cluster. To learn more, see Creating an Amazon Aurora DB cluster (p. 125).

Aurora Serverless v1 is available in certain AWS Regions and for specific Aurora MySQL and Aurora PostgreSQL versions only. For more information, see Aurora Serverless v1 (p. 29).

Note

The cluster volume for an Aurora Serverless v1 cluster is always encrypted. When you create your Aurora Serverless v1 DB cluster, you can't turn off encryption, but you can choose to use your own encryption key.

You can create an Aurora Serverless v1 DB cluster with the AWS Management Console, the AWS CLI, or the RDS API by following the steps below.

Console

To create a new Aurora Serverless v1 DB cluster, you sign in to the AWS Management Console and choose an AWS Region that supports Aurora Serverless v1. Choose Amazon RDS from the AWS Services list, and then choose Create database.

On the Create database page:

• Choose Standard Create for the database creation method.

• Choose Amazon Aurora for the Engine type in the Engine options section.

You then choose Amazon Aurora with MySQL compatibility or Amazon Aurora with PostgreSQL compatibility and continue creating the Aurora Serverless v1 DB cluster by using the steps from the following examples. If you choose a version of the DB engine that doesn't support Aurora Serverless v1, the Serverless option doesn't display.

Example for Aurora MySQL

Choose Amazon Aurora with MySQL Compatibility for the Edition. Choose the Aurora MySQL engine you want for your cluster from the Version selector. The following image shows an example.

Creating an Aurora Serverless v1 DB cluster

Choose Serverless for the Capacity type.

You can configure the scaling configuration of the Aurora Serverless v1 DB cluster by adjusting values in the Capacity settings section of the page. To learn more about capacity settings, see Autoscaling for Aurora Serverless v1 (p. 155). The following image shows the Capacity settings you can adjust for an Aurora MySQL Serverless DB cluster.

Creating an Aurora Serverless v1 DB cluster

You can also enable the Data API for your Aurora MySQL Serverless DB cluster. Select the Data API checkbox in the Connectivity section of the Create database page. To learn more about the Data API, see Using the Data API for Aurora Serverless (p. 181).

Example for Aurora PostgreSQL

Choose Amazon Aurora with Postgres; Compatibility for the Edition and select the Version of Aurora PostgreSQL available for Aurora Serverless v1. For more information, see Aurora Serverless v1 (p. 29).

Creating an Aurora Serverless v1 DB cluster

You can configure the scaling configuration of the Aurora Serverless v1 DB cluster by adjusting values in the Capacity settings section of the page. The following image shows the Capacity settings you can adjust for an Aurora PostgreSQL Serverless DB cluster. To learn more about capacity settings, see Autoscaling for Aurora Serverless v1 (p. 155).

Creating an Aurora Serverless v1 DB cluster

You can also enable the Data API for your Aurora PostgreSQL Serverless DB cluster. Select the Data API checkbox in the Connectivity section of the Create database page. See Using the Data API for Aurora Serverless (p. 181) for more information about the Data API.

For more information on creating an Aurora DB cluster using the AWS Management Console, see Creating an Amazon Aurora DB cluster (p. 125).

NoteIf you receive the following error message when trying to create your cluster, your account needs additional permissions.

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

See Using service-linked roles for Amazon Aurora (p. 1794) for more information.

You can't directly connect to the DB instance on your Aurora Serverless v1 DB cluster. To connect to your Aurora Serverless v1 DB cluster, you use the database endpoint. You can find the endpoint for your Aurora Serverless v1 DB cluster on the Connectivity & security tab for your cluster in the AWS Management Console. For more information, see Connecting to an Amazon Aurora DB cluster (p. 284).

AWS CLI

To create a new Aurora Serverless v1 DB cluster with the AWS CLI, run the create-db-cluster command and specify serverless for the --engine-mode option.

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

The following command examples create a new Serverless DB cluster by setting the --engine-mode option to serverless. The examples also specify values for the --scaling-configuration option.

Example for Aurora MySQL

The following commands create new MySQL–compatible Serverless DB clusters. Valid capacity values for Aurora MySQL are 1, 2, 4, 8, 16, 32, 64, 128, and 256.

For Linux, macOS, or Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora --engine-version 5.6.10a \

--engine-mode serverless --scaling-configuration

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

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

For Windows:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora --engine-version 5.6.10a ^

--engine-mode serverless --scaling-configuration

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

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