ClickHouse® version upgrade
You can change the ClickHouse® version used by your cluster to any of the versions supported by Managed Service for ClickHouse®.
To learn more about updates within a single version and host maintenance, see Maintenance.
List of available versions
In the management console
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 get a list of available versions, run this command:
yc managed-clickhouse version list
-
Get an IAM token for API authentication and set it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Versions.List method, e.g., via the following cURL
request:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/versions' -
View the server response to make sure your request was successful.
-
Get an IAM token for API authentication and set it as 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. -
Use the VersionsService.List call and send the following request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/versions_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.clickhouse.v1.VersionsService.List -
View the server response to make sure your request was successful.
Before upgrading a version
Make sure the upgrade does not disrupt your applications:
- Look up ClickHouse® release notes
for info on how upgrades may affect your applications. - Try upgrading a test cluster. You can deploy it from a backup of the main cluster. In this case, you will only restore MergeTree tables.
- Back up the main cluster immediately before upgrading.
Upgrading the version
- In the management console
, open the Managed Service for ClickHouse page in the folder where you want to change the ClickHouse® version. - In the list of clusters, select the one to update.
- Click Edit.
- Under Basic parameters, select the version in the Version field.
- Click Save changes.
As soon as you run the upgrade, the cluster status will switch to UPDATING. Wait for the operation to complete and then check the cluster version.
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.
-
Get a list of your ClickHouse® clusters and view their versions:
yc managed-clickhouse cluster list +----------------------+------+-------------+---------+---------------------+--------+---------+ | ID | NAME | ENVIRONMENT | VERSION | CREATED AT | HEALTH | STATUS | +----------------------+------+-------------+---------+---------------------+--------+---------+ | c9qf1kmm0ebi******** | mych | PRODUCTION | 23.8 | 2024-06-06 10:23:22 | ALIVE | RUNNING | +----------------------+------+-------------+---------+---------------------+--------+---------+ -
Upgrade the ClickHouse® version for the cluster you need:
yc managed-clickhouse cluster update --id <cluster_ID> --version <ClickHouse®_version>Specify the ClickHouse® version: 24.8, 25.3, 25.4, 25.5, or 25.6.
As soon as you run the upgrade, the cluster status will switch to UPDATING. Wait for the operation to complete and then check the cluster version.
-
Open the current Terraform configuration file describing your infrastructure.
For information on how to create this file, see Creating a cluster.
-
Add the
versionfield to the Managed Service for ClickHouse® cluster description or edit its value if it is already there:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... version = "<ClickHouse®_version>" }Specify the ClickHouse® version: 24.8, 25.3, 25.4, 25.5, or 25.6.
-
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.
Time limits
A Terraform provider sets the timeout for Managed Service for ClickHouse® cluster operations:
- Creating a cluster, including by restoring one from a backup: 60 minutes.
- Editing a cluster: 90 minutes.
- Deleting a cluster: 30 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_clickhouse_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 save it as 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-clickhouse/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.version", "configSpec": { "version": "<ClickHouse®>_version" } }'Where:
-
updateMask: Comma-separated list of settings you want to update.Here, we only specified a single parameter,
configSpec.version. -
configSpec.version: target ClickHouse® version, 24.8, 25.3, 25.4, 25.5, or 25.6.
You can request 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 save it as 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. -
Use the ClusterService.Update call and send the following 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_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/clickhouse/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.version" ] }, "config_spec": { "version": "<ClickHouse®>_version" } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.clickhouse.v1.ClusterService.UpdateWhere:
-
update_mask: List of settings you want to update as an array of strings (paths[]).Here, we only specified a single parameter,
config_spec.version. -
config_spec.version: target ClickHouse® version, 24.8, 25.3, 25.4, 25.5, or 25.6.
You can request the cluster ID with the list of clusters in the folder.
-
-
View the server response to make sure your request was successful.
ClickHouse® is a registered trademark of ClickHouse, Inc