Memorystore for Redis Cluster supports a subset of the [Redis configuration parameters](https://redis.io/topics/config) that you can modify to customize the behavior of your cluster.

Configuration changes don't require you to restart the cluster, and they don't
interrupt the service. Memorystore for Redis Cluster saves your changes immediately.
If the cluster restarts, then the cluster retains your configuration changes.
After creating a cluster, you can update the modifiable configuration
parameters. For more information, see [Supported cluster configurations](https://docs.cloud.google.com/memorystore/docs/cluster/supported-instance-configurations.md.txt).

## Before you begin

Make sure that you install the latest version of the Google Cloud CLI. To update
an existing installation, use the [`gcloud components update`](https://docs.cloud.google.com/sdk/gcloud/reference/components/update)
command.

## View configuration parameters

To view configuration parameters, use the
[`gcloud redis clusters describe`](https://docs.cloud.google.com/sdk/gcloud/reference/redis/clusters/describe)
command.

```
gcloud redis clusters describe CLUSTER_ID --region=REGION_ID
```

Make the following replacements:

- <var translate="no">CLUSTER_ID</var>: the ID of the cluster
- <var translate="no">REGION_ID</var>: the region where the cluster is located

For example:

```
gcloud redis clusters describe my-cluster --region=us-central1
```

If you don't change any configuration parameters from their default values, then
the parameters don't appear in the output.

## Set a configuration parameter when you create a cluster

To set a configuration parameter when you create a cluster, use the  

[`gcloud redis clusters create`](https://docs.cloud.google.com/sdk/gcloud/reference/redis/clusters/create.md.txt)
command with the `--redis-config` flag.

```
gcloud redis clusters create CLUSTER_ID \
--region=REGION_ID \
--project=PROJECT_ID \
--network=NETWORK \
--node-type=NODE_TYPE \
--shard-count=SHARD_COUNT \
--redis-config=CONFIG_NAME=CONFIG_VALUE
```

Make the following replacements:

- <var translate="no">CLUSTER_ID</var>: the ID of the cluster that you're creating.
- <var translate="no">REGION_ID</var>: the region where you want the cluster to be located.
- <var translate="no">PROJECT_ID</var>: your project ID.
- <var translate="no">NETWORK</var>: the name or fully qualified path of the Virtual Private Cloud (VPC) network to which the cluster connects.
- <var translate="no">NODE_TYPE</var>: the [node type](https://docs.cloud.google.com/memorystore/docs/cluster/cluster-node-specification.md.txt#choose_a_node_type) for the cluster.

  > [!CAUTION]
  > **Caution** : We recommend that you use the `redis-shared-core-nano` node type only for development or testing purposes because this node type has no SLA. If you run Memorystore for Redis Cluster in a production environment, then we recommend using another node type.

- <var translate="no">SHARD_COUNT</var>: the number of shards in your cluster. The shard count
  determines the total memory capacity for storing cluster data.

- <var translate="no">CONFIG_NAME</var>: the name of the configuration parameter that you want
  to set.

- <var translate="no">CONFIG_VALUE</var>: the value of the parameter that you're setting.

For example:

```
gcloud redis clusters create my-cluster --region=us-east1 --project=my-project --network=projects/my-project/global/networks/default --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 cluster, use the  

[`gcloud redis clusters update`](https://docs.cloud.google.com/sdk/gcloud/reference/redis/clusters/update.md.txt)
command with the `--update-redis-config` flag.

```
gcloud redis clusters update CLUSTER_ID \
--region=REGION_ID \
--project=PROJECT_ID \
--update-redis-config=CONFIG_NAME=CONFIG_VALUE
```

Make the following replacements:

- <var translate="no">CLUSTER_ID</var>: the ID of the cluster
- <var translate="no">REGION_ID</var>: the region where the cluster is located
- <var translate="no">PROJECT_ID</var>: your project ID
- <var translate="no">CONFIG_NAME</var>: the name of the configuration parameter that you want to update
- <var translate="no">CONFIG_VALUE</var>: the new value of the parameter

For example:

```
gcloud redis clusters update my-cluster --region=us-east1 --project=my-project --update-redis-config=maxmemory-policy=allkeys-lru
```

For more information about which configuration parameters you can update, see
[Modifiable configuration parameters](https://docs.cloud.google.com/memorystore/docs/cluster/supported-instance-configurations.md.txt#modifiable_configuration_parameters).

## Reset a configuration parameter

To reset a configuration parameter to its default value, use the  

[`gcloud redis clusters update`](https://docs.cloud.google.com/sdk/gcloud/reference/redis/clusters/update.md.txt)
command with the `--remove-redis-config` flag.

```
gcloud redis clusters update CLUSTER_ID \
--region=REGION_ID \
--project=PROJECT_ID \
--remove-redis-config=CONFIG_NAME
```

Make the following replacements:

- <var translate="no">CLUSTER_ID</var>: the ID of the cluster
- <var translate="no">REGION_ID</var>: the region where the cluster is located
- <var translate="no">PROJECT_ID</var>: your project ID
- <var translate="no">CONFIG_NAME</var>: the name of the configuration parameter that you want to reset to its default value

For example:

```
gcloud redis clusters update my-cluster --region=us-east1 --project=my-project --remove-redis-config=maxmemory-policy
```