Working with DB shard groups
You perform the following tasks to add and manage a DB shard group for Aurora PostgreSQL Limitless Database.
Topics
- Connecting to your Aurora PostgreSQL Limitless Database DB cluster
- Finding the number of routers and shards in a DB shard group
- Describing DB shard groups
- Rebooting a DB shard group
- Changing the capacity of a DB shard group
- Splitting a shard in a DB shard group
- Adding a router to a DB shard group
- Deleting a DB shard group
- Adding a DB shard group to an existing Aurora PostgreSQL Limitless Database DB cluster
Connecting to your Aurora PostgreSQL Limitless Database DB cluster
To work with Aurora PostgreSQL Limitless Database, you connect to the cluster endpoint. The endpoint automatically detects and abstracts the routers. You don't have to specify individual routers for connection.
You can use psql
or any other connection utility that works with PostgreSQL:
$
psql -hDB_cluster_endpoint
-pport_number
-Udatabase_username
-d postgres_limitless
The following example uses the endpoint for the DB cluster that you created in CLI.
$
psql -h my-limitless-cluster.cluster-ckifpdyyyxxx.us-east-1.rds.amazonaws.com -p 5432 -U postgres -d postgres_limitless
Note
The default database for the DB shard group in Aurora PostgreSQL Limitless Database is postgres_limitless
.
Using the Limitless Connection Plugin
When connecting to Aurora PostgreSQL Limitless Database, clients connect using the cluster endpoint, and are routed to a transaction router by Amazon Route 53. However, Route 53 is
limited in its ability to load balance, and can allow uneven workloads on transaction routers. The Limitless Connection Plugin
Finding the number of routers and shards in a DB shard group
You can use the following query to find the number of routers and shards:
SELECT * FROM rds_aurora.limitless_subclusters; subcluster_id | subcluster_type ---------------+----------------- 1 | router 2 | router 3 | shard 4 | shard 5 | shard 6 | shard
Describing DB shard groups
Use the describe-db-shard-groups
AWS CLI command to describe your DB shard groups. The following parameter is optional:
-
--db-shard-group-identifier
– The name of a DB shard group.
The following example describes a specific DB shard group.
aws rds describe-db-shard-groups --db-shard-group-identifier
my-db-shard-group
The output resembles the following example.
{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-8986d309a93c4da1b1455add17abcdef", "DBShardGroupIdentifier": "my-shard-group", "DBClusterIdentifier": "my-limitless-cluster", "MaxACU": 1000.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": false, "Endpoint": "my-limitless-cluster.limitless-ccetp2abcdef.us-east-1.rds.amazonaws.com" } ] }
Rebooting a DB shard group
Sometimes you have to reboot your DB shard group, for example when the max_connections
parameter changes because of a maximum
capacity change.
You can use the AWS Management Console or AWS CLI to change the capacity of a DB shard group.
Use the following procedure.
Sign in to the AWS Management Console and open the Amazon RDS console at
https://console.aws.amazon.com/rds/
-
Navigate to the Databases page.
-
Select the DB shard group that you want to reboot.
-
For Actions, choose Reboot.
-
Choose Confirm.
To reboot a DB shard group, use the reboot-db-shard-group
AWS CLI command with the following parameter:
-
--db-shard-group-identifier
– The name of a DB shard group.
The following example reboots a DB shard group.
aws rds reboot-db-shard-group --db-shard-group-identifier
my-db-shard-group