Skip to content

RDS Aurora MySQL DB snapshot endpoints are stuck in creating state

0

I created a database from a snapshot, which took a while:

But when I try to use it the endpoints, they are stuck like this:

The command I use to restore the cluster from the snapshot is like this:

aws --profile Abcd --region  us-east-1  rds restore-db-cluster-from-snapshot --engine aurora-mysql --db-cluster-identifier abcsqlbackup --snapshot-identifier $DBClusterSnapshotIdentifier --db-subnet-group-name default-vpc-123456 2>$ErrFile

Why could this happen? This used to work in the past

asked 2 years ago968 views

3 Answers
0
Accepted Answer

The issue you're experiencing with the RDS Aurora MySQL DB snapshot endpoints being stuck in the "creating" state is likely due to an incomplete restoration process. When restoring a DB cluster from a snapshot using the AWS CLI or API, it's important to note that this process only creates the DB cluster itself, not the primary DB instance within that cluster.

To resolve this issue and complete the restoration process, you need to explicitly create the primary DB instance for your DB cluster after the cluster has been restored from the snapshot. The DB cluster endpoints will remain in the "creating" status until you create this primary instance.

To create the primary instance, you should use the CreateDBInstance API operation or the equivalent AWS CLI command. You'll need to include the name of the DB cluster as the DBClusterIdentifier parameter when creating this instance.

Here's an example of how you might do this using the AWS CLI:

aws rds create-db-instance --db-instance-identifier [your-instance-name] --db-cluster-identifier abcsqlbackup --engine aurora-mysql --db-instance-class [your-instance-class]

Replace [your-instance-name] with a name for your primary instance and [your-instance-class] with an appropriate instance class.

Once you create this primary instance, the DB cluster endpoints should transition from the "creating" state to "available" as the restoration process completes.

This behavior is by design in Amazon RDS to allow for more flexibility in configuring the primary instance separately from the cluster restoration. In the future, to avoid this issue, you may want to consider using the AWS Management Console for restoration, as it automatically creates the primary DB instance along with the cluster.
Sources
Restoring from a DB cluster snapshot - Amazon Aurora

answered 2 years ago

0

Hello.

As described in the document below, if a long-running query is being executed in the source database when a snapshot is created, it may take a long time to restore it.
https://repost.aws/knowledge-center/aurora-mysql-slow-snapshot-restore

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • This was not it, explained below. Thank you regardless.

0

The re:Post Agent was right. It's described here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-restore-snapshot.html#aurora-restore-snapshot.Restoring

Under CLI, you find the "Important" information, which exactly describes the issue here:

Important
If you use the console to restore a DB cluster, then Amazon RDS automatically creates the primary DB instance (writer) for your DB cluster. If you use the AWS CLI to restore 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. If you don't create the primary DB instance, the DB cluster endpoints remain in the creating status.

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.

So the solution is that after creating the cluster on the CLI, you also need to create the DB instance separately

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.