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.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the 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 parameter.
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 with 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.
-
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 you want 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.
-
-
View 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 the repository contents are stored 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 you want 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.
-
-
View the server response to make sure your request was successful.
Updating module settings
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the 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 parameter.
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 with 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.
-
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 you want 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.
-
-
View 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 the repository contents are stored 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 settings you want 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.
-
-
View the server response to make sure your request was successful.