Updating ClickHouse® cluster settings
After creating a cluster, you can:
-
Configure the ClickHouse® servers according to the ClickHouse® documentation
. -
Move a cluster to another folder.
To move a cluster to a different availability zone, follow this guide. You will thus move the cluster hosts.
Change service account settings
-
In the management console
, go to the folder page and select Managed Service for ClickHouse. -
Select the cluster and click Edit cluster in the top panel.
-
Under Service settings, select the service account you need from the list, or create a new one. For more information about setting up service accounts, see Configuring access to Object Storage from a ClickHouse® cluster.
Warning
If the cluster already uses a service account to access objects from Object Storage, then changing it to a different service account may make these objects unavailable and interrupt the cluster operation. Before changing the service account settings, make sure that the cluster doesn't use the objects in question.
Changing the host class
Note
In clusters with ClickHouse® Keeper, ZooKeeper hosts cannot be used. To learn more, see Replication.
When changing the host class:
- Your single-host cluster will be unavailable for a few minutes with database connections terminated.
- In a multi-host cluster, hosts will be stopped and updated one by one. When stopped, a host will be unavailable for a few minutes.
- Using a special FQDN does not guarantee a stable database connection: user sessions may be terminated.
We recommend changing the host class only when the cluster has no active workload.
Host class affects the amount of RAM that ClickHouse® can use. For more information, see Memory management.
The minimum number of cores per ZooKeeper host depends on the total number of cores on ClickHouse® hosts. To learn more, see Replication.
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Select the cluster and click Edit cluster in the top panel.
- To change the ClickHouse® host class, select the platform, VM type, and required host class under Resources.
- To change the ZooKeeper host class, select the platform, VM type, and required ZooKeeper host class under ZooKeeper host class.
- Click Save changes.
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 change the host class for the cluster:
-
View a description of the update cluster CLI command:
yc managed-clickhouse cluster update --help
-
Request a list of available host classes (the
ZONES
column specifies the availability zones where you can select the appropriate class):yc managed-clickhouse resource-preset list +-----------+--------------------------------+-------+----------+ | ID | ZONE IDS | CORES | MEMORY | +-----------+--------------------------------+-------+----------+ | s1.micro | ru-central1-a, ru-central1-b, | 2 | 8.0 GB | | | ru-central1-d | | | | ... | +-----------+--------------------------------+-------+----------+
-
Specify the class in the update cluster command:
yc managed-clickhouse cluster update <cluster_name_or_ID> \ --clickhouse-resource-preset=<class_ID>
Managed Service for ClickHouse® will run the update host class command for the cluster.
-
To change the class of a ZooKeeper host, provide the value you need in the
--zookeeper-resource-preset
parameter.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about how to create this file, see Creating clusters.
-
In the Managed Service for ClickHouse® cluster description, change the value of the
resource_preset_id
parameter in theclickhouse.resources
andzookeeper.resources
sections for ClickHouse® and ZooKeeper hosts, respectively:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... clickhouse { resources { resource_preset_id = "<ClickHouse®_host_class>" ... } } zookeeper { resources { resource_preset_id = "<ZooKeeper_class_host>" ... } } }
-
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 change the host class, 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 values in the
configSpec.clickhouse.resources.resourcePresetId
parameter (configSpec.zookeeper.resources.resourcePresetId
for ZooKeeper).To request a list of supported values, use the list method for
ResourcePreset
resources. -
List of settings to update, in the
updateMask
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).
Increasing storage size
Note
In clusters with ClickHouse® Keeper, ZooKeeper hosts cannot be used. To learn more, see Replication.
Make sure the cloud has enough quota to increase the storage size. Open the cloud's Quotas
To increase the cluster storage size:
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Select the cluster and click Edit cluster in the top panel.
- Under Size of storage, specify the required value.
- Click Save changes.
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 increase the cluster storage size:
-
View a description of the update cluster CLI command:
yc managed-clickhouse cluster update --help
-
Specify the required storage in the cluster update command (it must be at least as large as
disk_size
in the cluster properties):yc managed-clickhouse cluster update <cluster_name_or_ID> \ --clickhouse-disk-size <storage_size_GB>
-
To increase the storage capacity of ZooKeeper hosts, provide the value you need in the
--zookeeper-disk-size
parameter.
To increase storage size:
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about how to create this file, see Creating clusters.
-
In the Managed Service for ClickHouse® cluster description, change the value of the
disk_size
parameter in theclickhouse.resources
andzookeeper.resources
sections for ClickHouse® and ZooKeeper, respectively:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... clickhouse { resources { disk_size = <storage_size_GB> ... } } zookeeper { resources { disk_size = <storage_size_GB> ... } } }
-
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 increase the storage size, 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 size of the ClickHouse® host storage in the
configSpec.clickhouse.resources.diskSize
parameter. - Required size of the ZooKeeper host storage in the
configSpec.zookeeper.resources.diskSize
parameter. - List of cluster configuration fields to update in the
updateMask
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).
Enabling user and database management via SQL
The Managed Service for ClickHouse® service lets enable cluster user and database management via SQL.
Alert
This disables user and database management through other interfaces.
Once enabled, user and database management settings for SQL cannot be disabled.
- Go to the folder page and select Managed Service for ClickHouse.
- Select the cluster and click Edit cluster in the top panel.
- To manage users via SQL, enable the User management via SQL setting under DBMS settings and specify the
admin
user password. - To manage databases via SQL, enable the User management via SQL and Managing databases via SQL settings under DBMS settings and specify the
admin
user password. - Click Save changes.
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 enable SQL user management:
- set
--enable-sql-user-management
totrue
. - Set a password for the
admin
user in the--admin-password
parameter.
yc managed-clickhouse cluster update <cluster_name_or_ID> \ ... --enable-sql-user-management true \ --admin-password "<admin_password>"
- set
-
To enable SQL database management:
- Set
--enable-sql-user-management
and--enable-sql-database-management
totrue
; - Set a password for the
admin
user in the--admin-password
parameter.
yc managed-clickhouse cluster update <cluster_name_or_ID> \ ... --enable-sql-user-management true \ --enable-sql-database-management true \ --admin-password "<admin_password>"
- Set
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about how to create this file, see Creating clusters.
-
To enable user management via SQL, expand the cluster description to include a
sql_user_management
field set totrue
and anadmin_password
field containing the password for theadmin
account:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { name = "<cluster_name>" ... admin_password = "<admin_password>" sql_user_management = true ... }
-
To enable database management via SQL, expand the cluster description to include a
sql_user_management
field and asql_database_management
field, both set totrue
, as well as theadmin_password
field containing the password for theadmin
account:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { name = "<cluster_name>" ... admin_password = "<admin_password>" sql_database_management = true sql_user_management = true ... }
-
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 enable user and database management via SQL, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the appropriate values in the configSpec.clickhouse.config
request parameter:
sqlUserManagement
: Set totrue
to enable user management via SQL.sqlDatabaseManagement
: Set totrue
to enable database management via SQL. User management via SQL needs to be enabled.adminPassword
: Set a password for theadmin
account to use for management tasks.
Changing ClickHouse® settings
Note
You can only update the value of Max server memory usage
For more information, see Memory management.
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Select the cluster and click Edit cluster in the top panel.
- Configure the ClickHouse® settings by clicking Settings under DBMS settings.
- Click Save changes.
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 change ClickHouse® server settings:
-
View the full list of settings specified for the cluster:
yc managed-clickhouse cluster get <cluster_name_or_ID> --full
-
View a description of the update cluster configuration CLI command:
yc managed-clickhouse cluster update-config --help
-
Set the required parameter values:
yc managed-clickhouse cluster update-config <cluster_name_or_ID> \ --set <name_of_parameter_1>=<value_1>,...
Managed Service for ClickHouse® runs the update cluster settings operation.
All the supported parameters are listed in the description of settings forClickHouse®.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about how to create this file, see Creating clusters.
-
In the Managed Service for ClickHouse® cluster description, change the values of the parameters in the
clickhouse.config
block:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... clickhouse { ... config { # General DBMS settings ... merge_tree { # MergeTree engine settings ... } kafka { # General settings to get data from Apache Kafka ... } kafka_topic { # Settings for an individual Apache Kafka topic ... } rabbit_mq { # Settings to get data from RabbitMQ username = "<username>" password = "<password>" } compression { # Data compression settings method = "<compression_method>" min_part_size = <data_part_size> min_part_size_ratio = <size_ratio> } graphite_rollup { # GraphiteMergeTree engine settings for thinning and aggregation/averaging # (rollup) of Graphite data. ... } } ... } ... }
Where:
method
: Compression method,LZ4
orZSTD
.min_part_size
: Minimum size of a table data part, bytes.min_part_size_ratio
: Ratio between the smallest table chunk and full table size.
-
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 change ClickHouse® settings, 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 values in the
configSpec.clickhouse.config
parameter.All supported settings are described in the ClickHouse® settings section and in the API reference.
-
List of settings to update, in the
updateMask
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).
Warning
Changing some cluster-level settings will restart ClickHouse® servers on the cluster hosts.
Changing additional cluster settings
-
In the management console
, go to the folder page and select Managed Service for ClickHouse. -
Select the cluster and click Edit cluster in the top panel.
-
Under Service settings, change the additional cluster settings:
-
Backup start time (UTC): Time interval during which the cluster backup starts. Time is specified in 24-hour UTC format. The default time is
22:00 - 23:00
UTC. -
Maintenance window: Maintenance window settings:
- To enable maintenance at any time, select arbitrary (default).
- To specify the preferred maintenance start time, select by schedule and specify the desired day of the week and UTC hour. For example, you can choose a time when the cluster is least loaded.
Maintenance operations are carried out both on enabled and disabled clusters. They may include updating the DBMS, applying patches, and so on.
-
DataLens access: This option allows you to analyze cluster data in Yandex DataLens.
-
Data Transfer access: Enable this option to allow access to the cluster from Yandex Data Transfer in Serverless mode.
This will enable you to connect to Yandex Data Transfer running in Kubernetes via a special network. It will also cause other operations to run faster, such as transfer launch and deactivation.
-
Access from the management console: This option allows you to run SQL queries against cluster databases from the Yandex Cloud management console.
-
Access from Metrica and AppMetrica: This option helps import data from AppMetrica
to a cluster. -
Serverless access: Enable this option to allow cluster access from Yandex Cloud Functions. For more information about setting up access, see the Cloud Functions documentation.
-
Yandex Query access: Enable this option to allow cluster access from Yandex Query. This feature is at the Preview stage.
-
Deletion protection: Manages cluster protection from accidental deletion by a user.
Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
-
-
Click Save changes.
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 change additional cluster settings:
-
View a description of the update cluster CLI command:
yc managed-clickhouse cluster update --help
-
Run the following command with a list of settings to update:
yc managed-clickhouse cluster update <cluster_name_or_ID> \ --backup-window-start <backup_start_time> \ --datalens-access=<access_from_DataLens> \ --datatransfer-access=<access_from_Data_Transfer> \ --deletion-protection=<cluster_deletion_protection> \ --maintenance-window type=<maintenance_type>,` `day=<day_of_week>,` `hour=<hour> \ --metrika-access=<data_import_from_AppMetrica> \ --serverless-access=<access_from_Cloud_Functions> \ --yandexquery-access=<access_via_Yandex_Query> \ --websql-access=<SQL_query_execution>
You can change the following settings:
--backup-window-start
: The cluster backup start time, set in UTC formatHH:MM:SS
. If the time is not set, the backup will start at 22:00 UTC.
-
--datalens-access
: Enables access from DataLens. The default value isfalse
. For more information about setting up a connection, see Connecting from DataLens. -
--datatransfer-access
: Allows access to the cluster from Yandex Data Transfer in serverless mode:true
orfalse
. The default value isfalse
.This will enable you to connect to Yandex Data Transfer running in Kubernetes via a special network. As a result, other operations, e.g., transfer launch and deactivation, will run faster.
-
--deletion-protection
: Cluster protection from accidental deletion by a user:true
orfalse
.Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
-
--maintenance-window
: Settings for the maintenance window (including those for disabled clusters), wheretype
is the maintenance type:anytime
(default): Any time.weekly
: On a schedule. If setting this value, specify the day of week and the hour:day
: Day of week inDDD
format:MON
,TUE
,WED
,THU
,FRI
,SAT
, orSUN
.hour
: Hour (UTC) inHH
format:1
to24
.
-
--metrika-access
: Enables data import from AppMetrica to your cluster . The default value isfalse
. -
--websql-access
: Enables running SQL queries from the management console. The default value isfalse
. -
--serverless-access
: Enables cluster access from Yandex Cloud Functions. The default value isfalse
. For more information about setting up access, see the Cloud Functions documentation. -
--yandexquery-access=true
: Enables cluster access from Yandex Query. This feature is at the Preview stage. The default value isfalse
.
You can get the cluster ID and name with a list of clusters in the folder.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about how to create this file, see Creating clusters.
-
To change the backup start time, add a
backup_window_start
block to the Managed Service for ClickHouse® cluster description:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... backup_window_start { hours = <hour_of_backup_start_time> minutes = <minute_of_backup_start_time> } ... }
-
To allow access from other services and execution of SQL queries from the management console, change the values of the appropriate fields in the
access
block:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... access { data_lens = <access_from_DataLens> metrika = <access_from_Yandex_Metrica_and_AppMetrica> serverless = <access_from_Cloud_Functions> web_sql = <SQL_query_execution_from_management_console> yandex_query = <access_via_Yandex_Query> } ... }
Where:
data_lens
: Access from DataLens,true
orfalse
.metrika
: Access from Yandex Metrica and AppMetrica,true
orfalse
.serverless
: Access to the cluster from Yandex Cloud Functions,true
orfalse
.web_sql
: Execution of SQL queries from the management console,true
orfalse
.yandex_query
: Access to the cluster from Yandex Query,true
orfalse
.
-
To set up the maintenance window (for disabled clusters as well), add the
maintenance_window
block to the cluster description:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... maintenance_window { type = <maintenance_type> day = <day_of_week> hour = <hour> } ... }
Where:
type
: Maintenance type. The possible values include:anytime
: Anytime.weekly
: By schedule.
day
: Day of the week for theweekly
type inDDD
format, e.g.,MON
.hour
: Hour of the day for theweekly
type in theHH
format, e.g.,21
.
-
To enable cluster protection against accidental deletion by a user of your cloud, add the
deletion_protection
field set totrue
to your cluster description:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... deletion_protection = <cluster_deletion_protection> }
Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
-
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 change additional cluster settings, 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 retrieve the ID, get a list of clusters in the folder. -
Settings for access from other services and access to SQL queries from the management console in the
configSpec.access
parameter. -
Backup window settings in the
configSpec.backupWindowStart
parameter. -
Settings for the maintenance window (including those for disabled clusters) in the
maintenanceWindow
parameter. -
Cluster deletion protection settings in the
deletionProtection
parameter.Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
-
List of cluster configuration fields to update in the
UpdateMask
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).
To allow cluster access from Yandex Cloud Functions, set true
for the configSpec.access.serverless
parameter. For more information about setting up access, see the Cloud Functions documentation.
To allow cluster access from Yandex Query, set true
for the configSpec.access.yandexQuery
parameter. This feature is at the Preview stage.
To allow access to the cluster from Yandex Data Transfer in Serverless mode, pass true
for the configSpec.access.dataTransfer
parameter.
This will enable you to connect to Yandex Data Transfer running in Kubernetes via a special network. It will also cause other operations to run faster, such as transfer launch and deactivation.
Moving a cluster
- Go to the folder page and select Managed Service for ClickHouse.
- Click
to the right of the cluster you want to move. - Select Move.
- Select a folder you want to move the cluster to.
- Click Move.
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 move a cluster:
-
View a description of the CLI move cluster command:
yc managed-clickhouse cluster move --help
-
Specify the destination folder in the move cluster command:
yc managed-clickhouse cluster move <cluster_name_or_ID> \ --destination-folder-name=<destination_folder_name>
You can get the cluster ID with a list of clusters in the folder.
To move a cluster, use the move REST API method for the Cluster resource or the ClusterService/Move 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. - ID of the destination folder in the
destinationFolderId
parameter.
Changing security groups
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Select the cluster and click Edit cluster in the top panel.
- Under Network settings, select security groups for cluster network traffic.
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 edit the list of security groups for your cluster:
-
View a description of the update cluster CLI command:
yc managed-clickhouse cluster update --help
-
Specify the security groups in the update cluster command:
yc managed-clickhouse cluster update <cluster_name> \ --security-group-ids <list_of_security_group_IDs>
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about how to create this file, see Creating clusters.
-
Change the value of the
security_group_ids
parameter in the cluster description:resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" { ... security_group_ids = [ <list_of_cluster_security_group_IDs> ] }
-
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 security groups, 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. - List of security group IDs in the
securityGroupIds
parameter. - List of settings to update, in the
updateMask
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).
Warning
You may need to additionally set up security groups to connect to the cluster.
Changing hybrid storage settings
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 change hybrid storage settings:
-
View a description of the update cluster CLI command:
yc managed-clickhouse cluster update --help
-
If hybrid storage is disabled in the cluster, enable it:
yc managed-clickhouse cluster update <cluster_name_or_ID> \ --cloud-storage=true
Note
Once enabled, hybrid storage cannot be disabled.
-
Provide a list of settings to update:
yc managed-clickhouse cluster update <cluster_name_or_ID> \ --cloud-storage-data-cache=<file_storage> \ --cloud-storage-data-cache-max-size=<storage_size_in_bytes> \ --cloud-storage-move-factor=<percentage_of_free_space> \ --cloud-storage-prefer-not-to-merge=<merge_of_data_parts>
You can change the following settings:
--cloud-storage-data-cache
: Allows you to cache files in cluster storage. This setting is enabled by default (set totrue
).--cloud-storage-data-cache-max-size
: Sets the maximum cache size (in bytes) allocated in cluster storage for files. The default value is1073741824
(1 GB).--cloud-storage-move-factor
: Sets the minimum share of free space in cluster storage. If the actual value is less than this setting value, the data is moved to Yandex Object Storage. The minimum value is0
, the maximum one is1
, and the default one is0.01
.--cloud-storage-prefer-not-to-merge
: Disables data part merges in cluster and object storage. To disable merges, set the parameter totrue
or provide it with no value. To keep merges enabled, set the parameter tofalse
or do not provide it in the CLI command when creating a cluster.
To change hybrid storage settings, 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. -
true
value in theconfigSpec.cloudStorage.enabled
parameter if hybrid storage is not enabled.Note
Once enabled, hybrid storage cannot be disabled.
-
The hybrid storage settings in the
configSpec.cloudStorage
parameters:configSpec.cloudStorage.dataCacheEnabled
: Allows you to cache files in cluster storage. This setting is enabled by default (set totrue
).configSpec.cloudStorage.dataCacheMaxSize
: Sets the maximum cache size (in bytes) allocated in cluster storage for files. The default value is1073741824
(1 GB).configSpec.cloudStorage.moveFactor
: Sets the minimum share of free space in cluster storage. If the actual value is less than this setting value, the data is moved to Yandex Object Storage. The minimum value is0
, the maximum one is1
, and the default one is0.01
.configSpec.cloudStorage.preferNotToMerge
: Disables data part merges in cluster and object storage. To disable merges, set it totrue
. To keep merges enabled, set the parameter tofalse
or do not provide it in your API request when creating a cluster.
-
List of settings to update, in the
updateMask
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