Updating the ClickHouse® version
You can update the ClickHouse® version used by the cluster to any of the supported Managed Service for ClickHouse® versions, but you cannot switch:
- From version 22.0 and higher to a version lower than 22.0.
- To a version lower than 22.3 if the cluster was created with ClickHouse® Keeper support.
To learn more about updates within a single version and host maintenance, see Maintenance.
List of available versions
You can view a list of available versions on the create and edit cluster screen 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 updating the version
Make sure this does not affect your applications:
- See the ClickHouse® changelog
to check how updates might affect your applications. - Try updating 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 before updating the version.
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 cluster.
- 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:
yc managed-clickhouse cluster list +----------------------+---------------+---------------------+--------+---------+ | ID | NAME | CREATED AT | HEALTH | STATUS | +----------------------+---------------+---------------------+--------+---------+ | c9q8p8j2gaih******** | clickhouse691 | 2019-04-23 12:44:17 | ALIVE | RUNNING | +----------------------+---------------+---------------------+--------+---------+
-
Get information about a cluster and check the ClickHouse® version in your cluster in the
config.version
parameter:yc managed-clickhouse cluster get c9q8p8j2gaih******** id: c9q8p8j2gaih******** folder_id: b1gqs1teo2q2******** created_at: "2019-04-23T12:44:17.929853Z" name: clickhouse691 environment: PRODUCTION monitoring: - name: Console description: Console charts link: https://console.cloud.yandex.com/folders/b1gqs1teo2q2********/managed-clickhouse/cluster/c9q8p8j2gaih********?section=monitoring config: version: "19.1" ...
-
Update the ClickHouse® version:
yc managed-clickhouse cluster update --id c9q8p8j2gaih******** --version 19.4
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 how to create 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>" }
-
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.
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. - Required value in the
configSpec.clickhouse.config.version
parameter. - List of settings to update (in this case,
configSpec.clickhouse.config.version
) in theupdateMask
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
ClickHouse® is a registered trademark of ClickHouse, Inc