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

Adding Nodes to a Cluster

Adding nodes to a cluster currently applies only if you are running Memcached or Redis (cluster mode disabled). If you are running Redis (cluster mode disabled), the nodes you add to the cluster are replica nodes.

You can use the ElastiCache Management Console, the AWS CLI or ElastiCache API to add nodes to your cluster.

Each time you change the number of nodes in your Memcached cluster, you must re-map at least some of your keyspace so it maps to the correct node. For more detailed information on load balancing your Memcached cluster, see Configuring Your ElastiCache Client for Efficient Load Balancing.

Adding Nodes to a Cluster (Console)

The process to add a node to a Memcached or Redis (cluster mode disabled) cluster with replication enabled is the same. If you want to add a node to a single-node Redis (cluster mode disabled) cluster (one without replication enabled), it's a two-step process: first add replication, and then add a replica node.

The following procedure adds replication to a single-node Redis that does not have replication enabled. When you add replication, the existing node becomes the primary node in the replication-enabled cluster. After replication is added, you can add up to 5 replica nodes to the cluster.

To add replication to a Redis cluster with no shards

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

  2. From the left navigation pane, choose Redis.

    A list of clusters running the Redis engine is displayed.

  3. Choose the name of a cluster that you want to add to.

    The following is true of a Redis cluster that does not have replication enabled:

  4. Choose Add replication.

  5. In Add Replication, type a description for this replication-enabled cluster.

  6. Choose Add.

    As soon as the cluster's status returns to available you can continue at the next procedure and add replicas to the cluster.

To add nodes to a Memcached or Redis (cluster mode disabled) cluster with one shard (console)

The following procedure can be used to add nodes to a Memcached cluster or Redis (cluster mode disabled) cluster which has replication enabled. Currently you cannot add or remove nodes from a Redis (cluster mode enabled) cluster.

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

  2. In the left navigation pane, choose Memcached or Redis.

    A list of clusters running the selected engine appears.

  3. From the list of clusters, choose the name of the cluster you want to add a node to. This cannot be a cluster running the Clustered Redis engine or a Redis cluster with zero shards.

    A list of the cluster's nodes appears and the Add node button becomes active.

  4. Choose Add node at the top of the page.

  5. In Add Node, complete the information requested in the Add Node (Memcached) or Add Read Replica to Cluster (Redis) dialog box.

  6. Choose the Apply Immediately - Yes button to apply this change immediately, or choose No to postpone the change until your next maintenance window.

    Impact of New Add and Remove Requests on Pending Requests

    Scenarios Pending Operation New Request Results

    Scenario 1

    Delete

    Delete

    The new delete request, pending or immediate, replaces the pending delete request.

    For example, if nodes 0001, 0003, and 0007 are pending deletion and a new request to delete nodes 0002 and 0004 is issued, only nodes 0002 and 0004 will be deleted. Nodes 0001, 0003, and 0007 will not be deleted.

    Scenario 2

    Delete

    Create

    The new create request, pending or immediate, replaces the pending delete request.

    For example, if nodes 0001, 0003, and 0007 are pending deletion and a new request to create a node is issued, a new node will be created and nodes 0001, 0003, and 0007 will not be deleted.

    Scenario 3

    Create

    Delete

    The new delete request, pending or immediate, replaces the pending create request.

    For example, if there is a pending request to create two nodes and a new request is issued to delete node 0003, no new nodes will be created and node 0003 will be deleted.

    Scenario 4

    Create

    Create

    The new create request is added to the pending create request.

    For example, if there is a pending request to create two nodes and a new request is issued to create three nodes, the new requests is added to the pending request and five nodes will be created.

    Important

    Apply Immediately - YesApply Immediately - No

    To determine what operations are pending, choose the Description tab and check to see how many pending creations or deletions are shown. You cannot have both pending creations and pending deletions.

    
	   Image: Cluster description tab
  7. Choose the Add button.

    After a few moments, the new nodes should appear in the nodes list with a status of creating. If they don't appear, refresh your browser page.

Adding Nodes to a Cache Cluster (AWS CLI)

If you want to add nodes to an existing Redis (cluster mode disabled) replication group (console: Cluster) that does not have replication enabled, you must first create the replication group specifying the existing cluster as the primary. For more information, see Creating a Replication Group Using an Available Redis Cache Cluster (AWS CLI). After the replication group is available, you can continue with the following process.

To add nodes to a cluster using the AWS CLI, use the AWS CLI operation modify-cache-cluster with the following parameters:

  • --cache-cluster-id The ID of the cache cluster you want to add nodes to.

  • --num-cache-nodes The --num-cache-nodes parameter specifies the number of nodes you want in this cluster after the modification is applied. To add nodes to this cluster, --num-cache-nodes must be greater than the current number of nodes in this cluster. If this value is less than the current number of nodes, ElastiCache expects the parameter cache-node-ids-to-remove and a list of nodes to remove from the cluster. For more information, see Removing Nodes from a Cluster (AWS CLI).

  • --apply-immediately or --no-apply-immediately which specifies whether to add these nodes immediately or at the next maintenance window.

For Linux, macOS, or Unix:

Copy
aws elasticache modify-cache-cluster \ --cache-cluster-id my-cache-cluster \ --num-cache-nodes 5 \ --apply-immediately

For Windows:

Copy
aws elasticache modify-cache-cluster ^ --cache-cluster-id my-cache-cluster ^ --num-cache-nodes 5 ^ --apply-immediately

This operation produces output similar to the following (JSON format):

Copy
{ "CacheCluster": { "Engine": "memcached", "CacheParameterGroup": { "CacheNodeIdsToReboot": [], "CacheParameterGroupName": "default.memcached1.4", "ParameterApplyStatus": "in-sync" }, "CacheClusterId": "my-cache-cluster", "PreferredAvailabilityZone": "us-west-2b", "ConfigurationEndpoint": { "Port": 11211, "Address": "rlh-mem000.7alc7bf-example.cfg.usw2.cache.amazonaws.com" }, "CacheSecurityGroups": [], "CacheClusterCreateTime": "2016-09-21T16:28:28.973Z", "AutoMinorVersionUpgrade": true, "CacheClusterStatus": "modifying", "NumCacheNodes": 2, "ClientDownloadLandingPage": "https://console.aws.amazon.com/elasticache/home#client-download:", "SecurityGroups": [ { "Status": "active", "SecurityGroupId": "sg-dbe93fa2" } ], "CacheSubnetGroupName": "default", "EngineVersion": "1.4.24", "PendingModifiedValues": { "NumCacheNodes": 5 }, "PreferredMaintenanceWindow": "sat:09:00-sat:10:00", "CacheNodeType": "cache.m3.medium" } }

For more information, see the AWS CLI topic modify-cache-cluster.

Adding Nodes to a Cache Cluster (ElastiCache API)

If you want to add nodes to an existing Redis (cluster mode disabled) replication group (console: Cluster) that does not have replication enabled, you must first create the replication group specifying the existing cluster as the Primary. For more information, see Creating a Replication Group Using an Available Redis Cache Cluster (ElastiCache API). After the replication group is available, you can continue with the following process.

To add nodes to a cluster (ElastiCache API)

  • Call the ModifyCacheCluster API operation with the following parameters:

    • CacheClusterId The ID of the cluster you want to add nodes to.

    • NumCacheNodes The NumCachNodes parameter specifies the number of nodes you want in this cluster after the modification is applied. To add nodes to this cluster, NumCacheNodes must be greater than the current number of nodes in this cluster. If this value is less than the current number of nodes, ElastiCache expects the parameter CacheNodeIdsToRemove with a list of nodes to remove from the cluster (see Removing Nodes from a Cluster (ElastiCache API)).

    • ApplyImmediately Specifies whether to add these nodes immediately or at the next maintenance window.

    The following example shows a call to add nodes to a cluster.

    Copy
    https://elasticache.us-west-2.amazonaws.com/ ?Action=ModifyCacheCluster &ApplyImmediately=true &NumCacheNodes=5 &CacheClusterId=myCacheCluster &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, see ElastiCache API topic ModifyCacheCluster.