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.
Log on to the CLB console.
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.
NoteEnsure 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.
NoteIf 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.
NoteThis 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.
NoteIf 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.
NoteFor 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.
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.
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.
Log on to the CLB console.
On the Instances page, find the instance that you want to release and choose .
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.
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.
NoteIf 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.
For more information about how to associate an EIP with a CLB instance, see Associate and manage an EIP.
For more information about how to associate an EIP with an ALB instance, see Change the network type of an ALB instance.
For more information about how to associate an EIP with an NLB instance, see Change the network type of an NLB instance.
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:
Add tags You can use tags to classify CLB instances by various dimensions, such as the purpose or owner.
Filter CLB instances by tag
Remove tags You can remove tags only from one CLB instance at a time.
|
Enable or disable deletion protection | You can enable deletion protection to prevent CLB instances from being accidentally released.
|
Enable or disable the configuration read-only mode | You can enable the configuration read-only mode to prevent CLB instances from being accidentally modified.
|
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 or 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:
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?
|
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
Product overview
For more information about CLB and the benefits of CLB, see What is CLB?
For more information about the features of CLB, see Features.
For more information about the use scenarios of CLB, see Scenarios.
User guides
If you want your internal-facing CLB instance to forward requests from the Internet, you can associate an EIP with the CLB instance. For more information, see Associate and manage an EIP.
API references:
CreateLoadBalancer: creates a CLB instance.
SetLoadBalancerStatus: enables or disables a CLB instance.
DeleteLoadBalancer: releases a pay-as-you-go CLB instance.
SetLoadBalancerDeleteProtection: enables or disables deletion protection for a CLB instance.
TagResources: creates tags and adds the tags to resources.
UntagResources: removes tags from resources.