All Products
Search
Document Center

ApsaraDB for ClickHouse:Release and attach a CLB instance

Last Updated:Dec 02, 2025

A Classic Load Balancer (CLB) instance is attached to your ApsaraDB for ClickHouse cluster by default to provide efficient load balancing for large-scale data processing. After a CLB instance is attached, the cluster can perform automatic failover. The CLB instance performs health checks and distributes traffic to healthy nodes to ensure high availability (HA) for the cluster. Attaching a CLB instance is a paid service. If you do not need this feature, you can release the instance. To ensure service reliability, do not release the CLB instance.

Precautions

  • By default, a CLB instance is attached to an ApsaraDB for ClickHouse Community-compatible Edition cluster created after December 1, 2021. You are charged for the CLB instance. For more information about billing, see Billing of dependent services.

  • Releasing a CLB instance:

    • Before you release a CLB instance, make sure that your Alibaba Cloud account does not have an overdue payment. Otherwise, the release fails and the cluster remains in the Releasing CLB state.

    • After you release a CLB instance that is attached to an ApsaraDB for ClickHouse Community-compatible Edition cluster, billing for the CLB instance stops in the next hour.

  • If you release or reattach a CLB instance, the port number used to connect to the cluster over a virtual private cloud (VPC) changes. After you release or reattach the CLB instance, you must change the port number in your application.

    Note
    • You can view the port number for VPC connections in the Cluster Information section on the Network Information page.

    • When you attach a CLB instance, the cluster automatically creates a CLB instance. You cannot select a CLB instance that you have already created.

    • In the Server Load Balancer console, you can find the CLB instance that is attached to your ApsaraDB for ClickHouse cluster using tags to filter. The tag key is managedby and the tag value is your ApsaraDB for ClickHouse cluster ID.

  • The default instance type for a CLB instance created for an ApsaraDB for ClickHouse Community-compatible Edition cluster is slb.s1.small. For more information about the performance metrics of this instance type, see CLB instances.

  • A CLB instance has a fixed bandwidth limit. You can view the bandwidth value on the Instance Management page in the Server Load Balancer console. The bandwidth limit cannot be increased by upgrading the instance type. If the burst traffic per second exceeds the limit, packet loss may occur. If your read and write requirements are not met, you can read from and write to nodes using direct connections.

Overview

Server Load Balancer (SLB) is a traffic distribution service that forwards inbound traffic to multiple backend Elastic Compute Service (ECS) instances based on forwarding rules. SLB improves the service capability and availability of your applications. For more information about CLB, see What is Classic Load Balancer (CLB)?.

CLB status

Description

Attached

  • A CLB instance is a Network Layer dependency. It binds a domain name to the IP addresses of the ClickHouse nodes to provide VPC connection services.

    Note

    If you use the public endpoint to connect to an ApsaraDB for ClickHouse cluster after a CLB instance is attached, the CLB instance for the public endpoint is the same as the one in the VPC.

  • After a CLB instance is attached, the ClickHouse cluster gains failover capabilities. The CLB instance forwards and balances requests among the internal nodes of the cluster. It also performs health checks on backend nodes. If a node becomes unavailable, the CLB instance automatically isolates it and distributes traffic only to available nodes.

    Note

    If you have a single-replica cluster, the CLB instance ensures that requests are not routed to abnormal nodes. However, because your data is distributed across different nodes, the query results may be incomplete if a node is abnormal.

Released

  • After a CLB instance is released, the VPC connection service is disabled. The cluster performs simple load balancing for inbound traffic based on the public endpoint.

  • After a CLB instance is released, the ClickHouse cluster no longer performs health checks on nodes at the request routing layer. This may cause normal requests to be routed to unavailable nodes, resulting in read and write failures.

Release a CLB instance

  1. Make sure that your Alibaba Cloud account does not have an overdue payment.

    If your account has an overdue payment, the release fails and the cluster remains in the CLB Being Released state.

    You must add funds to your account before you proceed.

  2. Log on to the ApsaraDB for ClickHouse console.

  3. In the upper-left corner of the page, select the region where the target cluster is located.

  4. On the Clusters page, click the Clusters of Community-compatible Edition tab.

  5. Click the ID of the target cluster to go to the Cluster Information page.

  6. In the Network Information section, click Release CLB Instance to the right of VPC Endpoint.

  7. In the dialog box that appears, read the content and click OK.

    The CLB instance is released when the cluster status changes from CLB Being Released to Running.

    Important

    Releasing a CLB instance changes the port number used to connect to the cluster over a VPC. This causes client connections to the database service to fail. After you release the CLB instance, you must change the port number in your application. You can find the port number for VPC connections in the Network Information section on the Cluster Information page.

Attach a CLB instance

  1. Log on to the ApsaraDB for ClickHouse console.

  2. In the upper-left corner of the page, select the region where the target cluster is located.

  3. On the Clusters page, click the Clusters of Community-compatible Edition tab.

  4. Click the ID of the target cluster to go to the Cluster Information page.

  5. In the Network Information section, click Mount CLB Instance to the right of VPC Endpoint.

  6. In the dialog box that appears, read the content and click OK.

    The CLB instance is attached when the cluster status changes from The CLB instance is being mounted to Running.

    Important

    Attaching a CLB instance changes the port number used to connect to the cluster over a VPC. This causes client connections to the database service to fail. After you attach the CLB instance, you must change the port number in your application. You can find the port number for VPC connections in the Network Information section on the Cluster Information page.

Read from and write to nodes using direct connections

  1. Query the node IP addresses.

    SELECT * FROM system.clusters;
  2. View the port mappings.

    You must map the port number used for domain name connections to the port number for direct node connections. The mappings are as follows:

    CLB port

    Node port

    9000

    3003

    3306

    3003

    8443

    3006

    9004

    3005

    8123

    3002

  3. Connect to the database using the node IP address and port number.

  4. (Optional) Configure load balancing.

    If your instance has multiple replicas or nodes and you do not use a CLB instance for load balancing, you must configure load balancing for the nodes in your application.

  5. Execute write or query operations.

    In this mode, SELECT and INSERT operations are executed on the currently connected node. Data Definition Language (DDL) operations, such as CREATE, DROP, and ALTER, are automatically distributed to all nodes as distributed DDL operations.

FAQ

After a CLB is released, the cluster is stuck in the CLB Being Released state.

If the cluster remains in the CLB Being Released state after you release the CLB instance, check your Alibaba Cloud account for an overdue payment. If an overdue payment exists, the release process automatically completes after you add funds to your account.