Resource relationships in Managed Service for ClickHouse®
The main entity used in Managed Service for ClickHouse® is a database cluster.
Each cluster consists of one or more DB hosts, which are virtual machines with ClickHouse® DBMS servers deployed. Cluster hosts may reside in different availability zones and even different availability regions. You can learn more about Yandex Cloud availability zones in Platform overview.
A cluster with multiple ClickHouse® hosts is natively fault-tolerant, because ClickHouse® hosts can step in for one another as the cluster’s primary replica. To manage replication and query distribution across ClickHouse® hosts, you can use a coordination service, ClickHouse® Keeper or ZooKeeper. Depending on the selected tool, the cluster will consist of:
-
Only ClickHouse® hosts with ClickHouse® Keeper support
-
ClickHouse® hosts and individual ClickHouse® Keeper hosts
-
ClickHouse® hosts and individual ZooKeeper hosts
The minimum number of ClickHouse® hosts per cluster depends on the following:
-
-
At least three hosts for non-replicated SSDs (
network-ssd-nonreplicated). -
At least two hosts for local SSDs (
local-ssd). -
At least one host for the following disk types:
- Network HDDs (
network-hdd). - Network SSDs (
network-ssd). * Ultra high-speed network SSDs with three replicas (network-ssd-io-m3).
- Network HDDs (
-
-
Cluster sharding. When sharding is enabled, you need to multiply the minimum number of hosts for the selected disk type by the number of shards.
For more information on the features and limitations of sharding in ClickHouse®, see this article.
A cluster with a single ClickHouse® host is not fault-tolerant.
To implement fault-tolerance in an existing cluster with a single ClickHouse® host:
- Add at least three ClickHouse® Keeper or ZooKeeper hosts to the cluster to manage replication.
- Add ClickHouse® hosts to your cluster to distribute replicas among them.
This will make your cluster fault-tolerant.
When creating a cluster, specify:
-
Host class: VM template for deploying the cluster hosts. For a list of available host classes and their specs, see Host classes.
-
Environment: Environment where the cluster will be deployed:
PRODUCTION: For stable versions of your applications.PRESTABLE: For testing purposes. The prestable environment is similar to the production environment and likewise covered by an SLA, but it is the first to get new features, improvements, and bug fixes. In the prestable environment, you can test new versions for compatibility with your application.
You should also specify the host class when creating a shard.
A cluster created in a folder can be accessed by all VMs connected to the same cloud network. For more information about networking, see the Virtual Private Cloud documentation.
Alert
The service can automatically access the system and diagnostic information of your databases to build monitoring charts and maintain your cluster health. The service never queries or uses the data you saved to the database.
Be mindful of what is what is controlled by the service, and what by the Yandex Cloud customer. Understanding these control zones will help you use your cloud resources effectively and avoid potential database-related problems. For more information, see Zones of control between managed database (MDB) service users and Yandex Cloud.
ClickHouse® is a registered trademark of ClickHouse, Inc