Skip to main content

Scale a ClickHouse® cluster

You can add or delete shards in a ClickHouse® cloud database cluster. To add a shard to a cluster that consists of one shard with one node, you must first add ClickHouse® Keeper. The ClickHouse® Keeper node group is required for all cluster configurations, except for single-node ones.

You can also scale node groups — both shards and ClickHouse® Keeper. For example:

  • change the configuration within lines with fixed configurations — you can only select a configuration with a disk size larger than the current one;

  • increase the number of vCPUs, RAM, and disk size in a line with custom configurations;

  • change the configuration line to another one with the same disk type, but a larger disk size. You cannot change a line with a local disk to a line with a network volume, or vice versa.

Add shard

You can add only one shard at a time. A cluster can contain no more than ten shards.

  1. If the cluster consists of only one shard with one node, add ClickHouse® Keeper.

  2. In the Dashboard, on the top menu click Products and select Managed Databases.

  3. Open the Active tab.

  4. Open the database cluster page → Settings tab.

  5. In the Cluster block, click Add shard.

  6. Optional: change the shard name.

  7. Select a configuration line.

  8. If you selected a line with custom configurations, select the disk type and specify the number of vCPUs, RAM size, and disk size.

  9. If you selected a line with fixed configurations, select a configuration.

  10. Specify the number of nodes in the shard.

  11. Optional: to make shard nodes accessible from the internet, select the Enable public access checkbox. A separate public IP address will be assigned to each shard node.

    If the cluster subnet does not meet the requirements, connecting public access is not available. You can connect a public IP address after adding a shard.

  12. Optional: specify the shard weight. Values from 0 to 65,535 are available.

  13. Click Save.

Add ClickHouse® Keeper

For your information

A ClickHouse® Keeper node group cannot be deleted from a cluster after it is added.

When adding ClickHouse® Keeper, MergeTree tables are automatically converted to replicated tables (for example, to ReplicatedMergeTree). Learn more about replicated tables in the ClickHouse® documentation guide Replicated* table engines.

  1. In the control panel, in the top menu, click Products and select Cloud Databases.

  2. Open the tab Active.

  3. Open the database cluster page → tab Settings.

  4. In the Cluster block, click Add ClickHouse Keeper.

  5. Optional: change the name of the node group.

  6. Select a configuration line.

  7. If you selected a line with custom configurations, select the disk type and specify the number of vCPUs, RAM size, and disk size.

  8. If you selected a line with fixed configurations, select a configuration.

  9. Click Save.

Delete shard

carefully

Deleting a shard will result in deleting all data located on this shard.

You can delete a shard from the cluster if it is not the only shard.

  1. In the control panel, in the top menu, click Products and select Cloud Databases.

  2. Open the tab Active.

  3. Open the cluster page → tab Settings.

  4. In the shard menu, select Delete.

  5. Enter the shard name to confirm.

  6. Click Delete.

Scale node group

warning

Active connections to the nodes will be interrupted during the node group scaling process.

  1. In the control panel, in the top menu, click Products and select Cloud Databases.

  2. Open the tab Active.

  3. Open the database cluster page → tab Settings.

  4. In the node group menu, select Change configuration.

  5. Optional: change the node group name.

  6. Scale the node group. You can:

    • change the configuration within the lines with fixed configurations — you can only select a configuration with a disk size larger than the current one;
    • increase the number of vCPUs, RAM, and disk size in the line with custom configurations;
    • change the configuration line to another one with the same disk type, but a larger disk size. You cannot change a line with a local disk to a line with a network volume, or vice versa.
  7. Click Save.

ClickHouse® is a registered trademark of ClickHouse, Inc. https://clickhouse.com.