ClickHouse Node Groups
A Managed Databases for ClickHouse cluster consists of node groups:
- shards;
- ClickHouse Keeper — added automatically only if the cluster contains a shard with two or more nodes or multiple shards.
You can create a cluster from at least one shard with one node.
Shard
A shard is a group of replica nodes that stores data, processes requests, and participates in replication and sharding. Learn more about shards in the Table shards and replicas article in the ClickHouse documentation.
In Managed Databases for ClickHouse, a shard can consist of one or more nodes. The total number of nodes in a shard cannot exceed ten.
A cluster can have no more than ten shards.
Чтобы упростить работу with данными, шарды можно объединять in группы and размещать таблицы in нужной группе. Подробнее in инструкции Управление группами шардов.
Replication
Если шард состоит только из одной ноды, данные in нем не реплицируются. Чтобы обеспечить репликацию данных, добавьте in шард дополнительные ноды — реплики.
You can create a fault-tolerant cluster with replicas or add nodes to an existing cluster.
Sharding
When sharding is used, data is divided into parts and distributed across different shards. This allows for parallel request processing.
Sharding is available only if the cluster has more than one shard. You can specify the number of shards when creating a cluster or add shards to an existing cluster.
To start sharding in a cluster, create a distributed table. Learn more about distributed tables in the Distributed table engine article in the ClickHouse documentation.
Shard weight
Каждый шард может иметь вес — долю данных, которую он получит при их распределении по шардам. Данные распределяются пропорционально весам всех шардов in кластере. Чем выше вес шарда, тем больше данных in него будет записываться. Доступные значения веса — от 0 до 65535.
For example, in a cluster with two shards: shard1 with a weight of 70 and shard2 with a weight of 100. The total sum of weights in the cluster is 70 + 100 = 170. shard1 will receive (70 / 170) × 100% = 41% of the data. shard2 will receive (100 / 170) × 100% = 59% of the data.
ClickHouse Keeper
ClickHouse Keeper is a group of nodes responsible for data consistency, replica synchronization, and executing distributed DDL queries. Learn more about ClickHouse Keeper in the ClickHouse Keeper article in the ClickHouse documentation.
A ClickHouse Keeper node group is mandatory for all cluster configurations except single-node ones. This node group is added automatically when creating a cluster if it contains a shard with two or more nodes or multiple shards. You can also add ClickHouse Keeper after creating a cluster.
Группа нод ClickHouse Keeper всегда состоит из трех нод. Изменить количество нод in этой группе нельзя. Вы можете изменить конфигурацию ClickHouse Keeper — подробнее in инструкции Масштабировать кластер ClickHouse.