Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • ClickHouse® version upgrade
      • Stopping and starting a cluster
        • Managing ClickHouse® hosts
        • Managing ZooKeeper hosts
        • Migrating hosts to a different availability zone
      • Managing backups
      • Deleting a cluster
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Getting a list of cluster hosts
  • Creating a host
  • Updating a host
  • Restarting a host
  • Deleting a host
  1. Step-by-step guides
  2. Clusters
  3. Managing hosts
  4. Managing ClickHouse® hosts

Managing ClickHouse® hosts

Written by
Yandex Cloud
Updated at December 10, 2025
  • Getting a list of cluster hosts
  • Creating a host
  • Updating a host
  • Restarting a host
  • Deleting a host

You can do the following with ClickHouse® hosts:

  • Get a list of cluster hosts.
  • Create a host.
  • Update ClickHouse® host settings.
  • Restart a host.
  • Delete a host.

For information about moving ClickHouse® hosts to a different availability zone, see this guide.

Warning

If you created your cluster without ClickHouse® Keeper support, you should add at least three ZooKeeper hosts before adding new hosts to any of the shards.

Getting a list of cluster hostsGetting a list of cluster hosts

Management console
CLI
REST API
gRPC API
  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the name of the cluster you need and select the Hosts tab.

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 cluster hosts, run this command:

yc managed-clickhouse host list \
   --cluster-name=<cluster_name>
+----------------------------+--------------+---------+--------+---------------+
|            NAME            |  CLUSTER ID  |  ROLE   | HEALTH |    ZONE ID    |
+----------------------------+--------------+---------+--------+---------------+
| rc1b...mdb.yandexcloud.net | c9qp71dk1... | MASTER  | ALIVE  | ru-central1-b |
| rc1a...mdb.yandexcloud.net | c9qp71dk1... | REPLICA | ALIVE  | ru-central1-a |
+----------------------------+--------------+---------+--------+---------------+

You can get the cluster name with the list of clusters in the folder.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.ListHosts 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/clusters/<cluster_ID>/hosts'
    

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.

  3. Call the ClusterService.ListHosts method, e.g., via the following gRPCurl request:

    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>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.ListHosts
    

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Creating a hostCreating a host

The number of hosts in Managed Service for ClickHouse® clusters is limited by the CPU and RAM quotas allocated to database clusters in your cloud. To check the resources currently in use, open the Quotas page and find Managed Databases.

You can create several hosts in a cluster in one go.

Management console
CLI
Terraform
REST API
gRPC API
  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.

  2. Click the cluster name and navigate to the Hosts tab.

  3. Click Create ClickHouse hosts.

  4. Specify the following host settings:

    • Availability zone.
    • Subnet (if the required subnet is not on the list, create it).
    • Shard name.
    • Enable Public access to make the host accessible from outside Yandex Cloud, if required.
  5. Optionally, click Create host to add more hosts and specify their parameters.

  6. Under Additional settings:

    • Copy data schema: If the data schema is the same on all replica hosts in the cluster, enable this option to copy the schema from a random replica to the new hosts.
  7. Click Create hosts to create one or multiple hosts.

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 create one or multiple hosts:

  1. To choose a subnet for your new host, get the list of all cluster subnets:

    yc vpc subnet list
    

    Result:

    +-----------+-----------+------------+---------------+------------------+
    |     ID    |   NAME    | NETWORK ID |     ZONE      |      RANGE       |
    +-----------+-----------+------------+---------------+------------------+
    | b0cl69... | default-d | enp6rq7... | ru-central1-d | [172.16.0.0/20]  |
    | e2lkj9... | default-b | enp6rq7... | ru-central1-b | [10.10.0.0/16]   |
    | e9b0ph... | a-2       | enp6rq7... | ru-central1-a | [172.16.32.0/20] |
    | e9b9v2... | default-a | enp6rq7... | ru-central1-a | [172.16.16.0/20] |
    +-----------+-----------+------------+---------------+------------------+
    

    If the required subnet is not on the list, create it.

  2. View the description of the CLI command for creating hosts:

    yc managed-clickhouse hosts add --help
    
  3. Run the command to create hosts.

    Specify one or multiple --host parameters in the command, one for each new host.

    The command for creating a single host is as follows:

    yc managed-clickhouse hosts add \
      --cluster-name=<cluster_name> \
      --host zone-id=<availability_zone>,`
        `subnet-id=<subnet_ID>,`
        `assign-public-ip=<public_access_to_host>,`
        `shard-name=<shard_name>,`
        `type=clickhouse
    

    Where assign-public-ip is internet access to the host via a public IP address, true or false.

    To copy the data schema from a random replica to the new host, set the optional --copy-schema parameter.

    Managed Service for ClickHouse® will start creating hosts.

    If your availability zone contains multiple subnets, make sure to specify the subnet ID; otherwise, Managed Service for ClickHouse® will automatically select the single subnet available. You can get the cluster name with the list of clusters in the folder.

  1. Open the current Terraform configuration file describing your infrastructure.

    Learn how to create this file in Creating a cluster.

  2. Add one or multiple host sections to the Managed Service for ClickHouse® cluster description, one for each new host.

    A single host section is as follows:

    resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
      ...
      host {
        type             = "CLICKHOUSE"
        zone             = "<availability_zone>"
        subnet_id        = "<subnet_ID>"
        assign_public_ip = <public_access_to_host>
      }
    }
    

    Where assign_public_ip is internet access to the host via a public IP address, true or false.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see this Terraform provider guide.

Timeouts

The Terraform provider sets the following timeouts for Managed Service for ClickHouse® cluster operations:

  • Creating a cluster, including by restoring from a backup: 60 minutes.
  • Updating a cluster: 90 minutes.
  • Deleting a cluster: 30 minutes.

Operations exceeding the timeout are aborted.

How do I change these limits?

Add a timeouts section to the cluster description, e.g.:

resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.AddHosts method, e.g., via the following cURL request:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/hosts:batchCreate' \
        --data '{
                  "hostSpecs": [
                    {
                      "type": "CLICKHOUSE",
                      "zoneId": "<availability_zone>",
                      "subnetId": "<subnet_ID>",
                      "shardName": "<shard_name>",
                      "assignPublicIp": <public_access_to_host>
                    },
                    { <similar_settings_for_new_host_2> },
                    { ... },
                    { <similar_settings_for_new_host_N> }
                  ],
                  "copySchema": <copying_data_schema>
                }'
    

    Where:

    • hostSpecs: Array of settings for the new hosts. Each array element contains the configuration for a single host and has the following structure:

      • type: Host type, which is always CLICKHOUSE for ClickHouse® hosts.
      • zoneId: Availability zone.
      • subnetId: Subnet ID.
      • shardName: Shard name.
      • assignPublicIp: Internet access to the host via a public IP address, true or false.
    • copySchema: Enables or disables copying the data schema from a random replica to the new hosts, true or false.

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.

  3. Call the ClusterService.AddHosts method, e.g., via the following gRPCurl request:

    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>",
                "host_specs": [
                    {
                        "type": "CLICKHOUSE",
                        "zone_id": "<availability_zone>",
                        "subnet_id": "<subnet_ID>",
                        "shard_name": "<shard_name>",
                        "assign_public_ip": <public_access_to_host>
                    },
                    { <similar_settings_for_new_host_2> },
                    { ... },
                    { <similar_settings_for_new_host_N> }
                ],
                "copy_schema": <enabling_or_disabling_data_schema_copying>
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.AddHosts
    

    Where:

    • host_specs: Array of settings for the new hosts. Each array element contains the configuration for a single host and has the following structure:

      • type: Host type, which is always CLICKHOUSE for ClickHouse® hosts.
      • zone_id: Availability zone.
      • subnet_id: Subnet ID.
      • shard_name: Shard name.
      • assign_public_ip: Internet access to the host via a public IP address, true or false.
    • copy_schema: Enables or disables copying the data schema from a random replica to the new hosts, true or false.

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Warning

If you cannot connect to the host you created, check that the cluster security group is configured correctly for the host subnet.

Use the copy schema option only if the schema is the same across all replica hosts of the cluster.

Updating a hostUpdating a host

You can change public access settings for any host in a Managed Service for ClickHouse® cluster.

Warning

For a more secure cluster with public host access enabled, use only trusted IP addresses or subnets in the cluster's security group rules. Learn more in Configuring security groups.

Management console
CLI
Terraform
REST API
gRPC API

To change the cluster host settings:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and navigate to the Hosts tab.
  3. Click in the host row and select Edit.
  4. In the window that opens, enable Public access to make the host accessible from outside Yandex Cloud, if required.
  5. Click Save.

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 change the host parameters, run this command:

yc managed-clickhouse host update <host_name> \
  --cluster-name=<cluster_name> \
  --assign-public-ip=<public_access_to_host>

Where assign-public-ip is internet access to the host via a public IP address, true or false.

You can get the host name with the list of cluster hosts, and the cluster name, with the list of clusters in the folder.

  1. Open the current Terraform configuration file describing your infrastructure.

    Learn how to create this file in Creating a cluster.

  2. Add or edit the assign_public_ip parameter in the relevant host section.

    resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
      ...
      host {
        ...
        assign_public_ip = <public_access_to_host>
      }
      ...
    }
    

    Where assign_public_ip is internet access to the host via a public IP address, true or false.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see this Terraform provider guide.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.UpdateHosts 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 updateMask parameter as a single comma-separated string.

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/hosts:batchUpdate' \
        --data '{
                  "updateHostSpecs": [
                    {
                      "hostName": "<host_name>",
                      "updateMask": "assignPublicIp",
                      "assignPublicIp": <public_access_to_host>
                    }
                  ]
                }'
    

    Where updateHostSpecs[] is the list of hosts and their parameters to update. Below is the structure of an individual element:

    • hostName: Host name which you can get with the list of hosts in the cluster.

    • updateMask: Comma-separated string of settings you want to update.

      Here, we only specified a single setting, assignPublicIp.

    • assignPublicIp: Internet access to the host via a public IP address, true or false.

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.

  3. Call the ClusterService.UpdateHosts method, e.g., via the following gRPCurl 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 update_mask parameter as an array of paths[] 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_host_specs": [
                {
                    "host_name": "<host_name>",
                    "update_mask": {
                        "paths": [
                            "assign_public_ip"
                        ]
                    },
                    "assign_public_ip": <public_access_to_host>
                }]
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.UpdateHosts
    

    Where update_host_specs[] is the list of hosts and their parameters to update. Below is the structure of an individual element:

    • host_name: Host name which you can get with the list of hosts in the cluster.

    • update_mask: List of settings to update as an array of strings (paths[]).

      Here, we only specified a single setting, assign_public_ip.

    • assign_public_ip: Internet access to the host via a public IP address, true or false.

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Warning

If you cannot connect to the host after the update, check that the cluster security group is properly configured for the subnet containing your host.

Restarting a hostRestarting a host

You may need to restart hosts to promptly address such issues as:

  • Resource overutilization
  • Memory leak
  • Request deadlock
  • Unresponsive ClickHouse® operations and internal processes
Management console
CLI
REST API
gRPC API

To restart a single host:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and navigate to the Hosts tab.
  3. In the host row, click and select Restart.
  4. In the window that opens, enable I am restarting host and click Confirm.

To restart multiple hosts in one go:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and navigate to the Hosts tab.
  3. Select the hosts you want to restart and click Restart at the bottom of the screen.
  4. In the window that opens, click Confirm.

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 restart one or multiple hosts, run the command below providing their names. Use the space character as a separator.

Here is the command to restart a single host:

yc managed-clickhouse host restart <host_name> \
   --cluster-name=<cluster_name>

You can get the host name with the list of cluster hosts, and the cluster name, with the list of clusters in the folder.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.RestartHosts method, e.g., via the following cURL request:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/hosts:restartHosts' \
        --data '{
                  "hostNames": [
                    <list_of_host_names>
                  ]
                }'
    

    Where hostNames is an array of strings. Each string is the name of the host to restart. You can get the host names with the list of hosts in the cluster.

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.

  3. Call the ClusterService.RestartHosts method, e.g., via the following gRPCurl request:

    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>",
                "host_names": [
                  <list_of_host_names>
                ]
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.RestartHosts
    

    Where host_names is an array of strings. Each string is the name of the host to restart. You can get the host names with the list of hosts in the cluster.

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

Deleting a hostDeleting a host

Warning

You cannot delete a host from a cluster or shard if the relevant limit for the minimum number of hosts was reached.

You cannot delete hosts running ClickHouse® Keeper if you enabled this replication option when creating the cluster.

You cannot delete hosts of different types (ClickHouse® and ZooKeeper) at the same time.

Management console
CLI
Terraform
REST API
gRPC API

To delete a single host:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and navigate to the Hosts tab.
  3. Click in the host row and select Delete.
  4. In the window that opens, enable Delete host and click Confirm.

To delete multiple hosts in one go:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and navigate to the Hosts tab.
  3. Select the hosts you want to delete and click Delete at the bottom of the screen.
  4. In the window that opens, click Delete.

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 delete one or multiple hosts from a cluster, run the command below, providing the names of the hosts you want to delete. Use the space character as a separator.

The command for deleting a single host is as follows:

yc managed-clickhouse hosts delete --cluster-name=<cluster_name> \
  <host_name>

You can get the host names with the list of cluster hosts, and the cluster name, with the list of clusters in the folder.

  1. Open the current Terraform configuration file describing your infrastructure.

    Learn how to create this file in Creating a cluster.

  2. In the Managed Service for ClickHouse® cluster description, delete one or multiple CLICKHOUSE host sections.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Type yes and press Enter.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see this Terraform provider guide.

Timeouts

The Terraform provider sets the following timeouts for Managed Service for ClickHouse® cluster operations:

  • Creating a cluster, including by restoring from a backup: 60 minutes.
  • Updating a cluster: 90 minutes.
  • Deleting a cluster: 30 minutes.

Operations exceeding the timeout are aborted.

How do I change these limits?

Add a timeouts section to the cluster description, e.g.:

resource "yandex_mdb_clickhouse_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.DeleteHosts method, e.g., via the following cURL request:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/hosts:batchDelete' \
        --data '{
                  "hostNames": [
                    <list_of_host_names>
                  ]
                }'
    

    Where hostNames is an array of strings. Each string is the name of a host to delete. You can get the host names with the list of hosts in the cluster.

    You can get the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.

  3. Call the ClusterService.DeleteHosts method, e.g., via the following gRPCurl request:

    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>",
                "host_names": [
                  <list_of_host_names>
                ]
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.DeleteHosts
    

    Where host_names is an array of strings. Each string is the name of a host to delete. You can get the host names with the list of hosts in the cluster.

    You can get the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure your request was successful.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Stopping and starting a cluster
Next
Managing ZooKeeper hosts
© 2025 Direct Cursus Technology L.L.C.