This page describes how to scale a cluster in Memorystore for Redis Cluster. Your cluster's capacity is determined by the number of shards in your cluster and your cluster's node type. To scale your cluster, you must change the shard count or node type. For more information about a cluster's behavior during scaling, see About scaling cluster capacity.
Scale the shard count
You can increase or decrease the number of shards for a cluster by using either the Google Cloud console or Google Cloud CLI.
Console
In the Google Cloud console, go to the Memorystore for Redis Cluster page.
Click your cluster ID.
In the Configurations section, click the pencil icon next to Shards.
In the Shards field, enter the number of shards to which you want to scale your cluster.
Click Update cluster.
gcloud
To scale the number of shards for a cluster, use the
gcloud redis clusters update
command:
gcloud redis clusters update CLUSTER_ID \ --region=REGION_ID \ --shard-count=SHARD_COUNT
Replace the following:
- CLUSTER_ID: the ID of your cluster.
- REGION_ID: the region where your cluster is located.
- SHARD_COUNT: the number of shards in your cluster. The shard count determines the total memory capacity for storing cluster data. For more information about cluster and node specifications for clusters, see Cluster and node specification.
For example:
gcloud redis clusters update my-cluster \ --region=us-central1 \ --shard-count=8
Scale the node type
You can scale the node type for a cluster by using the Google Cloud CLI.
gcloud
To retrieve information about a cluster, use the
gcloud redis clusters describecommand:gcloud redis clusters describe CLUSTER_ID \ --region=REGION_ID
Replace the following:
- CLUSTER_ID: the ID of your cluster
- REGION_ID: the region where your cluster is located (for
example,
us-central1)
Check the output to see if the following conditions exist:
The output contains a
redisConfigssection.The
maxmemory-clients,maxmemory, ormaxclientsparameters appear in this section.
If any of these parameters appear, then when you scale the node type for the cluster, you must scale the values for the parameters to reflect values that Memorystore for Redis Cluster can accept for the scaled node type. For more information, see Modifiable configuration parameters.
To scale the node type, use the
gcloud redis clusters updatecommand:gcloud redis clusters update CLUSTER_ID \ --region=REGION_ID \ --node-type=NODE_TYPE
Replace the following:
- CLUSTER_ID: the ID of your cluster
- REGION_ID: the region where your cluster is located
NODE_TYPE: the node type to which you want to scale your cluster
For this example, you scale the node type of the
my-clustercluster toredis-highmem-medium. This cluster is located in theus-central1region.gcloud redis clusters update my-cluster \ --region=us-central1 \ --node-type=redis-highmem-medium
For this example, you change the value of the
maxclientsparameter to15,000.gcloud redis clusters update my-cluster \ --region=us-central1 \ --node-type=redis-highmem-medium \ --update-redis-config=maxclients=15000