Cluster management¶
If you're on an Enterprise plan with dedicated infrastructure and have access to the private beta, you can manage your ClickHouse® cluster replicas directly from the Plan & Billing page. This allows you to horizontally scale your cluster by adding or removing replicas and controlling how read and write workloads are distributed across them.
Access Cluster Management¶
To manage your cluster replicas:
- Navigate to Organization settings from the sidebar.
- Go to the Plan & Billing section.
This opens the cluster management interface where you can view your current replicas and their configurations.
Understanding replica configuration¶
Each replica in your cluster has the following configuration:
| Setting | Description |
|---|---|
| Read weight | Controls the proportion of query traffic this replica receives. Valid range: 0-65535. |
| Write weight | Controls whether this replica handles data ingestion. Valid range: 0-65535. |
| CPUs | Number of virtual CPUs allocated to this replica. |
| Memory | Amount of memory allocated to this replica in gigabytes. |
Managing a Cluster¶
Cluster management is currently in private beta for Enterprise customers on dedicated infrastructure. Contact support to request access for your cluster.
Cluster operations like adding, removing or rebalancing replica weights may take a few minutes to complete. During this time, no other operations can be performed on your cluster. However, the cluster will continue to operate normally while operations are in progress.
Add a replica¶
To add a new replica to your cluster:
- In the cluster management interface, select Add new replica.
- Configure the Read and Write weights
- Select the CPU and memory configuration from the dropdown.
- Review the cost impact shown below the configuration.
- Select Add replica.
Cost implications¶
Adding replicas increases your monthly credit consumption. The exact cost depends on the CPU and memory configuration you select. Cost estimates are displayed in the interface before you add a replica.
Remove a replica¶
To remove a replica from your cluster:
- In the cluster management interface, locate the replica you want to remove.
- Click the × icon next to the replica.
- Adjust the replica weights to redistribute traffic across remaining replicas.
- Confirm the removal by selecting Delete replica.
Removing a replica may affect traffic distribution and cluster stability, so make sure you reassign its weights to other replicas to maintain performance and that the remaining replicas can handle the load.
Rebalance traffic across replicas¶
You can control how your workload is distributed across replicas by adjusting their weights:
- Modify the Read weights to control query traffic distribution.
- Adjust Write weights to control which replicas handle data ingestion.
- Select Save changes to apply the new configuration.
How Weight Distribution Works¶
Weights determine the proportional distribution of traffic across replicas using a weighted round-robin approach:
- Read weights: Query traffic is distributed proportionally based on each replica's read weight relative to the total of all read weights. At least one replica must have a non-zero read weight. If a replica has a read weight of 0, it will not receive any query traffic.
- Write weights: Currently, only one replica can have a non-zero write weight (multi-writer support coming in the future). The ingestion traffic will be routed to the replica with non-zero write weight.
- Valid range: Each weight must be between 0 and 65535.
- Required minimums: At least one replica must have a non-zero read weight, and exactly one replica must have a non-zero write weight.
Weight distribution examples¶
Read traffic distribution¶
- Example 1: equal distribution of query traffic across replicas (useful when all replicas have the same size)
replica-a [R: 1], replica will receive 50% of query trafficreplica-b [R: 1], replica will receive 50% of query traffic
- Example 2: non-equal distribution of query traffic across replicas (useful when replicas have different sizes)
replica-a [R: 1], replica will receive 33% of query traffic (1/3)replica-b [R: 2], replica will receive 67% of query traffic (2/3)
- Example 3: non-equal distribution of query traffic across replicas (useful when replicas have different sizes)
replica-a [R: 10], replica will receive 17% of query traffic (1/6)replica-b [R: 20], replica will receive 33% of query traffic (2/6)replica-c [R: 30], replica will receive 50% of query traffic (3/6)
Write traffic distribution¶
- Example 1:
replica-a [R: 1], replica will receive 100% of ingestion trafficreplica-b [R: 0], replica will receive 0% of ingestion trafficreplica-c [R: 0], replica will receive 0% of ingestion traffic
Example cluster traffic distribution¶
| Replica name | Read weight | Write weight | Explanation |
|---|---|---|---|
| replica-a | 0 | 1 | Receive no query traffic and 100% of ingestion traffic |
| replica-b | 1 | 0 | Receive 17% of query traffic and no ingestion traffic |
| replica-c | 1 | 0 | Receive 17% of query traffic and no ingestion traffic |
| replica-d | 2 | 0 | Receive 33% of query traffic and no ingestion traffic |
| replica-e | 2 | 0 | Receive 33% of query traffic and no ingestion traffic |