Valkey™ version upgrade
You can upgrade a Yandex Managed Service for Valkey™ cluster to any supported version.
Supported versions
All Valkey™ versions, which were supported in Yandex Managed Service for Valkey™, will remain available as long as the vendor continues to support them. Normally, this is for 24 months after a version is released. For more information, see the Valkey™ documentation
Note
As of September 9, 2024, Valkey™ versions 6.2 and 7.0 are discontinued. You cannot create a cluster with these versions. All existing clusters will be automatically upgraded to version 7.2.
Viewing a list of available Valkey™ versions
- In the management console
, go to the folder page and select Yandex Managed Service for Valkey™. - Select a cluster and click Edit.
- Open the list in the Version field.
Before a version upgrade
Make sure this does not affect your applications:
- See the Valkey™ changelog
to check how updates might affect your applications. - Try upgrading the version on a test cluster. You can deploy it from a backup of the main cluster. To do this, the Valkey™ version in the backup must be supported in Yandex Managed Service for Valkey™.
- Create a backup of the main cluster directly before the version upgrade.
Upgrading a cluster
Alert
- After updating the DBMS, the cluster cannot be rolled back to the previous version.
- The success of a Valkey™ version upgrade depends on multiple factors, including cluster settings and data stored in databases. We recommend that you begin by upgrading a test cluster that has the same data and settings.
- In the management console
, go to the folder containing the cluster to upgrade. - Select Yandex Managed Service for Valkey™.
- Select the cluster from the list and click Edit.
- In the Version field, select the new version.
- Click Save changes.
As soon as you run the upgrade, the cluster status will change to Updating. Wait for the operation to complete and then check the cluster version.
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.
-
Get a list of your Valkey™ clusters using this command:
yc managed-redis cluster list
-
Get information about the cluster you need and check the Valkey™ version in the
config.version
parameter:yc managed-redis cluster get <cluster_name_or_ID>
-
Run the Valkey™ upgrade:
yc managed-redis cluster update <cluster_name_or_ID> \ --redis-version <new_version_number>
As soon as you run the upgrade, the cluster status will change to Updating. Wait for the operation to complete and then check the cluster version.
-
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.version", "configSpec": { "version": "<Valkey™_version>" } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.Only one parameter is provided in this case.
-
configSpec.version
: New Valkey™ version.
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.version" ] }, "config_spec": { "version": "<Valkey™_version>" } }' \ 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.version
: New Valkey™ version.
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.
Examples
Let's assume you need to upgrade your cluster from version 6.2 to version 7.0.
-
To retrieve a list of clusters and find out their IDs and names, run the command below:
yc managed-redis cluster list
Result:
+----------------------+---------------+---------------------+--------+---------+ | ID | NAME | CREATED AT | HEALTH | STATUS | +----------------------+---------------+---------------------+--------+---------+ | c9q8p8j2gaih******** | redis406 | 2022-04-23 12:44:17 | ALIVE | RUNNING | +----------------------+---------------+---------------------+--------+---------+
-
To get information about a cluster named
redis406
, run the following command:yc managed-redis cluster get redis406
Result:
id: c9q8p8j2gaih******** ... config: version: "6.2" ...
-
To upgrade a cluster named
redis406
to version 7.0, run the following command:yc managed-redis cluster update redis406 --redis-version 7.0