Menu
Amazon ElastiCache
User Guide (API Version 2015-02-02)

Promoting a Read-Replica to Primary

Important

Currently, ElastiCache does not support promoting a read replica to primary for a Redis (cluster mode enabled) replication group.

You can promote a read replica to primary using the ElastiCache console, the AWS CLI, or the ElastiCache API. However, you cannot promote a read replica to primary while Multi-AZ is enabled on the replication group. If Multi-AZ is enabled you must:

To promote a read replica node to primary

  1. Modify the replication group to disable Multi-AZ (this does not require that all your clusters be in the same Availability Zone).

    For information on modifying a replication group's settings, see Modifying a Cluster with Replicas.

  2. Promote the read replica to primary.

  3. Modify the replication group to re-enable Multi-AZ.

Multi-AZ with automatic failover is not available on replication groups running Redis 2.6.13.

Promoting a Read-Replica to Primary (Console)

To promote a read replica to primary (console)

  1. If the replica you want to promote is a member of a Redis (cluster mode disabled) cluster with replicas where Multi-AZ is enabled, modify the cluster to disable Multi-AZ before you proceed (this does not require that all your clusters be in the same Availability Zone). For more information on modifying a cluster, see Modifying a Cluster (Console).

  2. Sign in to the AWS Management Console and open the ElastiCache console at https://console.aws.amazon.com/elasticache/.

  3. Choose Redis.

    A list of clusters running Redis appears.

  4. From the list of clusters, choose the name of the cluster you wish to modify. This cluster must be running the "Redis" engine, not the "Clusterd Redis" engine, and it must have 2 or more nodes.

    A list of the cluster's nodes appears.

  5. Choose the box to the left of the name of the replica node you want to promote to Primary.

    Choose Promote.

  6. In the Promote Read Replica dialog box:

    1. Choose Yes to promote the read replica immediately, or No to promote it at the cluster's next maintenance window.

    2. Choose Promote to promote the read replica or Cancel to cancel the operation.

  7. If the cluster had Multi-AZ enabled before you began the promotion process, modify the cluster to re-enable Multi-AZ. For more information about modifying a cluster, see Modifying a Cluster (Console)

Promoting a Read-Replica to Primary (AWS CLI)

You cannot promote a read replica to primary if the replication group is Multi-AZ enabled. If the replica you want to promote is a member of a replication group where Multi-AZ is enabled, you must modify the replication group to disable Multi-AZ before you proceed (this does not require that all your clusters be in the same Availability Zone). For more information on modifying a replication group, see Modifying a Replication Group (AWS CLI).

The following AWS CLI command modifies the replication group my-repl-group, making the read replica my-replica-1 the primary in the replication group.

For Linux, macOS, or Unix:

Copy
aws elasticache modify-replication-group \ --replication-group-id my-repl-group \ --primary-cluster-id my-replica-1

For Windows:

Copy
aws elasticache modify-replication-group ^ --replication-group-id my-repl-group ^ --primary-cluster-id my-replica-1

For more information on modifying a replication group, see the AWS CLI topic modify-replication-group.

Promoting a Read-Replica to Primary (ElastiCache API)

You cannot promote a read replica to primary if the replication group is Multi-AZ enabled. If the replica you want to promote is a member of a replication group where Multi-AZ is enabled, you must modify the replication group to disable Multi-AZ before you proceed (this does not require that all your clusters be in the same Availability Zone). For more information on modifying a replication group, see Modifying a Replication Group (ElastiCache API).

The following ElastiCache API action modifies the replication group myReplGroup, making the read replica myReplica-1 the primary in the replication group.

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=ModifyReplicationGroup &ReplicationGroupId=myReplGroup &PrimaryClusterId=myReplica-1 &Version=2014-12-01 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20141201T220302Z &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Date=20141201T220302Z &X-Amz-SignedHeaders=Host &X-Amz-Expires=20141201T220302Z &X-Amz-Credential=<credential> &X-Amz-Signature=<signature>

For more information on modifying a replication group, see the ElastiCache API topic ModifyReplicationGroup.