When you need to adjust the configurations or scale of an ApsaraDB for ClickHouse Community-compatible Edition cluster to cope with the continuous changes of your business, you can modify the cluster configurations. You can scale up, scale down, scale out, or scale in the ApsaraDB for ClickHouse Community-compatible Edition cluster to help your business achieve an optimal balance between costs and performance.
Overview
Scale-out and scale-in require more time than scale-up and scale-down. Therefore, scale-up and scale-down result in less impact on your business. If your cluster performance cannot meet your business requirements, we recommend that you perform scale-up operations.
Operation | Scenario | Description | Impact | Reference |
Scale-up or scale-down | You need to increase or decrease the resources of each node when the CPU, memory, and disk resources are insufficient or redundant. | The node specifications, storage capacity, and ZooKeeper specifications of an ApsaraDB for ClickHouse Community-compatible Edition cluster are increased or decreased. This improves the computing power, storage capacity, and distributed collaboration of the cluster. Note The storage capacity cannot be scaled down. The following content describes how to reduce the storage capacity:
| When you upgrade the storage type and increase the storage capacity of an ApsaraDB for ClickHouse Community-compatible Edition cluster created after December 1, 2021, the cluster is not affected. However, if you change the cluster specifications and ZooKeeper specifications, the cluster will be restarted. Important
| |
Scale-out |
| Migration-based scale-out: The number of ApsaraDB for ClickHouse Community-compatible Edition cluster nodes is increased. This improves the computing power of the cluster and migrates and redistributes the existing data. Simple scale-out: The number of ApsaraDB for ClickHouse Community-compatible Edition cluster nodes is increased. This improves the computing power of the cluster. Data is directly written to local tables and does not need to be balanced among cluster nodes before and after scaling. | If you scale out an ApsaraDB for ClickHouse Community-compatible Edition cluster, you cannot write data to the cluster during the predefined time window for data write suspension until the scale-out is complete. | |
Scale-in |
| The number of ApsaraDB for ClickHouse Community-compatible Edition cluster nodes is decreased. This reduces costs. Important The data of undeployed nodes will be lost. | An ApsaraDB for ClickHouse Community-compatible Edition cluster supports read-only operations during a cluster scale-in. You can write data to the cluster only after the cluster scale-in is complete. |
Prerequisites
Your cluster is in the Running state.
Your account has no unpaid renewal orders for the cluster.
NoteTo complete the payment of an unpaid order or cancel the order, perform the following steps: Log on to the ApsaraDB for ClickHouse console and choose Expenses > Expenses and Costs. In the left-side navigation pane, click Orders. On the page that appears, complete the payment of the order or cancel the order.
Usage notes
Scale-up and scale-down: Only ApsaraDB for ClickHouse Community-compatible Edition clusters created after December 1, 2021 allow you to change ZooKeeper specifications. For more information about fees of different ZooKeeper specifications, see Fees of different ZooKeeper specifications for ApsaraDB for ClickHouse Community-compatible Edition clusters.
Scale-out and scale-in:
When the system migrates MergeTree tables during a cluster scale-out, the existing table data is written to a new cluster and automatically redistributed.
When the system migrates non-MergeTree tables such as external tables and log tables during a cluster scale-out, only the table schemas are migrated and data is not migrated. When the system migrates materialized views during a cluster scale-out, only the table schemas are migrated and data is not migrated.
Kafka and RabbitMQ tables cannot be migrated. You must delete these tables before you scale out or scale in a cluster.
After a cluster is scaled out, the IP addresses of the internal nodes change. If you want to write and query data based on the IP addresses of the nodes, you must obtain the CIDR block of the virtual private cloud (VPC) where the cluster is deployed. For more information, see Obtain the CIDR block of the VPC where a cluster is deployed.
If you want to undeploy specific nodes in a cluster, the cluster must be a large-storage cluster.
Fees: After you modify the cluster configurations, you are charged for the cluster based on the new configurations. The actual fees in the console shall prevail. For more information, see Billing details about specification changes.
Scale-up and scale-down
Log on to the ApsaraDB for ClickHouse console.
In the top navigation bar, select the region where the cluster that you want to manage is deployed.
On the Clusters page, click the Clusters of Community-compatible Edition tab.
Click Change Configurations in the Actions column of the cluster that you want to manage.
In the Change Configurations dialog box, select Scale Up or Scale Down, and then click OK.
On the page that appears, modify the configurations based on your business requirements.
NoteIf you modify the value of the Storage Capacity or Storage Type parameter, you cannot modify the value of the Specification parameter.
By default, clusters provide ZooKeeper with 4 cores and 8 GB of memory for free. On the Cluster Monitoring tab of the Monitoring and Alerting page, you can view metrics related to ZooKeeper to check whether resource bottlenecks exist. If the default specifications do not meet your business requirements, you can upgrade the specifications in a timely manner.
Click Buy Now and follow the on-screen instructions to complete the payment.
On the page that appears, click Go to the Console.
On the Clusters of Community-compatible Edition tab, view the state of the cluster in the Status column.
NoteIf you modify the storage capacity, the configuration modification immediately takes effect and the cluster is in the Running state.
If you modify the cluster and ZooKeeper specifications, the configuration modification requires 10 to 15 minutes to take effect. If the state of the cluster changes from Changing Specification to Running, the scale-up or scale-down is successful.
Scale-out and scale-in
Log on to the ApsaraDB for ClickHouse console.
In the top navigation bar, select the region where the cluster that you want to manage is deployed.
On the Clusters page, click the Clusters of Community-compatible Edition tab.
Click Change Configurations in the Actions column of the cluster that you want to manage.
In the Change Configurations dialog box, select Scale Out or Scale In and click OK.
In the scale-out or scale-in detection message, check whether the cluster is ready for a scale-out or scale-in.
NoteIf you select Scale Out, a migration-based scale-out will be performed by default. If you want to perform a simple scale-out, click Previous. In the Scale-out message, select Simple Expansion, and click Next. Then, the scale-out detection message appears.
If the message "The scale-out detection is successful" or "The scale-in detection is successful" is displayed, click Next.
If an error occurs during the cluster detection, modify the cluster configurations as prompted and click Retry Detection. After the detection is successful, click Next.
The following issues may cause a detection failure during a scale-out:
The unique distributed table is missing. No distributed table is created for a local table. You must create a distributed table for the local table.
More than one distributed table exists for a local table. Delete redundant distributed tables and retain only one distributed table for the local table.
Kafka and RabbitMQ tables exist. Delete these tables.
A Double-replica Edition cluster has non-
ReplicatedMergeTree
tables. Data is inconsistent between the replicas. This may cause issues during data migration when you scale out or scale in the cluster.The columns of the distributed tables are inconsistent with those of the local tables. This may cause issues during data migration when you scale out or scale in a cluster. You must make sure that the columns are aligned between the distributed tables and the local tables.
On the page that appears, configure the Nodes, Start Time for Stopping Data Writing, and End Time for Stopping Data Writing parameters based on your business requirements.
NoteDuring a scale-out or scale-in, data is migrated. To ensure successful data migration, the following requirements must be met when you configure the time period for data write suspension:
We recommend that you set the data write suspension time to at least 30 minutes.
A scale-out or scale-in task must end within five days after the task is created. Therefore, the date specified for End Time for Stopping Data Writing must be less than or equal to
the current date plus five days
.To reduce the impact of scaling on your business, we recommend that you configure a time period within off-peak hours.
Click Buy Now and follow the on-screen instructions to complete the payment.
On the Paid page, click Go to the Console.
On the Clusters of Community-compatible Edition tab, view the state of the cluster in the Status column. If the state of the cluster changes from Scale-out or Scale-in to Running, the scale-out or scale-in is successful.
A scale-out or scale-in requires more than 30 minutes to complete. The wait time depends on the amount of data. The specific task execution state is determined by the cluster state displayed in the ApsaraDB for ClickHouse console.