All Products
Search
Document Center

Server Load Balancer:Create and manage a CLB instance

Last Updated:Mar 11, 2024

If you want to prevent single points of failures (SPOFs) while improving service redundancy and 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.

Prerequisites

Before you create a CLB instance, make sure that the preparations are complete. For more information, see Preparations.

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.

  3. On the CLB instance buy page, configure the parameters and click Buy Now. The following table describes the parameters.

    Parameter

    Description

    Region

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

    Note

    Make sure 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

    Specify whether to deploy the CLB instance 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.

    • 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

    The primary zone of the CLB instance. The primary zone is used to distribute network traffic.

    Backup Zone

    The secondary zone of the CLB instance. By default, network traffic is distributed to the secondary zone only if the primary zone fails.

    Instance Name

    Enter a name for the CLB instance.

    SLB Instance

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

    Specification

    Select a specification for the CLB instance.

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

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

    Note

    You can ignore this parameter if you set the Instance Billing Method parameter to Pay-By-CLCU.

    Network Type

    The network type of the CLB instance. Default value: VPC.

    This parameter is available only if you set the SLB instance 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.

    VPC ID

    Select a virtual private cloud (VPC).

    This parameter is available only if you set the SLB instance parameter to Intranet.

    Vswitch ID

    Select a vSwitch.

    This parameter is available only if you set the SLB instance 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 billing method of the CLB instance is pay-as-you-go, only the By traffic option is supported.

    Note

    For an internal-facing CLB instance, only By traffic is displayed. You are not charged for data transfers.

    Resource Group

    Select a resource group for the CLB instance.

    Quantity

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

  4. On the Confirm Order page, review the configurations of the CLB instance, select I have read and agree to Server Load Balancer Agreement of Service, and then complete the payment.

Enable or disable a CLB instance

You can enable or disable a CLB instance based on your business requirements. If a CLB instance is disabled, the CLB instance does not receive or forward requests.

  1. Log on to the CLB console.

  2. In the top navigation bar, select the region in which the CLB instance is deployed.

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

    To enable or disable multiple CLB instances at a time, select the CLB instances that you want to enable or disable and click Start or Stop below the instance list.

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 of the CLB instance are deleted and cannot be restored.

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, we recommend that you resolve the domain name to the IP address of another CLB instance before you release the current instance. This helps you prevent service interruptions.

  1. Log on to the CLB console.

  2. In the top navigation bar, select the region in which the CLB instance is deployed.

  3. 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 instance list.

  4. In the Release Settings panel, configure the parameters and click Next. The following table describes the parameters.

    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, you must configure this parameter.

    The system releases the CLB instance at 30-minute and hour marks. However, the billing of the CLB instance stops at the specified release time. For example, if you set the release time to 09:28:00, May 19, 2022, the billing of the CLB instance stops at 09:28:00 on May 19, 2022. However, the system releases the CLB instance at 09:30:00 on May 19, 2022.

  5. Review the information and click OK. In the Security Verification dialog box, enter the verification code that you received and click OK. The CLB instance is released.

Manage tags

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

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

  • Tags must be added to a CLB instance. Tags cannot exist as an independent resource.

  • The key of each tag added to a 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.

  • 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

  1. Log on to the CLB console.
  2. In the top navigation bar, select the region in which the CLB instance is deployed.

  3. On the Instances page, find the instance that you want to manage and modify the tag.

    • If no tag is added to the CLB instance, add a tag to the CLB instance. Move the pointer over the 标签 icon in the Tags column and click Edit.

    • If a tag is added to the CLB instance, move the pointer over the 标签 icon in the Tags column and click Edit.

  4. 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. You can click Tag Management to go to the Resource Management console and create tags. For more information, see Add a custom tag.

  5. 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 Tags column, and then click Edit.

  2. In the Configure Tags dialog box, find the tag that you want to remove and click the 删除 icon next to the tag. Then, 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.

What to do next

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

References