Changing Redis cluster settings
After creating a cluster, you can:
-
Configure Redis servers as described in the Redis documentation
. For a list of supported settings, see Redis settings and the API reference. -
Move a cluster to another folder.
Learn more about other cluster updates:
Change the cluster name and description
- In the management console
, select the folder with the cluster you need. - Select Managed Service for Redis.
- Select the cluster you need.
- At the top of the page, click Edit cluster.
- Under Basic parameters, enter a new name and description for the cluster.
- Click Save changes.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change the host class for the cluster:
-
View a description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Specify a new name and description in the cluster update command:
yc managed-redis cluster update <cluster_name_or_ID> \ --new-name <new_cluster_name> \ --description <new_cluster_description>
Alert
Do not change the cluster name using Terraform. This will delete the existing cluster and create a new one.
To update the cluster description:
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating a Redis cluster.
-
In the Managed Service for Redis cluster description, change the
description
parameter value:resource "yandex_mdb_redis_cluster" "<cluster_name>" { name = "<cluster_name>" description = "<new_cluster_description>" ... }
-
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
For more information, see the Terraform provider documentation
Time limits
A Terraform provider sets the timeout for Managed Service for Redis cluster operations:
- Creating a cluster, including by restoring one from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
Add the timeouts
block to the cluster description, for example:
resource "yandex_mdb_redis_cluster" "<cluster_name>" {
...
timeouts {
create = "1h30m" # 1 hour 30 minutes
update = "2h" # 2 hours
delete = "30m" # 30 minutes
}
}
To change a cluster's name and description, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - New cluster name in the
name
parameter. - New cluster description in the
description
parameter. - List of fields to update (in this case,
name
anddescription
) in theupdateMask
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing the host class
-
In the management console
, select the folder with the cluster you need. -
Select Managed Service for Redis.
-
Select the cluster you need.
-
At the top of the page, click Edit cluster.
-
Under Host class:
- Select a platform in the Platform field.
- Select the Type of virtual machine that hosts will be deployed on:
high-memory
: More RAM per 1 vCPU.burstable
: Only a guaranteed share of vCPU performance. VMs with a guaranteed share of less than 100% ensure the specified level of performance with a possible temporary performance increase up to 100%. Clusters with such hosts are good for tasks that don't require guaranteed permanent performance (for example, testing).
- Modify the host configuration.
-
Click Save changes.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change the host class for the cluster:
-
View a description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Request a list of available host classes (the
ZONES
column specifies the availability zones where you can select the appropriate class):yc managed-redis resource-preset list
Result:
+-------------+--------------------------------+----------+ | ID | ZONE IDS | MEMORY | +-------------+--------------------------------+----------+ | b1.nano | ru-central1-a, ru-central1-b, | 2.0 GB | | | ru-central1-d | | | b1.small | ru-central1-a, ru-central1-b, | 4.0 GB | | | ru-central1-d | | | hm1.nano | ru-central1-a, ru-central1-b, | 8.0 GB | | | ru-central1-d | | | hm1.micro | ru-central1-a, ru-central1-b, | 12.0 GB | | ... | +-----------+----------------------------------+----------+
-
Specify the class in the update cluster command:
yc managed-redis cluster update <cluster_name_or_ID> \ --resource-preset <host_class_ID>
Managed Service for Redis will run the update host class command for the cluster.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating a Redis cluster.
-
In the Managed Service for Redis cluster description, change the
resource_preset_id
parameter value underresources
:resource "yandex_mdb_redis_cluster" "<cluster_name>" { ... resources { resource_preset_id = "<host_class>" ... } }
-
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
For more information, see the Terraform provider documentation
Time limits
A Terraform provider sets the timeout for Managed Service for Redis cluster operations:
- Creating a cluster, including by restoring one from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
Add the timeouts
block to the cluster description, for example:
resource "yandex_mdb_redis_cluster" "<cluster_name>" {
...
timeouts {
create = "1h30m" # 1 hour 30 minutes
update = "2h" # 2 hours
delete = "30m" # 30 minutes
}
}
To change the host class, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
-
Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. -
New host class in the
configSpec.resources.resourcePresetId
parameter.To get a list of supported values, use the list REST API method for the ResourcePreset resource or the ResourcePresetService/List gRPC API call.
-
List of fields to update (in this case,
configSpec.resources.resourcePresetId
) in theupdateMask
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Increasing storage size
Make sure the cloud has enough quota to increase the storage size. Open the cloud's Quotas
To increase the cluster storage size:
- In the management console
, select the folder with the cluster you need. - Select Managed Service for Redis.
- Select the cluster you need.
- At the top of the page, click Edit cluster.
- Edit the settings in the Size of storage section.
- Click Save changes.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To increase storage size of Redis hosts:
-
View a description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Specify the required storage size in the update cluster command.It must be at least as large as the current
disk_size
value in the cluster properties.yc managed-redis cluster update <cluster_name_or_ID> \ --disk-size <storage_size_GB>
If all the criteria are met, Managed Service for Redis starts increasing the size of the Redis host disks.
To increase the cluster storage size:
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating a Redis cluster.
-
In the Managed Service for Redis cluster description, change the
disk_size
parameter value underresources
:resource "yandex_mdb_redis_cluster" "<cluster_name>" { ... resources { disk_size = <storage_size_GB> ... } }
-
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
For more information, see the Terraform provider documentation
Time limits
A Terraform provider sets the timeout for Managed Service for Redis cluster operations:
- Creating a cluster, including by restoring one from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
Add the timeouts
block to the cluster description, for example:
resource "yandex_mdb_redis_cluster" "<cluster_name>" {
...
timeouts {
create = "1h30m" # 1 hour 30 minutes
update = "2h" # 2 hours
delete = "30m" # 30 minutes
}
}
To increase the cluster storage size, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - New storage size in the
configSpec.resources.diskSize
parameter. - List of cluster configuration fields to update in the
updateMask
parameter (in this case,configSpec.resources.diskSize
).
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing Redis settings
You can change the DBMS settings of the hosts in your cluster. All supported settings are described in Redis settings and the API reference.
To update the DBMS settings for the cluster:
- In the management console
, select the folder with the cluster you need. - Select Managed Service for Redis.
- Select the cluster you need.
- At the top of the page, click Edit cluster.
- Under DBMS settings, click Settings.
- Configure the available parameters according to the Redis documentation
. - Click Save.
To update the DBMS settings for the cluster:
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating a Redis cluster.
-
In the Managed Service for Redis cluster description, change the values of the parameters under
config
:resource "yandex_mdb_redis_cluster" "<cluster_name>" { ... config { password = "<password>" timeout = <time> maxmemory_policy = "<policy>" ... } }
Where:
timeout
: Time, in seconds, before disabling inactive clients.maxmemory_policy
: Memory management policy when there is not enough memory.
The password must be between 8 and 128 characters long. The password must meet the
[a-zA-Z0-9@=+?*.,!&#$^<>_-]*
regular expression. -
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
For more information, see the Terraform provider documentation
Time limits
A Terraform provider sets the timeout for Managed Service for Redis cluster operations:
- Creating a cluster, including by restoring one from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
Add the timeouts
block to the cluster description, for example:
resource "yandex_mdb_redis_cluster" "<cluster_name>" {
...
timeouts {
create = "1h30m" # 1 hour 30 minutes
update = "2h" # 2 hours
delete = "30m" # 30 minutes
}
}
To change Redis settings, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - Required Redis setting values in the
configSpec.redisConfig_<Redis_version>
parameter. - List of cluster configuration fields to update in the
UpdateMask
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing additional cluster settings
-
In the management console
, select the folder with the cluster you need. -
Select Managed Service for Redis.
-
Select the cluster you need.
-
At the top of the page, click Edit cluster.
-
Change additional cluster settings:
-
Backup start time (UTC): UTC time when you want to start creating a cluster backup (in 24-hour format). If the time is not set, the backup will start at 22:00 UTC.
-
Maintenance window: Maintenance window settings:
- To enable maintenance at any time, select arbitrary (default).
- To specify the preferred maintenance start time, select by schedule and specify the desired day of the week and UTC hour. For example, you can choose a time when the cluster is least loaded.
Maintenance operations are carried out both on enabled and disabled clusters. They may include updating the DBMS, applying patches, and so on.
-
Deletion protection: Manages cluster protection from accidental deletion by a user.
Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
-
-
Click Save changes.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change additional cluster settings:
-
View a description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Run the following command with a list of settings to update:
yc managed-redis cluster update <cluster_name_or_ID> \ --backup-window-start <time> \ --maintenance-window type=<maintenance_type>,` `day=<day_of_week>,` `hour=<hour> \ --deletion-protection=<deletion_protection>
You can change the following settings:
--backup-window-start
: The cluster backup start time, set in UTC formatHH:MM:SS
. If the time is not set, the backup will start at 22:00 UTC.
-
--maintenance-window
: Settings for the maintenance window (including those for disabled clusters), wheretype
is the maintenance type:anytime
(default): Any time.weekly
: On a schedule. If setting this value, specify the day of week and the hour:day
: Day of week inDDD
format:MON
,TUE
,WED
,THU
,FRI
,SAT
, orSUN
.hour
: Hour (UTC) inHH
format:1
to24
.
-
--deletion-protection
: Cluster protection from accidental deletion by a user:true
orfalse
.Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
You can retrieve the cluster name with a list of clusters in the folder.
To change additional cluster settings, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
-
Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. -
Cluster deletion protection settings in the
deletionProtection
parameter.Cluster deletion protection will not prevent a manual connection to a cluster to delete data.
-
List of cluster configuration fields to be updated in the
updateMask
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Moving a cluster
- Go to the folder page and select Managed Service for Redis.
- Click
to the right of the cluster you want to move. - Select Move.
- Select a folder you want to move the cluster to.
- Click Move.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To move a cluster:
-
View a description of the CLI move cluster command:
yc managed-redis cluster move --help
-
Specify the destination folder in the move cluster command:
yc managed-redis cluster move <cluster_ID> \ --destination-folder-name=<destination_folder_name>
You can get the cluster ID with a list of clusters in the folder.
To move a cluster, use the move REST API method for the Cluster resource or the ClusterService/Move gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - ID of the destination folder in the
destinationFolderId
parameter.
Changing security groups
- In the management console
, select the folder with the cluster you need. - Select Managed Service for Redis.
- Select the cluster you need.
- At the top of the page, click Edit cluster.
- Under Network settings, select security groups for cluster network traffic.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To edit the list of security groups for your cluster:
-
View a description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Specify the security groups in the update cluster command:
yc managed-redis cluster update <cluster_name_or_ID> \ --security-group-ids <list_of_security_group_IDs>
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating a Redis cluster.
-
In the Managed Service for Redis cluster description, change the
security_group_ids
parameter value:resource "yandex_mdb_redis_cluster" "<cluster_name>" { ... security_group_ids = [<list_of_security_group_IDs>] }
-
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
For more information, see the Terraform provider documentation
Time limits
A Terraform provider sets the timeout for Managed Service for Redis cluster operations:
- Creating a cluster, including by restoring one from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
Add the timeouts
block to the cluster description, for example:
resource "yandex_mdb_redis_cluster" "<cluster_name>" {
...
timeouts {
create = "1h30m" # 1 hour 30 minutes
update = "2h" # 2 hours
delete = "30m" # 30 minutes
}
}
To update security groups, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - List of security group IDs in the
securityGroupIds
parameter. - List of settings to update (in this case,
securityGroupIds
) in theupdateMask
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Warning
You may need to additionally set up security groups to connect to the cluster.