Scale a ClickHouse cluster
You can scale a ClickHouse cloud database cluster by:
-
changing the number of shards in the cluster — add or remove a shard;
-
scaling node groups — shard and ClickHouse Keeper:
- select a configuration only with a disk size larger than in the previous configuration;
- increasing the number of vCPUs, RAM, and disk size in a lineup with custom configurations;
- choosing a configuration from another lineup, provided that the disk type matches and the disk size is larger.
Add a shard
You can add only one shard at a time. The cluster can contain no more than ten shards.
-
If the cluster consists of only one shard with one node, add ClickHouse Keeper.
-
In the Dashboard, on the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Open 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 lineup with custom configurations, select a disk type and specify the number of vCPUs, RAM size, and disk size.
-
If you selected a lineup 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 Connect public access checkbox. A separate public IP address will be assigned to each shard node.
If the cluster subnet does not meet the requirements, public access cannot be enabled. You can prepare a private subnet and assign a public IP address after adding the shard.
-
Optional: specify the shard weight. Values from 0 to 65535 are available.
-
Click Save.
Add ClickHouse Keeper
When adding ClickHouse Keeper, MergeTree tables will be converted to replicated tables (for example, ReplicatedMergeTree). Read more about replicated tables in the Replicated* table engines section of the ClickHouse documentation.
The ClickHouse Keeper node group cannot be removed from the cluster once added.
- In the Dashboard, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the database cluster page → Settings tab.
- In the Cluster block, click Add ClickHouse Keeper.
- Optional: change the node group name.
- Select a configuration line.
- If you selected a lineup with custom configurations, select a disk type and specify the number of vCPUs, RAM size, and disk size.
- If you selected a lineup with fixed configurations, select a configuration.
- Click Save.
Remove a shard
Removing a shard will delete all data on that shard.
You can remove a shard from a cluster if it is not the only shard.
- In the Dashboard, on the top menu, click Products and select Managed Databases.
- Open the Active tab.
- Open the cluster page → Settings tab.
- In the menu of the shard, select Delete.
- Enter the shard name to confirm.
- Click Delete.
Scale a node group
Scale a node group when user activity is at its lowest.
-
In the Dashboard, on the top menu, click Products and select Managed Databases.
-
Open the Active tab.
-
Open 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:
- select a configuration with a disk size larger than in the previous configuration; ;
- increase the number of vCPUs, RAM, and disk size in a lineup with custom configurations;
- choose a configuration from another lineup, provided that the disk type matches and the disk size is larger.
-
Click Save.