• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. User Guide
  4. Quick Start
  5. Creating an Enhanced Load Balancer

Creating an Enhanced Load Balancer

Scenarios

This section describes how to quickly create an enhanced load balancer and add or associate required resources.

Prepare for Creation

  • Select the network type.
    • Public network

      A public network load balancer provides load balancing through a public IP address and routes requests from the clients to backend servers over the Internet.

    • Private network

      A private network load balancer provides load balancing through a private IP address and routes requests from the clients to backend servers in a VPC.

  • Select a protocol.

    Protocol

    Description

    Application Scenario

    Layer 4

    TCP

    • Source IP address–based sticky sessions
    • Fast data transfer
    • Scenarios that require high reliability and data accuracy, such as file transfer, email sending and receiving, and remote login
    • Web applications with a number of concurrent connections or that require high performance

    Layer 4

    UDP

    • Low reliability
    • Fast data transfer

    Scenarios that focus on timeliness rather than reliability, such as video chat, game, and real-time financial market information push

    Layer 7

    HTTP

    • Cookie-based sticky sessions
    • X-Forward-For request header

    Applications in which the data content needs to be identified, such as web applications and mobile games

    Layer 7

    HTTPS

    • Unified certificate management

      You can upload certificates to the load balancer. The decryption operations are performed on the load balancer to reduce the work load of backend servers.

    • Multiple encryption protocols and cipher suites

    Applications that require encrypted transmission

Create a Load Balancer

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. Click Create Enhanced Load Balancer and specify the parameters by referring to Table 1.
    Table 1 Parameters for creating an enhanced load balancer

    Parameter

    Description

    Example Value

    Name

    Specifies the load balancer name.

    elb-yss0

    Network Type

    Specifies the network type of a load balancer. There are two options:

    • Public network: A public network load balancer provides load balancing through a public IP address and routes requests from the clients to backend servers over the Internet.
    • Private network: A private network load balancer provides load balancing through a private IP address and routes requests from the clients to backend servers in a VPC.

    Private network

    VPC

    Specifies the VPC where the load balancer works.

    You can select an existing VPC or create one.

    For more information about VPC, see the Virtual Private Cloud User Guide.

    N/A

    Subnet

    Specifies the subnet that the load balancer belongs to.

    N/A

    Private IP Address

    Specifies the IP address bound to the load balancer. You can select Automatically assign or Manually specify. If you select Manually specify, enter an IP address.

    Automatically assign

    EIP

    Specifies the public IP address bound to a load balancer for routing access requests to multiple backend servers over the Internet.

    You can use an existing EIP or apply for a new one.

    The following options are available:

    • New EIP: The system will assign a new EIP.
    • Use existing: You need to select an existing EIP.

    New EIP

    Bandwidth

    Specifies the bandwidth size in the unit of Mbit/s when a new EIP is used.

    10

    Description

    Provides supplementary information about the load balancer.

    N/A

    Tag

    Identifies load balancers so that they can be easily categorized and quickly searched. A tag consists of a tag key and a tag value. That is, you can distinguish cloud resources from two dimensions. The tag key marks a tag, and the tag value specifies specific tag content.

    11/11

  5. Click Create Now.
  6. Confirm the configurations and click Submit.

Add a Listener to an Enhanced Load Balancer

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. Locate the target load balancer and click its name.
  5. Under Listeners, click Add Listener. Configure the parameters by referring to Table 2, Table 3, and Table 4.
    Table 2 Parameters for configuring the listener

    Parameter

    Description

    Example Value

    Name

    Specifies the listener name.

    listener-pnqy

    Frontend Protocol/Port

    Specifies the protocol and port the load balancer uses to receive requests from the client and forward the requests to backend servers.

    The port numbers range from 1 to 65535, and the following protocols are supported:

    • HTTP
    • TCP
    • HTTPS (Termination)
    • UDP

    HTTP/80

    Redirect

    Redirects requests to an HTTPS listener when HTTP is used as the frontend protocol. If you have both HTTPS and HTTP listeners, you can use this feature to redirect the requests from the HTTP listener to the HTTPS listener to ensure security.

    N/A

    Redirected To

    Specifies the HTTPS listener to which requests are redirected. Select an HTTPS listener.

    N/A

    Server Certificate

    Specifies the certificate the server uses to authenticate the client when Frontend Protocol is set to HTTPS (Termination).

    N/A

    Enable SNI

    Specifies whether to enable the Server Name Indication (SNI) function when Frontend Protocol is set to HTTPS (Termination).

    SNI is an extension to Transport Layer Security (TLS) when a server uses multiple domain names and certificates. This function allows the client to submit the domain name information while sending an SSL handshake request. Once receiving the request, the load balancer queries the right certificate based on the domain name and returns it to the client. If no certificate is found, the load balancer will issue a default certificate.

    N/A

    SNI Certificate

    Specifies the certificate associated with the domain name when Frontend Protocol is set to HTTPS (Termination) and SNI is enabled.

    You can select an existing certificate or create one.

    N/A

    Advanced Settings

    Provides some advanced features. Two options are available, Default and Custom.

    Default

    Mutual Authentication

    Specifies whether to enable mutual authentication between the server and client. To enable mutual authentication, both server certificate and CA certificate are required. This feature can be enabled when HTTPS (Termination) is selected for Frontend Protocol.

    N/A

    CA Certificate

    Specifies the certificate the server uses to authenticate the client. This parameter is mandatory when Frontend Protocol is set to HTTPS (Termination) and mutual authentication is enabled.

    N/A

    Description

    Provides supplementary information about the listener.

    N/A

    Tag

    Adds tags to the listener. Each tag is a key-value pair, and the tag key is unique.

    11/11

    Table 3 Parameters for adding a backend server group

    Parameter

    Description

    Example Value

    Backend Server Group

    Specifies a group of servers with the same features.

    • Select Create new if you want to create a backend server group.
    • Select Use existing if you want to use an existing backend server group.

    Create new

    Name

    Specifies the backend server group name.

    server_group-sq4v

    Backend Protocol

    Specifies the protocol used by backend servers to receive requests.

    HTTP

    Load Balancing Algorithm

    Specifies the algorithm the load balancer uses to distribute traffic.

    • Weighted round robin: Connection requests are forwarded to different servers based on their weights, which indicate server processing performance. Backend servers with higher weights receive proportionately more requests, whereas equal-weighted servers receive the same number.
    • Weighted least connections: In addition to the weight assigned to each server, the number of connections processed by each backend server is also considered. Connection requests are forwarded to the server with the lowest connections-to-weight ratio.
    • Source IP hash: The source IP address of the request is input into a hash algorithm, and the resulting hash is used to identify an ECS in the static fragment table.
    NOTE:

    As access traffic changes, choose the most appropriate algorithm to improve load balancing.

    Weighted round robin

    Sticky Session

    Specifies whether to enable sticky sessions. After this feature is enabled, all requests from a client during one session are sent to the same backend server.

    NOTE:

    For HTTP and HTTPS listeners, enabling or disabling sticky sessions may cause few seconds of service interruption.

    N/A

    Sticky Session Type

    Specifies the sticky session type. The following options are available:

    • Source IP address: The hash of the source IP address of the request is used to identify a server in the static fragment table.
    • HTTP cookie: The load balancer generates a cookie after receiving a request from a client. All the subsequent requests with the cookie will be distributed to the same backend server for processing.
    • App cookie: This method relies on backend applications. All requests with the cookie generated by backend applications are distributed to the same backend server.
    NOTE:

    Source IP address is the only choice available when TCP is used as the frontend protocol. If HTTP or HTTPS (Termination) is selected as the frontend protocol, the sticky session type can be HTTP cookie or App cookie. Choose an appropriate sticky session type to better distribute access traffic and improve load balancing.

    Source IP address

    Cookie Name

    Specifies the cookie name. When App cookie is selected, you need to enter a cookie name.

    cookieName-qsps

    Description

    Provides supplementary information about the backend server group.

    N/A

    Table 4 Parameters for configuring a health check

    Parameter

    Description

    Example Value

    Enable Health Check

    Specifies whether to enable health checks.

    N/A

    Protocol

    Specifies the health check protocol. You can use either TCP or HTTP. Once you have selected a specific protocol, you cannot change it. If the frontend protocol is UDP, the health check protocol is UDP by default.

    HTTP

    Domain Name

    Specified the domain name in the health check request. The domain name can consist of digits, letters, hyphens (-), and periods (.), and must start with a digit or letter. The field is left blank by default and is available only when the health check protocol is HTTP.

    www.elb.com

    Port

    Specifies the health check port. The port numbers range from 1 to 65535.

    NOTE:

    If no health check port is specified, the port of each backend server is used. If a port is specified, it will be used for health checks.

    80

    Advanced Settings

    Provides some advanced features. Two options are available, Default and Custom.

    Default

    Interval (s)

    Specifies the maximum number of seconds between health checks.

    The value ranges from 1 to 50.

    5

    Timeout (s)

    Specifies the maximum number of seconds to wait for receiving the result of a health check. The value ranges from 1 to 50.

    10

    Check Path

    Specifies the health check URL. This parameter is valid when Protocol is set to HTTP. The value can contain 1 to 80 characters.

    /index.html

    Maximum Retries

    Specifies the maximum number of retries for the health check. The value ranges from 1 to 10.

    3

  1. Click Finish.
  2. Click OK.

Add a Whitelist

You can add a whitelist of specified IP addresses to control access to a listener.

For details, see Whitelist.

Adding the whitelist may cause risks. Once the whitelist is set, only the IP addresses specified in the whitelist can access the listener.

If access control is enabled but no whitelist is added, the listener cannot be accessed.

Add Backend Servers

You need to add backend servers to your load balancer so that it can distribute traffic to these servers.

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. Locate the target load balancer and click its name.
  5. Click Backend Server Groups, locate the target backend server group, and click its name.
  6. In the Basic Information area, click Add in the upper left corner of the server list.
  7. In the Add Backend Server dialog box, confirm the subnet, specify the backend port, and select target backend servers.
  8. Click OK.

Bind an EIP

You can bind an EIP to a load balancer to receive requests over the Internet.

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. Locate the target load balancer and click More > Bind EIP in the Operation column.
  5. In the Bind EIP dialog box, select an EIP and click OK.

Alternatively, click the load balancer name to view its basic information and then click Bind on the right of EIP.

Unbind an EIP

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. Locate the target load balancer and click More > Unbind EIP in the Operation column.
  5. Click Yes.

Alternatively, click the load balancer name to view its basic information and then click Unbind on the right of EIP.

Delete a Load Balancer

If you do not need a load balancer any longer, perform the following operations to delete it:

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. Locate the target load balancer and click More > Delete in the Operation column.
  5. In the Delete Load Balancer dialog box, click Yes.
NOTE:

If the load balancer has listeners, delete the listeners before deleting the load balancer.

Export Load Balancer Information

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Under Network, click Elastic Load Balancing.
  4. In the upper right corner of the load balancer list, click .