Skip to main content

ClickHouse® cluster fault tolerance

The following factors affect ClickHouse® cluster fault tolerance:

Data replication

Replication is supported only for replicated tables. For more information about replicated tables, see the Replicated* table engines guide in the ClickHouse® documentation.

To ensure data replication and make creating replicated tables available, the cluster must consist of:

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 tables (for example, ReplicatedMergeTree). When new nodes are added to such a cluster, they automatically synchronize with existing replicas in the shard.

Node allocation type

The node allocation type in a cluster depends on:

You can view the list of pools and segments in the Selectel infrastructure table of the Locations: countries, regions, availability zones, pools, and data center addresses guide.

Four node allocation types are available:

  • Single-Segment;
  • Multi-Segment;
  • Single-AZ;
  • Multi-AZ.

Nodes are placed in one segment of a single-AZ pool. Applicable to:

  • for clusters consisting of one shard with one node;
  • shards with multiple nodes if the cluster is located in a pool that consists of one segment;
  • shards with multiple nodes in HighFreq line configurations.
note

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 contain up to ten nodes. While a node is being added, the other shard nodes will continue to work for read and write operations.

  1. If the cluster consists of only one shard with one node, add ClickHouse® Keeper.
  2. In the Control panel, in the top menu, click Products and select Cloud Databases.
  3. Open the Active tab.
  4. Open the cluster page → Settings tab.
  5. In the shard menu, select Change node count.
  6. Open the Add tab.
  7. Specify the new number of nodes in the shard. If there are no available 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.
  8. Click Save.

Delete a node

carefully

Deleting a node will delete all data stored on that node.

During the deletion process, other shard nodes will continue to work for read and write operations. The public IP address assigned to the node will be deleted.

  1. In the Control panel, in the top menu, click Products and select Cloud Databases.
  2. Open the Active tab.
  3. Open the cluster page → Settings tab.
  4. In the shard menu, select Change node count.
  5. Open the Delete tab.
  6. Select the node you want to delete. At least one node must remain in the shard. You cannot delete all nodes from a shard.
  7. Click Save.

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