ClickHouse® Cluster Fault Tolerance
ClickHouse® cluster fault tolerance is affected by:
- availability of data replication;
- node allocation type.
Data replication
Replication is supported only for replicated tables. Read more about replicated tables in the ClickHouse® documentation Replicated* table engines.
To ensure data replication and enable the creation of replicated tables, the cluster must consist of:
- at least one shard with two or more nodes;
- and node groups ClickHouse® Keeper.
You can specify the number of nodes in a shard when creating a cluster. You can also add or delete nodes in a shard of an existing cluster. The maximum number of nodes in a shard is ten.
If you specify more than one node in a shard when creating a cluster, ClickHouse® Keeper will be added automatically.
To add nodes to an existing cluster consisting of one shard with one node, you must first add ClickHouse® Keeper. When adding ClickHouse® Keeper, existing MergeTree tables are automatically converted to replicated ones (for example, to ReplicatedMergeTree). When new nodes are added to such a cluster, they are automatically synchronized with existing replicas in the shard.
Node allocation type
The node allocation type in a cluster depends on:
- the number of nodes in shards;
- the type of pool where the cluster is located;
- the number of segments in the pool;
- configuration line.
You can view the list of pools and segments in the Servercore Infrastructure table of the Locations: countries, regions, availability zones, pools, and data center addresses instruction.
Four node allocation types are available:
- Single-Segment;
- Multi-Segment;
- Single-AZ;
- Multi-AZ.
Single-Segment
Multi-Segment
Single-AZ
Multi-AZ
ноды размещаются in одном сегменте однозонального пула. применимо:
- clusters consisting of one shard with one node;
- shards with multiple nodes, if the cluster is located in a pool that consists of a single segment;
- shards with multiple nodes in HighFreq configuration lines.
For example, you have created a cluster in the ru-2 pool with ClickHouse® Keeper and a shard with two nodes. For both groups of nodes, you used configurations from the HighFreq line. All nodes will be placed in the same pool segment, for example, ru-2c.
Add a node
A shard can have no more than ten nodes. During the node addition process, other nodes in the shard will continue to operate in read/write mode.
- 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 cluster page → Settings tab.
- In the shard menu , select Change node count.
- откройте вкладку добавление.
- Specify the new number of nodes in the shard. If there are no free IP addresses in the subnet to which the cluster is connected, you cannot add a node. Each new node occupies a new IP address in the subnet.
- Click Save.
Delete a node
Deleting a node will remove all data located on that node.
During the deletion process, other nodes in the shard will continue to operate in read/write mode. The public IP address assigned to the node will be deleted.
- In the Dashboard, click Products on the top menu and select Managed Databases.
- откройте вкладку активные.
- откройте страницу кластера → вкладка настройки.
- In the shard menu , select Change node count.
- откройте вкладку удаление.
- Select the node you want to delete. At least one node must remain in the shard. You cannot delete all nodes from a shard.
- Click Save.
ClickHouse® is a registered trademark of ClickHouse, Inc. https://clickhouse.com.