All Products
Search
Document Center

Server Load Balancer:Create and manage a CLB instance

Last Updated:Jan 09, 2025

If you want to prevent single points of failure and improve service redundancy as well as stability, we recommend that you use Classic Load Balancer (CLB). CLB supports basic load balancing at Layer 4 and Layer 7. You can use a CLB instance to distribute requests to backend servers. This topic describes how to create and manage a CLB instance.

Create a CLB instance

A CLB instance is an entity that provides load balancing services. To use the CLB service, you must create a CLB instance.

  1. Log on to the CLB console.

  2. On the Instances page, click Create CLB. Configure the parameters as described in the following table, and click Buy Now.

    Parameter

    Description

    Region

    Select the region in which you want to create the CLB instance.

    Note

    Ensure that the CLB instance and the Elastic Compute Service (ECS) instances that you want to specify as backend servers belong to the same region.

    Zone Type

    Specifies whether the CLB instance is deployed in one zone or across multiple zones. A zone represents an Alibaba Cloud data center that contains a set of independent infrastructure resources. The infrastructure resources such as networks, power supply, and air conditioning in different zones are independent of each other. Therefore, if the infrastructure resources in one zone become unavailable, the other zones take over. Each zone belongs to a specific region. A region may contain one or more zones. For regions and zones in which CLB is available, see Regions in which CLB is available.

    • Single zone: The CLB instance is deployed only in one zone.

    • Multi-zone: The CLB instance is deployed across two zones. By default, network traffic is distributed to the primary zone. If the primary zone fails, the system automatically switches network traffic to the secondary zone and continues providing load balancing services. This ensures high service availability.

    Primary Zone

    Select a primary zone for the CLB instance. The primary zone is used to distribute network traffic.

    Backup Zone

    Select a secondary zone for the CLB instance. By default, network traffic is distributed to the secondary zone only if the primary zone fails.

    Note

    If you select Single zone, the Backup Zone parameter is dimmed.

    Instance Name

    Enter a name for the CLB instance.

    Instance Type

    You can create an Internet-facing CLB instance or an internal-facing CLB instance based on your business requirements. The system allocates a public or private IP address to the CLB instance based on the specified instance type. In this example, Internet is selected.

    • Internet: If you select this option, only a public IP address is allocated to the CLB instance. In this case, the CLB instance can provide services over the Internet.

    • Intranet: If you select this option, only a private IP address is allocated from the IP address pool of Alibaba Cloud to the CLB instance. In this case, the CLB instance can be accessed only over the internal network of Alibaba Cloud.

    For more information, see Network types.

    Instance Billing Method

    Select a metering method for the CLB instance. Valid values: Pay-By-CLCU and Pay-By-Specification. In this example, Pay-By-CLCU is selected. For differences between the pay-by-data-transfer and pay-by-specification metering methods, see Pay-as-you-go.

    Specification

    Select a specification for the CLB instance.

    The performance metrics of a CLB instance varies based on the instance specification. For more information, see Instance types.

    This parameter is available only if you set the Instance Billing Method parameter to Pay-By-Specification.

    Note

    This parameter is dimmed if you set the Instance Billing Method parameter to Pay-By-CLCU.

    Network Type

    This parameter is automatically set to VPC.

    This parameter is available only if you set the Instance Type parameter to Intranet.

    IP Version

    Select an IP version for the CLB instance. Valid values: IPv4 and IPv6.

    Note

    If you set the Network Type parameter to VPC, only IPv4 is supported.

    VPCId

    Select a virtual private cloud (VPC).

    This parameter is available only if you set the Instance Type parameter to Intranet.

    VswitchId

    Select a vSwitch.

    This parameter is available only if you set the Instance Type parameter to Intranet.

    Internet Data Transfer fee

    Select a metering method for Internet data transfers. Internet-facing CLB instances support the following metering methods:

    • By traffic

    • By bandwidth

    If the Instance Billing Method parameter is set to Pay-By-CLCU, only the By traffic option is supported.

    Note

    For an internal-facing CLB instance, this parameter does not take effect. You are not charged for data transfers.

    SLB bandwidth max

    Enter a bandwidth value or adjust the slider to specify a bandwidth value based on your business requirements.

    This parameter is available when Instance Type is set to Internet and Instance Billing Method is set to Pay-By-Specification, and Internet Data Transfer Fee is set to By bandwidth.

    Resource Group

    Select a resource group for the CLB instance.

    Quantity

    Specify the number of CLB instances that you want to purchase.

  3. On the Confirm Order page, review the configurations of the CLB instance, click Activate Now, and complete the payment.

Release a CLB instance

  • You can release a pay-as-you-go CLB instance immediately or at a scheduled time. After a CLB instance is released, the configurations and data are deleted and cannot be restored.

  • When you release an Internet-facing CLB instance, you can disassociate the public IP address from the CLB instance, convert it to an elastic IP address (EIP), and retain the EIP for future use.

  • Releasing a CLB instance does not affect any ECS instances that you use.

  • You cannot release CLB instances that have deletion protection enabled. To release a CLB instance that has deletion protection enabled, click Disable Deletion Protection on the Instance Details tab.

Warning
  • If a custom domain name is resolved to the IP address of your CLB instance, before you release the CLB instance, we recommend that you resolve the domain name to the IP address of another CLB instance. This helps you prevent service interruptions.

  • If your CLB instance is managed by another Alibaba Cloud service, such as Container Service for Kubernetes (ACK), services become unavailable after the CLB instance is released, and the released CLB instance cannot be restored.

  1. Log on to the CLB console.

  2. On the Instances page, find the instance that you want to release and choose 更多操作 > Release Settings.

    To release multiple CLB instances at a time, select the CLB instances that you want to release and click Release Settings below the CLB instance list.

  3. In the Release Settings panel, configure the parameters as described in the following table and click Next.

    Parameter

    Description

    Release

    Specify how you want to release the CLB instance. Valid values:

    • Release Now

    • Scheduled Release

    Release Time

    If you select Scheduled Release, this parameter is available and you must configure it.

    The CLB instance is released on the next hour but billing is stopped at the specified release time. For example, if you set the release time to 09:28:00 on May 19, 2022, billing is stopped at 09:28:00 on May 19, 2022 but the instance is released at 10:00:00 on May 19, 2022.

    Do you want to switch from public IP address to EIP and retain the EIP?

    If you select Release Now for a pay-as-you-go Internet-facing CLB instance, you can convert the public IP address of the CLB instance to an EIP and retain the EIP. The EIP can be associated with an instance in the region. For example, you can associate the EIP with an ALB instance or another CLB instance. In this case, the public IP address can remain unchanged when you migrate your service or application between different load balancing instances.

    You can select Do not Retain or Retain. The first time you retain an EIP, the service-linked role AliyunServiceRoleForSlbEipAccess is automatically created to allow CLB to access the EIP service.

    • Limitations on retaining an EIP

      • Only for an Internet-facing IPv4 CLB instance, an EIP can be retained. Internal-facing CLB instances and Internet-facing IPv6 CLB instances do not support this feature.

        Note

        If you release multiple CLB instances at a time and are not allowed to disassociate the public IP addresses from the CLB instances and retain EIPs, check whether an Internet-facing IPv6 or internal-facing CLB instance is included.

      • Retaining EIPs is not supported if you select Scheduled Release.

    • Impact on billing

      After you disassociate the public IP address from the CLB instance and retain an EIP, the EIP is still billed on a pay-as-you-go (pay-by-data-transfer) basis. The maximum bandwidth of a single EIP is 200 Mbit/s.

      • You can view the information and configurations of EIPs in the EIP console.

      • For more information about the billing of EIPs, see Pay-as-you-go.

    • What to do next

      After you retain an EIP, you can associate the EIP with an internal-facing instance in the region.

  4. Review the information and click OK.

Related Operations

Operation

Procedure

Manage tags

You can add tags to CLB instances to group the instances and facilitate instance management.

Each tag is a key-value pair. Take note of the following limitations before you use tags to manage CLB instances:

  • Tags cannot exist as an independent resource. If you create a tag, it must be added to an instance.

  • The key of each tag added to the same CLB instance must be unique. If you add a new tag that uses the same key as an existing tag, the new tag overwrites the existing tag.

  • You can add at most 20 tags to a CLB instance.

  • Tags cannot be used across regions. For example, tags that are created in the China (Hangzhou) region are not displayed in the China (Shanghai) region.

Add tags

You can use tags to classify CLB instances by various dimensions, such as the purpose or owner.

  1. On the Instances page, find the CLB instance that you want to manage, move the pointer over the 标签 icon in the Tag column, and click Edit.

  2. In the Configure Tags dialog box, enter a key-value pair or select an existing key-value pair from the drop-down list.

    You can manage all tags for your cloud resources in the Resource Management console. Click Tag Management to go to the Resource Management console and manage tags. For more information, see Add a custom tag.

  3. Click OK.

Filter CLB instances by tag

  1. On the Instances page, click Filter by Tag above the instance list.

  2. Select a tag key and a tag value from the drop-down list.

    Then, CLB instances that match the specified key-value pair are displayed.

  3. Optional. You can click Clear Filter Condition above the instance list to clear the filter conditions.

Remove tags

You can remove tags only from one CLB instance at a time.

  1. On the Instances page, find the CLB instance that you want to manage, move the pointer over the 标签 icon in the Tag column, and then click Edit.

  2. In the Configure Tags dialog box, find the tag that you want to remove, click the 删除 icon next to the tag, and click OK.

    After you remove a tag from a cloud resource, the system automatically deletes the tag within 24 hours if the tag is not added to other resources.

Enable or disable deletion protection

You can enable deletion protection to prevent CLB instances from being accidentally released.

  1. On the Instances page, find the CLB instance that you want to manage and click the instance ID.

  2. On the Instance Details tab, in the Basic Information area, click Enable Deletion Protection or Disable Deletion Protection.

    You cannot release a CLB instance for which deletion protection is enabled. To release such an instance, disable deletion protection first.

Enable or disable the configuration read-only mode

You can enable the configuration read-only mode to prevent CLB instances from being accidentally modified.

  1. On the Instances page, find the CLB instance that you want to manage and click the instance ID.

  2. On the Instance Details tab, in the Basic Information area, click Enable Configuration Read-only Mode or Disable Configuration Read-only Mode.

Start or stop a CLB instance

You can start or stop a CLB instance based on your business requirements. If a CLB instance is stopped, the CLB instance does not receive or forward requests.

On the Instances page, find the CLB instance that you want to manage, and click 更多操作 > Start or 更多操作 > Stop in the Actions column.

To start or stop multiple CLB instances at a time, select the desired CLB instances and click Start or Stop below the instance list.

Note

If you stop a running CLB instance and start it again, the EIP associated with the CLB instance does not change.

Release an idle CLB instance

Criteria for idle CLB instances

An idle instance is a pay-as-you-go CLB instance that remains idle for more than seven days and meets one of the following conditions:

  • The instance is in the Stopped state.

  • No listener is configured for the instance.

  • All listeners of the instance are stopped.

  • No backend servers are added to the instance.

  • The weights of all backend servers of the instance are 0.

Important

Idle CLB instances are still billed. Billing stops only after you release the instances. For more information, see Am I still charged after a CLB instance is stopped?

  1. In the left-side navigation pane, click Idle SLB Instances.

  2. On the Idle SLB Instances page, you can view all pay-as-you-go instances that remain idle for more than seven days.

  3. Click 设置 in the upper-right corner to specify the columns that you want to display, such as Region, IP Address, and Cause of Idleness.

  4. If you no longer need a CLB instance, click Release in the Actions column to release the CLB instance.

    Note

    Before you release a CLB instance, ensure that you no longer need it.

What to do next

Configure a listener to listen for connection requests and forward the requests to backend servers based on a specified scheduling algorithm.

References