Updating Valkey™ cluster settings
After creating a cluster, you can:
-
Configure Valkey™ servers as described in the Valkey™ documentation
. For a list of supported settings, see the Valkey™ settings section and the API reference. -
Enable sharding in a non-sharded cluster.
-
Move a cluster to another folder.
Learn more about other cluster updates:
Changing the cluster name and description
- In the management console
, select the folder with the cluster you need. - Select Yandex Managed Service for Valkey™.
- Select the cluster you need.
- At the top of the page, click Edit.
- 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 name and description of a cluster:
-
View the 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 clusters.
-
In the Yandex Managed Service for Valkey™ 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 Yandex Managed Service for Valkey™ 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.
How do I change these limits?
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
}
}
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "name,description", "name": "<new_cluster_name>", "description": "<new_cluster_description>" }'
Where
updateMask
is the list of parameters to update as a single string, separated by commas.You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "name", "description" ] }, "name": "<new_cluster_name>", "description": "<new_cluster_description>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where
update_mask
is the list of parameters to update as an array ofpaths[]
strings.You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
Configuring the use of FQDNs instead of IP addresses
If the relevant setting is disabled (by default), Valkey™ uses IP addresses as host addresses. If this setting is enabled, it will replace the host's IP address with its FQDN. For more information about this setting and its uses, see Using FQDNs instead of IP addresses.
Note
Some clients do not support this setting and will fail to connect to the cluster hosts. Such clients expect an IP address and will produce errors if you provide an FQDN instead.
To enable or disable the use of FQDNs instead of IP addresses:
- In the management console
, select the folder with the cluster you need. - Select Yandex Managed Service for Valkey™.
- Select the cluster you need.
- At the top of the page, click Edit.
- Under Basic parameters, enable or disable Use FQDN instead of IP addresses.
- 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 enable or disable the use of FQDNs instead of IP addresses:
-
View the description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Provide the required setting value in the update cluster command:
yc managed-redis cluster update <cluster_name_or_ID> \ --announce-hostnames <using_FQDNs_instead_of_IP_addresses>
--announce-hostnames
: Enables or disables using FQDNs instead of IP addresses:true
orfalse
.You can get the cluster name and ID with a list of clusters in the folder.
To enable or disable the use of FQDNs instead of IP addresses:
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating clusters.
-
In the Yandex Managed Service for Valkey™ cluster description, change the
announce_hostnames
parameter value:resource "yandex_mdb_redis_cluster" "<cluster_name>" { name = "<cluster_name>" ... announce_hostnames = <using_FQDNs_instead_of_IP_addresses> ... }
announce_hostnames
: Enables or disables using FQDNs instead of IP addresses:true
orfalse
. -
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 Yandex Managed Service for Valkey™ 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.
How do I change these limits?
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
}
}
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "announceHostnames", "announceHostnames": <using_FQDNs_instead_of_IP_addresses> }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.Only one parameter is provided in this case.
-
announceHostnames
: Using FQDNs instead of IP addresses,true
orfalse
.Note
Some clients do not support this setting and will fail to connect to the cluster hosts. Such clients expect an IP address and will produce errors if you provide an FQDN instead.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "announce_hostnames" ] }, "announce_hostnames": <using_FQDNs_instead_of_IP_addresses> }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings.Only one parameter is provided in this case.
-
announce_hostnames
: Using FQDNs instead of IP addresses,true
orfalse
.{% include fqdn-option-compatibility-note %}.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Changing the host class
When changing the host class:
- Your single-host cluster will be unavailable for a few minutes with database connections terminated.
- In a non-sharded multiple-host cluster:
- The master will change. Its hosts will be stopped and updated one by one. Once stopped, a host will be unavailable for a few minutes.
- Using a special FQDN does not guarantee a stable database connection: user sessions may be terminated.
- In a sharded cluster:
- The master will change in each multiple-host shard.
- Hosts in each shard will be stopped and updated one at a time. The shard's stopped master host will be unavailable for a few minutes.
- Master host name resolution may not be available. If public access to the host is enabled, you can only connect using the host IP address.
We recommend changing the host class only when the cluster has no active workload.
-
In the management console
, select the folder with the cluster you need. -
Select Yandex Managed Service for Valkey™.
-
Select the cluster you need.
-
At the top of the page, click Edit.
-
Under Host class:
- Select a platform in the Platform field.
- Select the Type of the virtual machine the hosts will be deployed on:
high-memory
: Increased RAM per 1 vCPU.burstable
: Partial guaranteed share of vCPU. 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 do not 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 the description of the update cluster CLI command:
yc managed-redis cluster update --help
-
Request a list of available host classes (the
ZONE IDS
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>
Yandex Managed Service for Valkey™ 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 clusters.
-
In the Yandex Managed Service for Valkey™ 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 Yandex Managed Service for Valkey™ 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.
How do I change these limits?
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
}
}
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.resources.resourcePresetId", "configSpec": { "resources": { "resourcePresetId": "<host_class>" } } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.In this case, only one parameter is provided.
-
configSpec.resources.resourcePresetId
: New host class. To retrieve a list of supported values, use the ResourcePreset.List method.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.resources.resource_preset_id" ] }, "config_spec": { "resources": { "resource_preset_id": "<host_class>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings.Only one parameter is provided in this case.
-
config_spec.resources.resource_preset_id
: New host class. To retrieve a list of supported values, use the ResourcePreset.List method.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
The Yandex Managed Service for Valkey™ cluster is unavailable for about five to seven minutes after changing the host class.
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 Yandex Managed Service for Valkey™.
- Select the cluster you need.
- At the top of the page, click Edit.
- 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 Valkey™ hosts:
-
View the 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_in_GB>
If all the criteria are met, Yandex Managed Service for Valkey™ starts increasing the size of the Valkey™ 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 clusters.
-
In the Yandex Managed Service for Valkey™ cluster description, change the
disk_size
parameter value underresources
:resource "yandex_mdb_redis_cluster" "<cluster_name>" { ... resources { disk_size = <storage_size_in_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 Yandex Managed Service for Valkey™ 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.
How do I change these limits?
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
}
}
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.resources.diskSize", "configSpec": { "resources": { "diskSize": "<storage_size_in_bytes>" } } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.Only one parameter is provided in this case.
-
configSpec.resources.diskSize
: New disk size in bytes.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.resources.disk_size" ] }, "config_spec": { "resources": { "disk_size": "<storage_size_in_bytes>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings.Only one parameter is provided in this case.
-
config_spec.resources.disk_size
: New disk size in bytes.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Changing Valkey™ settings
You can change the DBMS settings of the hosts in your cluster. All supported settings are described in the Valkey™ settings section 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 Yandex Managed Service for Valkey™.
- Select the cluster you need.
- At the top of the page, click Edit.
- Under DBMS settings, click Settings.
- Configure the available parameters according to the Valkey™ 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 clusters.
-
In the Yandex Managed Service for Valkey™ cluster description, change the values of the parameters in the
config
block: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 if low on 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 Yandex Managed Service for Valkey™ 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.
How do I change these limits?
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
}
}
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.redisConfig_<Valkey™_version>.<setting_1>,configSpec.redisConfig_<Valkey™_version>.<setting_2>,...,configSpec.redisConfig_<Valkey™_version>.<setting_N>", "configSpec": { "redisConfig_<Valkey™_version>": { "<setting_1>": "<value_1>", "<setting_2>": "<value_2>", ... "<setting_N>": "<value_N>" } } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas. -
configSpec.redisConfig_<Valkey™>
_version: Valkey™ settings. Use a separate line for each setting; separate them by commas.See the method description for the list of Valkey™ versions available for the parameter. See Valkey™ settings for a description and possible values for each setting.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.redis_config_<Valkey™_version>.<setting_1>", "config_spec.redis_config_<Valkey™_version>.<setting_2>", ... "config_spec.redis_config_<Valkey™_version>.<setting_N>" ] }, "config_spec": { "redis_config_<Valkey™_version>": { "<setting_1>": "<value_1>", "<setting_2>": "<value_2>", ... "<setting_N>": "<value_N>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings. -
config_spec.redis_config_<Valkey™>
_version: Valkey™ settings. Use a separate line for each setting; separate them by commas.See the method description for the list of Valkey™ versions available for the parameter. See Valkey™ settings for a description and possible values for each setting.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Changing additional cluster settings
-
In the management console
, select the folder with the cluster you need. -
Select Yandex Managed Service for Valkey™.
-
Select the cluster you need.
-
At the top of the page, click Edit.
-
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 protection of the cluster, its databases, and users against accidental deletion.
Enabled deletion protection will not prevent a manual connection with the purpose to delete database contents.
-
-
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 the 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> \ --websql-access=<true_or_false> \ --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
: Maintenance window settings (including 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
.
-
--websql-access
: Enables SQL queries against cluster databases from the Yandex Cloud management console using Yandex WebSQL. The default value isfalse
. -
--deletion-protection
: Protection of the cluster, its databases, and users against accidental deletion.Enabled deletion protection will not prevent a manual connection with the purpose to delete database contents.
You can get the cluster name with a list of clusters in the folder.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.backupWindowStart,maintenanceWindow,deletionProtection", "configSpec": { "backupWindowStart": { "hours": "<hours>", "minutes": "<minutes>", "seconds": "<seconds>", "nanos": "<nanoseconds>" } }, "maintenanceWindow": { "weeklyMaintenanceWindow": { "day": "<day_of_week>", "hour": "<hour>" } }, "deletionProtection": <cluster_deletion_protection> }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas. -
configSpec.backupWindowStart
: Backup window settings.In this parameter, specify the backup start time:
hours
: Between0
and23
hours.minutes
: Between0
and59
minutes.seconds
: Between0
and59
seconds.nanos
: Between0
and999999999
nanoseconds.
-
maintenanceWindow
: Maintenance window settings (including for disabled clusters). Provide one of the two parameters:-
anytime
: Maintenance can take place at any time. -
weeklyMaintenanceWindow
: Maintenance takes place once a week at the specified time:day
: Day of week inDDD
format:MON
,TUE
,WED
,THU
,FRI
,SAT
, orSUN
.hour
: Hour of day (UTC) inHH
format, from1
to24
.
-
-
deletionProtection
: Cluster deletion protection,true
orfalse
.Enabled deletion protection will not prevent a manual connection with the purpose to delete database contents.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.backup_window_start", "maintenance_window", "deletion_protection" ] }, "config_spec": { "backup_window_start": { "hours": "<hours>", "minutes": "<minutes>", "seconds": "<seconds>", "nanos": "<nanoseconds>" } }, "maintenance_window": { "weekly_maintenance_window": { "day": "<day_of_week>", "hour": "<hour>" } }, "deletion_protection": <cluster_deletion_protection> }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings. -
config_spec.backup_window_start
: Backup window settings.In this parameter, specify the backup start time:
hours
: Between0
and23
hours.minutes
: Between0
and59
minutes.seconds
: Between0
and59
seconds.nanos
: Between0
and999999999
nanoseconds.
-
maintenance_window
: Maintenance window settings (including for disabled clusters). Provide one of the two parameters:-
anytime
: Maintenance can take place at any time. -
weekly_maintenance_window
: Maintenance takes place once a week at the specified time:day
: Day of week inDDD
format:MON
,TUE
,WED
,THU
,FRI
,SAT
, orSUN
.hour
: Hour of day (UTC) inHH
format, from1
to24
.
-
-
deletion_protection
: Cluster deletion protection,true
orfalse
.Enabled deletion protection will not prevent a manual connection with the purpose to delete database contents.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Enabling sharding
You can enable sharding in a non-sharded cluster to make it a sharded one.
Warning
You cannot disable sharding in a cluster where it is already enabled.
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 enable sharding:
-
View the description of the CLI command to enable sharding:
yc managed-redis cluster enable-sharding --help
-
Run this command:
yc managed-redis cluster enable-sharding <cluster_ID>
You can get the cluster ID with a list of clusters in the folder.
Once sharding is enabled, all the existing cluster hosts will be added to the single shard1
.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.EnableSharding method and make a request, e.g., via cURL
:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>:enable_sharding'
You can get the cluster ID with a list of clusters in the folder.
Once sharding is enabled, all the existing cluster hosts will be added to the single
shard1
. -
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.EnableSharding call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.EnableSharding
You can get the cluster ID with a list of clusters in the folder.
Once sharding is enabled, all the existing cluster hosts will be added to the single
shard1
. -
View the server response to make sure the request was successful.
Moving a cluster
- Go to the folder page and select Yandex Managed Service for Valkey™.
- 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 the 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.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Move method and make a request, e.g., via cURL
:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>:move' \ --data '{ "destinationFolderId": "<folder_ID>" }'
Where
destinationFolderId
is the ID of the folder to move the cluster to.You can get the cluster ID with a list of clusters in the folder and the folder ID with a list of folders in the cloud.
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Move call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "destination_folder_id": "<folder_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Move
Where
destination_folder_id
is the ID of the folder to move the cluster to.You can get the cluster ID with a list of clusters in the folder and the folder ID with a list of folders in the cloud.
-
View the server response to make sure the request was successful.
Changing security groups
- In the management console
, select the folder with the cluster you need. - Select Yandex Managed Service for Valkey™.
- Select the cluster you need.
- At the top of the page, click Edit.
- 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 the 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 clusters.
-
In the Yandex Managed Service for Valkey™ 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 Yandex Managed Service for Valkey™ 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.
How do I change these limits?
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
}
}
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "securityGroupIds", "securityGroupIds": [ "<security_group_1_ID>", "<security_group_2_ID>", ... "<security_group_N_ID>" ] }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.Only one parameter is provided in this case.
-
securityGroupIds
: Security group IDs.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "security_group_ids" ] }, "security_group_ids": [ "<security_group_1_ID>", "<security_group_2_ID>", ... "<security_group_N_ID>" ] }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings.Only one parameter is provided in this case.
-
security_group_ids
: Security group IDs.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
Warning
You may need to additionally set up security groups to connect to the cluster.