View a markdown version of this page

Getting started with database cluster groups for Aurora - Amazon Aurora

Getting started with database cluster groups for Aurora

In this tutorial, you create a database cluster group for Aurora, add Aurora DB clusters to it as member clusters, and connect to each one. You can then enable routing, map one database, and read it through the routing endpoint. You can start with Aurora DB clusters that you already run or with new ones.

Each step adds one capability, and you can stop after any step. After Step 2, the group coordinates upgrades in waves, backups, and monitoring across its member clusters, and you can restore them to a consistent point in time. For the terms in this tutorial, see Architecture of a database cluster group for Aurora. The commands and SQL in this tutorial are for Aurora MySQL.

Prerequisites

Before you begin, prepare the following:

  • An AWS account and the AWS CLI, set up as described in Setting up your environment for Amazon Aurora. To confirm that your AWS CLI has the commands for database cluster groups for Aurora, run aws rds describe-db-cluster-groups --region REGION. The command returns a DBClusterGroups list.

  • An IAM identity that can call the operations for database cluster groups for Aurora. Adding a cluster to a group authorizes against both the group and the DB cluster, so your policy must allow both resources. For the actions, see IAM and API permissions.

  • One or more Aurora DB clusters on a supported engine version, or permission to create them. Every cluster must be in the same AWS account, AWS Region, and VPC as the group, and run the group's engine. You choose the engine when you create the group, and it can't change later. A cluster in an Aurora global database can't join a group. For supported versions and the other requirements, see Limitations and considerations for database cluster groups for Aurora. For what joining a group changes on a cluster, see Architecture of a database cluster group for Aurora.

  • A maintenance window on each cluster that doesn't overlap the backup window that you set for the group.

  • A host inside the VPC with a database client for your engine. You run every SQL step from this host.

  • If you use routing, subnets in at least two Availability Zones of the group's VPC, with two free IP addresses for the routing endpoint. Also prepare a security group in the same VPC that allows inbound TCP traffic on the routing endpoint port from your clients and your SQL host. This security group controls traffic to the routing endpoint, not traffic between the routing endpoint and your member clusters. For more information, see Network access.

  • If you use routing, a plan for your database users. The routing layer doesn't copy users from member clusters. Each user that connects through the routing endpoint needs a router user there and a member cluster user of the same name on each member cluster that it reaches. For more information, see Router users and routing layer privileges.

  • If you use routing, the same values for the parameters that affect how a statement is interpreted on every member cluster. Through the routing endpoint on Aurora MySQL, the routing layer sets sql_mode, time_zone, autocommit, and transaction_isolation on each member cluster session from the routing endpoint parameters, or from its own defaults when a parameter isn't set. It sets other session variables, such as auto_increment_increment, from its own defaults. Other parameters take each member cluster's own value unless the client sets them in the session, and the group doesn't align them for you. Align the parameter groups, or set those parameters in the session.

The following prerequisites apply to Aurora MySQL.

Aurora MySQL
  • A MySQL client on your SQL host.

  • Security group access on port 3306, the routing endpoint port in the examples.

  • Router users that sign in with a password. IAM database authentication for router users isn't available at preview; use it on direct connections to member clusters. A database user that connects through the routing endpoint can use the mysql_native_password or caching_sha2_password plugin.

Tutorial steps

The tutorial has the following steps:

  1. Create a database cluster group for Aurora, with or without routing.

  2. Add member clusters: new clusters, or restored snapshots of your existing clusters.

  3. Connect and check your member clusters, through each member cluster's own endpoint.

  4. Enable routing and add data mappings: map one database and read it through the routing endpoint.

  5. Cleaning up resources: remove the resources that you created for the tutorial.

If you don't use routing, you can continue at Managing a database cluster group for Aurora after Step 3. After Step 5, Next steps lists the operations that you can add later.