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

Creating a Cluster with Replicas Using an Available Redis (cluster mode disabled) Cluster

An available cluster is an existing single-node Redis cluster. Currently, Redis (cluster mode enabled) does not support creating a cluster with replicas using an available single-node cluster. If you want to create a Redis (cluster mode enabled) cluster, see Creating a Redis (cluster mode enabled) Cluster with Replicas from Scratch (Console).

The following procedure can only be used if you have a Redis (cluster mode disabled) single-node cluster. This cluster becomes the primary in the new cluster. If you do not have a Redis (cluster mode disabled) cluster you can use as the new cluster's primary, see Creating a Redis Cluster with Replicas from Scratch.

Creating a Cluster with Replicas Using an Available Redis Cluster (Console)

See the topic Adding Nodes to a Cluster (Console).

Creating a Replication Group Using an Available Redis Cache Cluster (AWS CLI)

There are two steps to creating a replication group with read replicas when using an available Redis Cache Cluster for the primary when using the AWS CLI.

First, create the replication group specifying the available Redis cache cluster as the primary

To create a replication group when you already have an available Redis cache cluster, use the AWS CLI create-replication-group command, being sure to include the following parameters.

--replication-group-id

The name of the replication group you are creating.

Redis (cluster mode disabled) Replication Group naming constraints

  • Must contain from 1 to 20 alphanumeric characters or hyphens.

  • Must begin with a letter.

  • Cannot contain two consecutive hyphens.

  • Cannot end with a hyphen.

--replication-group-description

Description of the replication group.

--primary-cluster-id

The name of the available Redis cache cluster that will be the primary node in this replication group.

The following command creates the replication group my-repl-group using the available Redis cluster my-primary as the replication group's primary node. The settings of my-primary (that is, parameter group, security group, node type, etc.) will be applied to all nodes in the replication group.

For Linux, macOS, or Unix:

Copy
aws elasticache create-replication-group \ --replication-group-id my-repl-group \ --replication-group-description "test group" \ --primary-cluster-id my-primary

For Windows:

Copy
aws elasticache create-replication-group ^ --replication-group-id my-repl-group ^ --replication-group-description "test group" ^ --primary-cluster-id my-primary

For additional information and parameters you might want to use, see the AWS CLI topic create-replication-group.

Next, add read replicas to the replication group

After the replication group is created, add one to five read replicas to it using the create-cache-cluster command, being sure to include the following parameters.

--cache-cluster-id

The name of the cluster you are adding to the replication group.

Cluster naming constraints

  • Must contain from 1 to 20 alphanumeric characters or hyphens.

  • Must begin with a letter.

  • Cannot contain two consecutive hyphens.

  • Cannot end with a hyphen.

--replication-group-id

The name of the replication group to which you are adding this cache cluster.

Repeat this command for each read replica you want to add to the replication group, changing only the value of the --cache-cluster-id parameter.

Note

Remember, a replication group cannot have more than five read replicas. Attempting to add a read replica to a replication group that already has five read replicas causes the operation to fail.

The following code adds the read replica my-replica01 to the replication group my-repl-group. The settings of the primary cluster–parameter group, security group, node type, etc.–will be applied to nodes as they are added to the replication group.

For Linux, macOS, or Unix:

Copy
aws elasticache create-cache-cluster \ --cache-cluster-id my-replica01 \ --replication-group-id my-repl-group

For Windows:

Copy
aws elasticache create-cache-cluster ^ --cache-cluster-id my-replica01 ^ --replication-group-id my-repl-group

For additional information and parameters you might want to use, see the AWS CLI topic create-cache-cluster.

Creating a Replication Group Using an Available Redis Cache Cluster (ElastiCache API)

There are two steps to creating a replication group with read replicas when using an available Redis cluster for the primary.

First, create the replication group using the available Redis cluster as the primary cluster

To create a replication group when you already have an available Redis cluster, use the ElastiCache API CreateReplicationGroup operation, being sure to include the following parameters.

ReplicationGroupId

The name of the replication group you are creating.

Redis (cluster mode disabled) Replication Group naming constraints

  • Must contain from 1 to 20 alphanumeric characters or hyphens.

  • Must begin with a letter.

  • Cannot contain two consecutive hyphens.

  • Cannot end with a hyphen.

ReplicationGroupDescription

Your description of the replication group.

PrimaryClusterId

The name of the available Redis cluster that will be the primary cluster in this replication group.

The following operation creates the replication group myReplGroup using the available Redis cache cluster myPrimary as the replication group's primary cluster. The settings of myPrimary (parameter group, security group, node type, etc.) will be applied to all nodes in the replication group.

Line breaks are added for readability.

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateReplicationGroup &ReplicationGroupDescription=My%20replication%20group &ReplicationGroupId=myReplGroup &PrimaryClusterId=myPrimary &Version=2015-02-02 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>

For additional information and parameters you might want to use, see the ElastiCache API topic CreateReplicationGroup.

Next, add read replicas to the replication group

After the replication group is created, add one to five read replicas to it using the CreateCacheCluster operation, being sure to include the following parameters.

CacheClusterId

The name of the cluster you are adding to the replication group.

Cluster naming constraints

  • Must contain from 1 to 20 alphanumeric characters or hyphens.

  • Must begin with a letter.

  • Cannot contain two consecutive hyphens.

  • Cannot end with a hyphen.

ReplicationGroupId

The name of the replication group to which you are adding this cache cluster.

Repeat this operation for each read replica you want to add to the replication group, changing only the value of the CacheClusterId parameter.

The following code adds the read replica myReplica01 to the replication group myReplGroup The settings of the primary cluster–parameter group, security group, node type, etc.–will be applied to nodes as they are added to the replication group.

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateCacheCluster &CacheClusterId=myReplica01 &ReplicationGroupId=myReplGroup &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2015-02-02 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=[your-access-key-id]/20150202/us-west-2/elasticache/aws4_request &X-Amz-Date=20150202T170651Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=[signature-value]

For additional information and parameters you might want to use, see the ElastiCache API topic CreateCacheCluster.