Working with Valkey™ modules
In Yandex Managed Service for Valkey™, you can use modules (Valkey™ kernel extensions). Modules provide functionality to address modern-day needs through the use of high-load services and AI platforms: vector search, efficiently stored JSON data structures, and scalable probability filters.
You can connect modules to a new or existing cluster or reconfigure a module.
Connecting modules
Warning
You cannot disable modules once enabled.
-
In the management console
, select the folder containing your cluster. -
Navigate to the Yandex Managed Service for Valkey™ service.
-
Select the cluster.
-
At the top of the page, click Edit.
-
Under Modules, enable the required Valkey™ modules.
For the Search module, configure the following: Number of reader threads and Number of writer threads.
-
Click Save changes.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id options.
To connect modules:
-
View the description of the CLI command for updating a cluster:
yc managed-redis cluster update --help -
Run this command to connect modules:
yc managed-redis cluster update \ --cluster-name=<cluster_name> \ --valkey-modules enable-valkey-search=<enable_Valkey-Search_module>,` `valkey-search-reader-threads=<number_of_request_processing_threads>,` `valkey-search-writer-threads=<number_of_indexing_threads>,` `enable-valkey-json=<enable_Valkey-JSON_module>,` `enable-valkey-bloom=<enable_Valkey-Bloom_module>Where:
--cluster-name: Yandex Managed Service for Valkey™ cluster name. You can get it from the list of clusters in the folder.--valkey-modules: Valkey™ module parameters:enable-valkey-search: Enable theValkey-Searchmodule,trueorfalse.valkey-search-reader-threads: Number of request processing threads in theValkey-Searchmodule.valkey-search-writer-threads: Number of indexing threads in theValkey-Searchmodule.enable-valkey-json: Enable theValkey-JSONmodule,trueorfalse.enable-valkey-bloom: Enable theValkey-Bloommodule,trueorfalse.
-
Open the current Terraform configuration file describing your infrastructure.
For more on how to create this file, see Creating a cluster.
-
Add the
modulessection to the Yandex Managed Service for Valkey™ cluster description:resource "yandex_mdb_redis_cluster_v2" "<cluster_name>" { ... modules = { valkey_bloom = { enabled = <enable_Valkey-Bloom_module> } valkey_json = { enabled = <enable_Valkey-JSON_module> } valkey_search = { enabled = <enable_Valkey-Search_module> reader_threads = <number_of_request_processing_threads> writer_threads = <number_of_indexing_threads> } } }Where:
valkey_bloom.enabled: Enable theValkey-Bloommodule,trueorfalse.valkey_json.enabled: Enable theValkey-JSONmodule,trueorfalse.valkey_search.enabled: Enable theValkey-Searchmodule,trueorfalse.valkey_search.reader_threads: Number of request processing threads in theValkey-Searchmodule.valkey_search.writer_threads: Number of indexing threads in theValkey-Searchmodule.
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
For more information, see this Terraform provider guide.
Timeouts
The Terraform provider sets the following timeouts for Yandex Managed Service for Valkey™ cluster operations:
- Creating a cluster, including by restoring it from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the timeout are aborted.
How do I change these limits?
Add the timeouts section to your cluster description, such as the following:
resource "yandex_mdb_redis_cluster_v2" "<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 an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Update method, e.g., via the following cURL
request: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
updateMaskparameter 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.modules.valkeySearch.enabled,configSpec.modules.valkeySearch.readerThreads,configSpec.modules.valkeySearch.writerThreads,configSpec.valkeyJson.enabled,configSpec.valkeyBloom.enabled", "configSpec": { "modules": { "valkeySearch": { "enabled": "<enable_Valkey-Search_module>", "readerThreads": "<number_of_request_processing_threads>", "writerThreads": "<number_of_indexing_threads>" }, "valkeyJson": { "enabled": "<enable_Valkey-JSON_module>" }, "valkeyBloom": { "enabled": "<enable_Valkey-Bloom_module>" } } } }'Where:
-
updateMask: Comma-separated string of settings to update. -
configSpec.modules: Valkey™ module parameters:valkeySearch.enabled: Enable theValkey-Searchmodule,trueorfalse. What you can set up for the module:valkeySearch.readerThreads: Number of request processing threads.valkeySearch.writerThreads: Number of indexing threads.
valkeyJson.enabled: Enable theValkey-JSONmodule,trueorfalse.valkeyBloom.enabled: Enable theValkey-Bloommodule,trueorfalse.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and put it into an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.Update method, e.g., via the following gRPCurl
request: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_maskparameter 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.modules.valkey_search.enabled", "config_spec.modules.valkey_search.reader_threads", "config_spec.modules.valkey_search.writer_threads", "config_spec.valkey_json.enabled", "config_spec.valkey_bloom.enabled" ] }, "config_spec": { "modules": { "valkey_search": { "enabled": "<enable_Valkey-Search_module>", "reader_threads": "<number_of_request_processing_threads>", "writer_threads": "<number_of_indexing_threads>" }, "valkey_json": { "enabled": "<enable_Valkey-JSON_module>" }, "valkey_bloom": { "enabled": "<enable_Valkey-Bloom_module>" } } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.UpdateWhere:
-
update_mask: List of settings to update as an array of strings (paths[]). -
config_spec.modules: Valkey™ module parameters:valkey_search.enabled: Enable theValkey-Searchmodule,trueorfalse. What you can set up for the module:valkey_search.reader_threads: Number of request processing threads.valkey_search.writer_threads: Number of indexing threads.
valkey_json.enabled: Enable theValkey-JSONmodule,trueorfalse.valkey_bloom.enabled: Enable theValkey-Bloommodule,trueorfalse.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.
Updating module settings
-
In the management console
, select the folder containing your cluster. -
Navigate to the Yandex Managed Service for Valkey™ service.
-
Select the cluster.
-
At the top of the page, click Edit.
-
Under Modules, edit the Valkey™ module settings.
You can set up the following for the Search module:
- Number of reader threads.
- Number of writer threads.
-
Click Save changes.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id options.
To update module settings:
-
View the description of the CLI command for updating a cluster:
yc managed-redis cluster update --help -
Run this command to update module settings:
yc managed-redis cluster update \ --cluster-name=<cluster_name> \ --valkey-modules valkey-search-reader-threads=<number_of_request_processing_threads>,` `valkey-search-writer-threads=<number_of_indexing_threads>Where:
--cluster-name: Yandex Managed Service for Valkey™ cluster name. You can get it from the list of clusters in the folder.--valkey-modules: Valkey™ module parameters:valkey-search-reader-threads: Number of request processing threads in theValkey-Searchmodule.valkey-search-writer-threads: Number of indexing threads in theValkey-Searchmodule.
-
Open the current Terraform configuration file describing your infrastructure.
For more on how to create this file, see Creating a cluster.
-
In the Yandex Managed Service for Valkey™ cluster description, do the necessary editing under
modules.valkey_search:resource "yandex_mdb_redis_cluster_v2" "<cluster_name>" { ... modules = { ... valkey_search = { ... reader_threads = <number_of_request_processing_threads> writer_threads = <number_of_indexing_threads> } } }Where:
reader_threads: Number of request processing threads in theValkey-Searchmodule.writer_threads: Number of indexing threads in theValkey-Searchmodule.
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
For more information, see this Terraform provider guide.
Timeouts
The Terraform provider sets the following timeouts for Yandex Managed Service for Valkey™ cluster operations:
- Creating a cluster, including by restoring it from a backup: 15 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the timeout are aborted.
How do I change these limits?
Add the timeouts section to your cluster description, such as the following:
resource "yandex_mdb_redis_cluster_v2" "<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 an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Update method, e.g., via the following cURL
request: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
updateMaskparameter 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.modules.valkeySearch.readerThreads,configSpec.modules.valkeySearch.writerThreads", "configSpec": { "modules": { "valkeySearch": { "readerThreads": "<number_of_request_processing_threads>", "writerThreads": "<number_of_indexing_threads>" } } } }'Where:
-
updateMask: Comma-separated string of settings to update. -
configSpec.modules: Valkey™ module parameters:valkeySearch.readerThreads: Number of request processing threads in theValkey-Searchmodule.valkeySearch.writerThreads: Number of indexing threads in theValkey-Searchmodule.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and put it into an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.Update method, e.g., via the following gRPCurl
request: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_maskparameter 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.modules.valkey_search.reader_threads", "config_spec.modules.valkey_search.writer_threads" ] }, "modules": { "valkey_search": { "reader_threads": "<number_of_request_processing_threads>", "writer_threads": "<number_of_indexing_threads>" } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.redis.v1.ClusterService.UpdateWhere:
-
update_mask: List of parameters to update as an array of strings (paths[]). -
config_spec.modules: Valkey™ module parameters:valkey_search.reader_threads: Number of request processing threads in theValkey-Searchmodule.valkey_search.writer_threads: Number of indexing threads in theValkey-Searchmodule.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.