ClickHouse® version upgrade
You can update the ClickHouse® version used by the cluster to any of the supported Managed Service for ClickHouse® versions; however, switching from versions lower than 23.8 to 23.8 or higher is performed in steps. For example, for Managed Service for ClickHouse®, the upgrade sequence from version 22.8 to 24.3 is: 22.8 → 23.3 → 23.8 → 24.3.
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 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 get a list of available versions, run the following command:
yc managed-clickhouse version list
To view the list of available versions, use the list REST API method for the Versions resource or the VersionsService/List gRPC API call.
Before a version upgrade
Make sure this does not affect your applications:
- See the ClickHouse® 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. In this case, you will only recover MergeTree tables.
- Create a backup of the main cluster directly before the version upgrade.
Updating the version
- In the management console
, open the Managed Service for ClickHouse page in the folder where you want to update the ClickHouse® version. - In the list of clusters, select the one to change.
- Click Edit.
- Under Basic parameters, select the appropriate version in the Version field.
- Click Save changes.
When the change starts, 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 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 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 | +----------------------+------+-------------+---------+---------------------+--------+---------+
-
Update the ClickHouse® version for any cluster as needed:
yc managed-clickhouse cluster update --id <cluster_ID> --version <ClickHouse®_version>
Specify the ClickHouse® version: 23.8, 24.3, 24.4 or 24.5.
When the update starts, 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 with an infrastructure plan.
For more information about creating this file, see Creating clusters.
-
To the Managed Service for ClickHouse® cluster description, add the
version
field or change its value if it is already there:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... version = "<ClickHouse®_version>" }
Specify the ClickHouse® version: 23.8, 24.3, 24.4 or 24.5.
-
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 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
}
}
To update a version, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - ClickHouse® version in the
configSpec.version
parameter: 23.8, 24.3, 24.4 or 24.5. - List of settings to update (in this case,
configSpec.version
) in theupdateMask
parameter.
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.
ClickHouse® is a registered trademark of ClickHouse, Inc