Configure an instance

Memorystore for Redis Cluster supports a subset of the native Redis configuration parameters that you can modify to customize the behavior of your instance.

Configuration changes don't require a restart of the instance, and are saved if the instance restarts. You can update the modifiable configuration parameters after creating an instance.

For more information about the modifiable configuration parameters, see Supported instance configurations.

Before you begin

Ensure that you have installed the latest version of the Google Cloud CLI by running gcloud components update.

View configuration parameters

To view configuration parameters using the Google Cloud CLI, run the gcloud redis clusters describe command replacing variables with appropriate values.

You can't see configuration parameters when running the gcloud redis clusters describe command unless you have changed a configuration parameter from its default value.

gcloud redis clusters describe instance-id --region=region-id

Example:

gcloud redis clusters describe my-instance --region=us-central1

Set a configuration parameter during cluster creation

To set a configuration parameter while creating a cluster, run the gcloud redis clusters create command with --redis-config flag replacing variables with appropriate values.

gcloud redis clusters create instance-id \
--region=region-id \
--project=project-id \
--node-type=node-type \
--shard-count=shard-count \
--redis-config=config-name=config-value \

Replace the following:

  • instance-id is the ID of the Memorystore for Redis Cluster instance you're creating.
  • region-id is the region where you want the instance placed.
  • project-id is your project ID.
  • node-type is your chosen node type. Accepted values are:

    • redis-shared-core-nano
    • redis-standard-small
    • redis-highmem-medium
    • redis-highmem-xlarge

    For more details on node types and cluster configurations, see Cluster and node specification.

  • shard-count determines the number of shards in your instance. Shard count determines the total memory capacity for storing cluster data. To see more details about cluster specification, see Cluster and node specification.

  • config-name is the configuration parameter to modify.

  • config-value is your chosen setting corresponding to the parameter you're configuring.

For example:

gcloud redis clusters create foo --region=us-east1 --project=test-proj --node-type=redis-highmem-medium --shard-count=3 --redis-config=maxmemory-policy=allkeys-lru

Update a configuration parameter

To update a configuration parameter for an existing instance, run the gcloud redis clusters update command with the --update-redis-config flag replacing variables with appropriate values.

gcloud redis clusters update instance-id \
--region=region-id \
--project=project-id \
--update-redis-config=config-name=config-value

Example:

gcloud redis clusters update foo --region=us-east1 --project=test-proj --update-redis-config=maxmemory-policy=allkeys-lru

Reset a configuration parameter

To reset a configuration parameter to its default value, run the gcloud redis clusters update command with the --remove-redis-config flag replacing variables with appropriate values.

gcloud redis clusters update instance-id \
--region=region-id \
--project=project-id \
--remove-redis-config=config-name

Example:

gcloud redis clusters update foo --region=us-east1 --project=test-proj --remove-redis-config=maxmemory-policy