All Products
Search
Document Center

Server Load Balancer:Create and manage an NLB instance

Last Updated:Sep 18, 2023

Network Load Balancer (NLB) instances receive requests from clients and forward requests to backend servers. This topic describes how to create and manage an NLB instance.

Prerequisites

  • A virtual private cloud (VPC) is created. For more information, see Create a VPC with an IPv4 CIDR block.

  • Before you create an NLB instance, make sure that the vSwitches in the zones where you want to create the NLB instance provide sufficient IP addresses. To create an NLB instance, make sure that at least five IP addresses are available in each vSwitch, including four IP addresses for health checks and one virtual IP address. If the number of IP addresses is insufficient, an error occurs and you cannot purchase an NLB instance.

  • The AliyunServiceRoleForNlb service-linked role is created within your Alibaba Cloud account. The first time you create an NLB instance, you must create this service-linked role to allow NLB to access other Alibaba Cloud resources such as elastic network interfaces (ENIs), elastic IP addresses (EIPs), and Internet Shared Bandwidth instances. For more information, see AliyunServiceRoleForNlb.

Create an NLB instance

  1. Log on to the NLB console.
  2. In the top navigation bar, select the region where the NLB instance is deployed.
  3. On the Instances page, click Create NLB.

  4. On the NLB (Pay-As-You-Go) International Site page, configure the following parameters.

    Parameter

    Description

    Region

    Select the region where you want to create the NLB instance.

    Network Type

    Select the network type of the NLB instance. The system allocates a public or private IP address to the NLB instance based on the network type.

    • Intranet: If you create an internal-facing NLB instance, a private IP address is assigned to each zone. In this case, the NLB instance is accessible only over the internal network.

    • Internet: If you create an Internet-facing NLB instance, a public IP address and a private IP address are assigned to each zone. Internet-facing NLB instances use EIPs to provide services over the Internet. If you create an Internet-facing NLB instance, you are charged instance fees and bandwidth or data transfer fees for the EIPs.

      • EIPs are used to provide services over the Internet and expose NLB instances to the Internet.

      • Private IP addresses can be used by NLB instances to communicate with Elastic Compute Service (ECS) instances in VPCs.

    Note
    • After the NLB instance is created, you can change the network type of the NLB instance as needed. For more information, see Change the network type of an NLB instance.

    • If an N LB instance is assigned an IPv4 address and an IPv6 address, the IPv4 address is used to provide services over the Internet. If you need to use the IPv6 address to provide services over the Internet, you must change the network type of the NLB instance. In this case, you are charged IPv6 gateway fees. For more information, see Billing rules.

    IP Version

    Select an IP version.

    • IPv4: If you select this option, the NLB instance can be accessed only by IPv4 clients.

    • Dual-stack Networking: If you select this option, the NLB instance can be accessed by IPv4 and IPv6 clients.

    VPC

    Select the VPC where you want to deploy the NLB instance.

    Zone

    Select zones and vSwitches.

    1. NLB supports multi-zone deployment. If the selected region supports two or more zones, you must select at least two zones to ensure high availability. No additional fee is charged by NLB.

    2. You must select a vSwitch for each zone of the NLB instance. If no vSwitch is available, create one as prompted.

    3. Optional: If you set Network Type to Internet, you must select an EIP for each zone of the NLB instance.

      • If no EIP is available, use the default setting Automatically assign EIP to allow the system to automatically create a pay-as-you-go (pay-by-data-transfer) EIP and associate the EIP with the NLB instance. The EIP uses BGP (Multi-ISP) lines and is protected by Anti-DDoS Origin Basic.

      • Alternatively, you can associate an existing EIP with the NLB instance.

        Important
        • You can associate only pay-as-you-go (pay-by-data-transfer) EIPs that are not associated with Internet Shared Bandwidth instances with an NLB instance.

        • The EIPs allocated to different zones of the same NLB instance must be of the same type.

    Associate with EIP Bandwidth Plan

    Specify whether to associate the NLB instance with an Internet Shared Bandwidth instance. If you select Associate with EIP Bandwidth Plan, you must select an Internet Shared Bandwidth instance. If no Internet Shared Bandwidth instance is available, click Purchase EIP Bandwidth Plan to purchase one. Then, return to the NLB buy page and click 刷新 to select the purchased Internet Shared Bandwidth instance.

    We recommend that you purchase a pay-as-you-go Internet Shared Bandwidth instance. For more information, see Create an Internet Shared Bandwidth instance.

    Note

    This parameter is available only if Network Type is set to Internet.

    Internet Billing Method

    Pay-By-Data-Transfer (default): The maximum bandwidth is not guaranteed and the value is for reference only. In scenarios where demand outstrips resource supplies, the maximum bandwidth may be limited. For more information about the billing of EIPs, see EIP billing.

    Note

    This parameter is available only if Network Type is set to Internet and Associate with EIP Bandwidth Plan is not selected.

    Instance Name

    Enter a name for the NLB instance.

    Resource Group

    Select the resource group to which the NLB instance belongs.

    Service-linked Role

    You must click Create Service-linked Role to create a service-linked role for NLB the first time you create an NLB instance.

  5. Click Buy Now and complete the payment as prompted.

  6. Return to the Instances page and select the region where the NLB instance is deployed to view the NLB instance.

Release an NLB instance

You can release NLB instances that are not in use to reduce costs. After you release an NLB instance, you are no longer charged for the NLB instance.

Warning

If you mapped a custom domain name to the domain name or IP address of an NLB instance and you want to release the NLB instance, we recommend that you map the custom domain name to the domain name or IP address of another NLB instance to prevent service interruptions.

If deletion protection is enabled for an NLB instance, you cannot release the NLB instance.

  1. Log on to the NLB console.
  2. In the top navigation bar, select the region where the NLB instance is deployed.
  3. On the Instances page, find the instance that you want to release and click 更多操作 > Release in the Actions column.

  4. In the Release Instance message, click OK.

References

Operation

Procedure

Change the name of an NLB instance

  1. On the Instances page, find the instance that you want to manage, move the pointer over the instance name, and then click the 修改实例名 icon.

  2. In the dialog box that appears, change the name of the instance and click OK.

Manage tags

Each tag consists of a key-value pair.

  • You can add up to 20 tags to an NLB instance.

  • The keys of tags that are added to an NLB instance must be unique.

Add tags

You can use tags to classify NLB instances by purpose or owner.

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

    • If no tag is added to the NLB instance, click Edit.

    • If a tag is added to the NLB instance, click Edit.

  2. In the Configure Tags dialog box, select or enter a key and a value. Then, click OK.

    You can also click the 删除 icon next to a tag to remove the tag from the NLB instance.

Filter by tag

You can filter NLB instances by tag.

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

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

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

Enable or disable cross-zone load balancing

After you enable cross-zone load balancing, NLB distributes network traffic across backend servers in different zones.

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

  2. On the Instance Details tab, you can enable or disable Cross-Zone Distribution in the Instance Property section.

Configure deletion protection

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

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

  2. On the Instance Details tab, click Enable Deletion Protection or Disable Deletion Protection in the Instance Property section.

    After deletion protection is enabled for an instance, you cannot release the instance. If you want to release the instance, you must first disable deletion protection.

Instance

Configure the configuration read-only mode

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

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

  2. On the Instance Details tab, click Enable Configuration Read-Only Mode or Disable Configuration Read-Only Mode in the Instance Property section.

Instance

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