FailoverDBCluster
Forces a failover for a DB cluster.
A failover for a DB cluster promotes one of the Aurora Replicas (read-only instances) in the DB cluster to be the primary instance (the cluster writer).
Amazon Aurora will automatically fail over to an Aurora Replica, if one exists, when the primary instance fails. You can force a failover when you want to simulate a failure of a primary instance for testing. Because each instance in a DB cluster has its own endpoint address, you will need to clean up and re-establish any existing connections that use those endpoint addresses when the failover is complete.
For more information on Amazon Aurora, see Aurora on Amazon RDS in the Amazon RDS User Guide.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- DBClusterIdentifier
-
A DB cluster identifier to force a failover for. This parameter is not case-sensitive.
Constraints:
-
Must match the identifier of an existing DBCluster.
Type: String
Required: No
-
- TargetDBInstanceIdentifier
-
The name of the instance to promote to the primary instance.
You must specify the instance identifier for an Aurora Replica in the DB cluster. For example,
mydbcluster-replica1
.Type: String
Required: No
Response Elements
The following element is returned by the service.
- DBCluster
-
Contains the details of an Amazon RDS DB cluster.
This data type is used as a response element in the DescribeDBClusters action.
Type: DBCluster object
Errors
For information about the errors that are common to all actions, see Common Errors.
- DBClusterNotFoundFault
-
DBClusterIdentifier does not refer to an existing DB cluster.
HTTP Status Code: 404
- InvalidDBClusterStateFault
-
The DB cluster is not in a valid state.
HTTP Status Code: 400
- InvalidDBInstanceState
-
The specified DB instance is not in the available state.
HTTP Status Code: 400
Example
Sample Request
https://rds.us-east-1.amazonaws.com/ ?Action=FailoverDBCluster &DBClusterIdentifier=sample-cluster &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20150323/us-east-1/rds/aws4_request &X-Amz-Date=20150323T170232Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=9be705fa28a68244d5072722463a29a322f9ef8eb58a63c40a6f6547174dec44
Sample Response
<FailoverDBClusterResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/"> <FailoverDBClusterResult> <DBCluster> <Port>3306</Port> <LatestRestorableTime>2015-03-23T17:00:54.893Z</LatestRestorableTime> <Engine>aurora</Engine> <Status>available</Status> <BackupRetentionPeriod>7</BackupRetentionPeriod> <VpcSecurityGroups> <VpcSecurityGroupMembership> <Status>active</Status> <VpcSecurityGroupId>sg-922dc2fd</VpcSecurityGroupId> </VpcSecurityGroupMembership> </VpcSecurityGroups> <DBSubnetGroup>sample-group</DBSubnetGroup> <EngineVersion>5.6.10a</EngineVersion> <Endpoint>sample-cluster.cluster-c1axbpgwvdfo.us-east-1.rds.amazonaws.com</Endpoint> <DBClusterParameterGroup>default.aurora5.6</DBClusterParameterGroup> <DBClusterIdentifier>sample-cluster</DBClusterIdentifier> <PreferredBackupWindow>05:47-06:17</PreferredBackupWindow> <PreferredMaintenanceWindow>mon:10:16-mon:10:46</PreferredMaintenanceWindow> <EarliestRestorableTime>2015-03-04T23:08:59.159Z</EarliestRestorableTime> <DBClusterMembers> <DBClusterMember> <IsClusterWriter>false</IsClusterWriter> <DBInstanceIdentifier>sample-replica1</DBInstanceIdentifier> <DBClusterParameterGroupStatus>in-sync</DBClusterParameterGroupStatus> </DBClusterMember> <DBClusterMember> <IsClusterWriter>true</IsClusterWriter> <DBInstanceIdentifier>sample-primary</DBInstanceIdentifier> <DBClusterParameterGroupStatus>in-sync</DBClusterParameterGroupStatus> </DBClusterMember> </DBClusterMembers> <AllocatedStorage>1</AllocatedStorage> <MasterUsername>awsuser</MasterUsername> </DBCluster> </FailoverDBClusterResult> <ResponseMetadata> <RequestId>659c3dba-d17e-11e4-9fd0-35e9d88e2515</RequestId> </ResponseMetadata> </FailoverDBClusterResponse>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: