ApsaraDB for ClickHouse clusters include a Classic Load Balancer (CLB) instance by default to provide efficient load balancing and automatic failover. The CLB instance performs health checks and distributes traffic to healthy nodes to ensure high availability (HA). Mounting a CLB instance is a paid service. If you do not need this feature, you can release the instance. To ensure service reliability, we recommend that you do not release the CLB instance.
Precautions
For an ApsaraDB for ClickHouse Community-compatible Edition cluster created after December 1, 2021, a CLB instance is attached by default and you are billed for the instance. For more information about billing, see Billing of dependent services.
Release a CLB instance.
Before you release a CLB instance, ensure that your Alibaba Cloud account has no overdue payments. Otherwise, the release fails, and the cluster remains in the CLB Being Released state.
After you release the CLB instance for an ApsaraDB for ClickHouse Community-compatible Edition cluster, billing for the CLB instance stops at the start of the next hour.
Releasing or remounting a CLB instance changes the port number used to connect to the cluster over a Virtual Private Cloud (VPC). You must update the port number in your application after you release or remount a CLB instance.
NoteYou can view the port number for the VPC connection in the Network Information section on the Cluster Information page.
When you mount a CLB instance, the cluster automatically creates a new one. You cannot use an existing CLB instance.
In the CLB console, you can find the CLB instance bound to your ApsaraDB for ClickHouse cluster by filtering by tags. The tag key is
managedby, and the tag value is your ApsaraDB for ClickHouse cluster ID.
The default CLB instance type for an ApsaraDB for ClickHouse Community-compatible Edition cluster is
slb.s1.small. For information about the performance of this instance type, see CLB instance types.A CLB instance has a fixed bandwidth limit. You can view the bandwidth limit on the Instance Management page of the CLB console. The bandwidth limit cannot be increased by upgrading the instance type. If burst traffic exceeds the limit, packet loss may occur. If this limit does not meet your read and write throughput requirements, we recommend that you read from and write to nodes by using direct connections.
Overview
Classic Load Balancer (CLB) is a service that distributes inbound traffic across multiple backend ECS instances based on forwarding policies. CLB enhances the service capabilities and availability of your applications. For more information about CLB, see What is Classic Load Balancer?.
CLB status | Description |
Mounted |
|
Released |
|
Release a CLB instance
Check for overdue payments in your Alibaba Cloud account.
Ensure your Alibaba Cloud account has no overdue payments before you release the CLB instance. If your account has overdue payments, the release fails and the cluster remains in the CLB Being Released state.
If your Alibaba Cloud account has an overdue payment, top up your account before you proceed.
Log on to the ApsaraDB for ClickHouse console.
In the upper-left corner of the page, select the region where the target cluster resides.
On the Clusters page, click the Clusters of Community-compatible Edition tab.
Click the ID of the target cluster to go to the Cluster Information page.
In the Network Information section, click Release CLB Instance next to VPC Endpoint.
Read the information in the dialog box and click OK.
The release is complete when the cluster status changes from CLB Being Released to Running.
ImportantReleasing the CLB instance changes the port for VPC connections, which can cause client connection failures. After the release, you must update the port number in your application. You can find the new port number in the Network Information section on the Cluster Information page.
Mount a CLB instance
Log on to the ApsaraDB for ClickHouse console.
In the upper-left corner of the page, select the region where the target cluster resides.
On the Clusters page, click the Clusters of Community-compatible Edition tab.
Click the ID of the target cluster to go to the Cluster Information page.
In the Network Information section, click Mount CLB Instance next to VPC Endpoint.
Read the information in the dialog box and click OK.
The mount is complete when the cluster status changes from The CLB instance is being mounted. to Running.
ImportantMounting the CLB instance changes the port for VPC connections, which can cause client connection failures. After the mount, you must update the port number in your application. You can find the new port number in the Network Information section on the Cluster Information page.
Read and write with direct connections
Query the IP addresses of nodes.
SELECT * FROM system.clusters;View the port mapping.
You must map the ports for CLB connections to the ports for direct node connections.
CLB port
Node port
9000
3003
3306
3003
8443
3006
9004
3005
8123
3002
Connect to the database by using a node's IP address and port.
(Optional) Configure load balancing.
If your cluster has multiple replicas or nodes and does not use a CLB instance, you must configure load balancing at the application layer.
Execute read or write operations.
In this write mode,
SELECTandINSERToperations are executed on the currently connected node. DDL operations, such asCREATE,DROP, andALTER, are automatically distributed to all nodes.
FAQ
Cluster stuck in the CLB Being Released state
If your cluster is stuck in the CLB Being Released state, check for overdue payments in your Alibaba Cloud account. If so, the release process automatically completes after you top up your account.