• 沒有找到結果。

Original console

在文檔中 Amazon Aurora (頁 144-151)

To create an Aurora DB cluster using the AWS Management Console

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

console.aws.amazon.com/rds/.

2. In the top-right corner of the AWS Management Console, choose the AWS Region in which you want to create the Aurora DB cluster.

3. In the navigation pane, choose Databases.

If the navigation pane is closed, choose the menu icon at the top left to open it.

4. Choose Create database to open the Select engine page.

5. On the Select engine page, choose an edition of Aurora. Choose either MySQL 5.6-compatible, MySQL 5.7-compatible, MySQL 8.0-compatible, or PostgreSQL-compatible.

Creating a DB cluster

6. Choose Next.

7. On the Specify DB details page, specify your DB instance information. For information about each setting, see Settings for Aurora DB clusters (p. 137).

A typical Specify DB details page looks like the following.

Creating a DB cluster

8. Confirm your master password and choose Next.

9. On the Configure advanced settings page, you can customize additional settings for your Aurora DB cluster. For information about each setting, see Settings for Aurora DB clusters (p. 137).

10. Choose Create database to create your Aurora DB cluster, and then choose Close.

On the Amazon RDS console, the new DB cluster appears in the list of DB clusters. The DB cluster will have a status of creating until the DB cluster is created and ready for use. When the state changes to available, you can connect to the writer instance for your DB cluster. Depending on the DB cluster class and store allocated, it can take several minutes for the new cluster to be available.

Creating a DB cluster

To view the newly created cluster, choose Databases from the navigation pane in the Amazon RDS console and choose the DB cluster to show the DB cluster details. For more information, see Viewing an Amazon Aurora DB cluster (p. 550).

Note the ports and the endpoints of the cluster. Use the endpoint and port of the writer DB cluster in your JDBC and ODBC connection strings for any application that performs write or read operations.

Creating a DB cluster

AWS CLI

NoteBefore you can create an Aurora DB cluster using the AWS CLI, you must fulfill the required prerequisites, such as creating a VPC and an RDS DB subnet group. For more information, see DB cluster prerequisites (p. 125).

You can use the AWS CLI to create an Aurora MySQL DB cluster or an Aurora PostgreSQL DB cluster.

To create an Aurora MySQL DB cluster using the AWS CLI

When you create an Aurora MySQL DB cluster or DB instance, ensure that you specify the correct value for the --engine option value based on the MySQL compatibility of the DB cluster or DB instance.

• When you create an Aurora MySQL 8.0-compatible or 5.7-compatible DB cluster or DB instance, you specify aurora-mysql for the --engine option.

• When you create an Aurora MySQL 5.6-compatible DB cluster or DB instance, you specify aurora for the --engine option.

Complete the following steps:

1. Identify the DB subnet group and VPC security group ID for your new DB cluster, and then call the create-db-cluster AWS CLI command to create the Aurora MySQL DB cluster.

For example, the following command creates a new MySQL 8.0–compatible DB cluster named sample-cluster.

For Linux, macOS, or Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-mysql \

--engine-version 8.0 --master-username user-name --master-user-password password \ --db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

For Windows:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-mysql ^ --engine-version 8.0 --master-username user-name --master-user-password password ^ --db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

The following command creates a new MySQL 5.7–compatible DB cluster named sample-cluster.

For Linux, macOS, or Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-mysql \ --engine-version 5.7.12 --master-username user-name

--master-user-password --master-user-password \

--db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

For Windows:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-mysql ^ --engine-version 5.7.12 --master-username user-name --master-user-password password

Creating a DB cluster

--db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

The following command creates a new MySQL 5.6–compatible DB cluster named sample-cluster.

For Linux, macOS, or Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora \ --engine-version 5.6.10a --master-username user-name

--master-user-password --master-user-password \

--db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

For Windows:

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora ^ --engine-version 5.6.10a --master-username user-name

--master-user-password --master-user-password ^

--db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

2. If you use the console to create a DB cluster, then Amazon RDS automatically creates the primary instance (writer) for your DB cluster. If you use the AWS CLI to create a DB cluster, you must explicitly create the primary instance for your DB cluster. The primary instance is the first instance that is created in a DB cluster.

Call the create-db-instance AWS CLI command to create the primary instance for your DB cluster.

Include the name of the DB cluster as the --db-cluster-identifier option value.

For example, the following command creates a new MySQL 5.7–compatible or MySQL 8.0–

compatible DB instance named sample-instance.

For Linux, macOS, or Unix:

aws rds create-db-instance --db-instance-identifier sample-instance \

--db-cluster-identifier sample-cluster --engine aurora-mysql --db-instance-class db.r5.large

For Windows:

aws rds create-db-instance --db-instance-identifier sample-instance ^

--db-cluster-identifier sample-cluster --engine aurora-mysql --db-instance-class db.r5.large

The following command creates a new MySQL 5.6–compatible DB instance named sample-instance.

For Linux, macOS, or Unix:

aws rds create-db-instance --db-instance-identifier sample-instance \

--db-cluster-identifier sample-cluster --engine aurora --db-instance-class db.r5.large

For Windows:

aws rds create-db-instance --db-instance-identifier sample-instance ^

--db-cluster-identifier sample-cluster --engine aurora --db-instance-class db.r5.large

Creating a DB cluster

To create an Aurora PostgreSQL DB cluster using the AWS CLI

1. Identify the DB subnet group and VPC security group ID for your new DB cluster, and then call the create-db-cluster AWS CLI command to create the Aurora PostgreSQL DB cluster.

For example, the following command creates a new DB cluster named sample-cluster.

For Linux, macOS, or Unix:

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

--master-username user-name --master-user-password password \

--db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

For Windows:

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

--master-username user-name --master-user-password password ^

--db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

2. If you use the console to create a DB cluster, then Amazon RDS automatically creates the primary instance (writer) for your DB cluster. If you use the AWS CLI to create a DB cluster, you must explicitly create the primary instance for your DB cluster. The primary instance is the first instance that is created in a DB cluster.

Call the create-db-instance AWS CLI command to create the primary instance for your DB cluster.

Include the name of the DB cluster as the --db-cluster-identifier option value.

For Linux, macOS, or Unix:

aws rds create-db-instance --db-instance-identifier sample-instance \

--db-cluster-identifier sample-cluster --engine aurora-postgresql --db-instance-class db.r4.large

For Windows:

aws rds create-db-instance --db-instance-identifier sample-instance ^

--db-cluster-identifier sample-cluster --engine aurora-postgresql --db-instance-class db.r4.large

RDS API

Note

Before you can create an Aurora DB cluster using the AWS CLI, you must fulfill the required prerequisites, such as creating a VPC and an RDS DB subnet group. For more information, see DB cluster prerequisites (p. 125).

Identify the DB subnet group and VPC security group ID for your new DB cluster, and then call the CreateDBCluster operation to create the DB cluster.

When you create an Aurora MySQL DB cluster or DB instance, ensure that you specify the correct value for the Engine parameter value based on the MySQL compatibility of the DB cluster or DB instance.

• When you create an Aurora MySQL 5.7 DB cluster or DB instance, you must specify aurora-mysql for the Engine parameter.

Available settings

• When you create an Aurora MySQL 5.6 DB cluster or DB instance, you must specify aurora for the Engine parameter.

When you create an Aurora PostgreSQL DB cluster or DB instance, specify aurora-postgresql for the Engine parameter.

在文檔中 Amazon Aurora (頁 144-151)