Release and mount a CLB instance

更新时间:
复制 MD 格式

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.

    Note
    • You 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

  • CLB is a network-layer dependency that provides VPC connection services by binding a domain name to the IP addresses of ClickHouse nodes.

    Note

    If you use a public endpoint to connect to your ClickHouse cluster after you mount a CLB instance, the same CLB instance handles both public and VPC traffic.

  • After a CLB instance is mounted, the ClickHouse cluster supports failover. CLB distributes traffic across cluster nodes and performs health checks on them.

    Note

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

Released

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

  • After the CLB instance is released, the cluster stops performing health checks at the request routing layer. This may route requests to unavailable nodes and cause read and write failures.

Release a CLB instance

  1. 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.

  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 resides.

  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 next to VPC Endpoint.

  7. 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.

    Important

    Releasing 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

  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 resides.

  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 next to VPC Endpoint.

  6. 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.

    Important

    Mounting 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

  1. Query the IP addresses of nodes.

    SELECT * FROM system.clusters;
  2. 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

  3. Connect to the database by using a node's IP address and port.

  4. (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.

  5. Execute read or write operations.

    In this write mode, SELECT and INSERT operations are executed on the currently connected node. DDL operations, such as CREATE, DROP, and ALTER, 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.