Scale a ClickHouse® cluster
In a ClickHouse® Managed Database cluster, you can add or delete shards. To add a shard to a cluster consisting of one single-node shard, you must first add ClickHouse® Keeper. A ClickHouse® Keeper node group is required for all cluster configurations except single-node ones.
You can also scale node groups — 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 in 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 only add one shard at a time. A cluster can have no more than ten shards.
-
If the cluster consists of only one single-node shard, add ClickHouse® Keeper.
-
In the Control panel, in the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Go to the database cluster page → Settings tab.
-
In the Cluster block, click Add shard.
-
Optional: change the shard name.
-
Select a configuration line.
-
If you selected a line with custom configurations, select a disk type and specify the number of vCPUs, RAM size, and disk size.
-
If you selected a line with fixed configurations, select a configuration.
-
Specify the number of nodes in the shard.
-
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, enabling public access is not available. You can connect a public IP address after adding the shard.
-
Optional: specify the shard weight. Values from 0 to 65,535 are available.
-
Click Save.
Add ClickHouse® Keeper
The ClickHouse® Keeper node group cannot be deleted from the cluster once added.
When adding ClickHouse® Keeper, MergeTree tables are automatically converted to replicated tables (for example, ReplicatedMergeTree). Learn more about replicated tables in the Replicated* table engines guide of the ClickHouse® documentation.
-
In the Control panel, in the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Go to the database cluster page → Settings tab.
-
In the Cluster block, click Add ClickHouse Keeper.
-
Optional: change the name of the node group.
-
Select a configuration line.
-
If you selected a line with custom configurations, select a disk type and specify the number of vCPUs, RAM size, and disk size.
-
If you selected a line with fixed configurations, select a configuration.
-
Click Save.
Delete shard
Deleting a shard will delete all data on that shard.
You can delete a shard from the cluster if it is not the only shard.
-
In the Control panel, in the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Go to the cluster page → Settings tab.
-
In the menu of the shard, select Delete.
-
Enter the shard name to confirm.
-
Click Delete.
Scale node group
Active connections to the nodes will be interrupted during the node group scaling process.
-
In the Control panel, in the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Go to the database cluster page → Settings tab.
-
In the menu of the node group, select Change configuration.
-
Optional: change the node group name.
-
Scale the node group. You can:
- change the configuration within lines with fixed configurations: you can only select a configuration with a disk size larger than in 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.
-
Click Save.
ClickHouse® is a registered trademark of ClickHouse, Inc. https://clickhouse.com.