Help Center/ Elastic Load Balance/ User Guide/ User Guide for Dedicated Load Balancers/ Backend Server/ Adding Backend Servers in a Different VPC from a Load Balancer
Updated on 2024-11-14 GMT+08:00

Adding Backend Servers in a Different VPC from a Load Balancer

Dedicated load balancers can distribute traffic across cloud servers and on-premises servers. You can add ECSs, BMSs, or supplementary network interfaces in the VPC where the dedicated load balancer is created. After enabling IP as a backend, you can also add the IP addresses of servers in other VPCs or in your on-premises data center.

In this way, incoming traffic can be flexibly distributed to cloud servers and on-premises servers.

Figure 1 Routing requests to cloud and on-premises servers

Notes and Constraints

  • IP as a Backend cannot be disabled after it is enabled.
  • Before forwarding requests to servers in other VPCs, ensure that the target VPC can communicate with the VPC where the load balancer is created.
  • Only private IPv4 addresses can be added as backend servers.
  • A maximum of 100,000 concurrent connections can be established with a backend server that is added by using its IP address.
  • If you add IP addresses as backend servers, the source IP addresses of the clients cannot be passed to these servers. Install the TOA module to obtain source IP addresses.

Distributing Traffic Across IP as Backend Servers

With a wide variety of networking services, you can flexibly connect VPCs in the same region, in different regions, or in different accounts.

After VPCs where IP as backend servers are running are connected, traffic can be distributed across these backend servers.

For details about the network connectivity options, see VPC Connectivity Options.
Table 1 Distributing traffic across IP as backend servers

Where Servers Are Running

Networking Service

Function

Reference

Different VPCs in the same region

VPC Peering

With VPC Peering, you can peer two VPCs in the same region. The VPCs can be in the same account or different accounts.

Using a VPC Peering Connection to Connect Two VPCs

Enterprise Router

An enterprise router can connect multiple VPCs in the same account or different accounts to set up a hub-and-spoke network. Compared with VPC Peering, Enterprise Router is more suitable for complex networking where many VPCs need to be connected.

Using Enterprise Router to Connect VPCs in the Same Region

Different VPCs in different regions

Cloud Connect
  • Cloud connections
  • Central networks
Cloud Connect can connect VPCs in the same account or different accounts across regions. Cloud Connect provides the following two options:
  • Cloud connection: Load VPCs in different regions to a cloud connection.
  • Central network: Attach VPCs in the same region to an enterprise router, and add enterprise routers in different regions to a central network as attachments. This solution features higher scalability and is suitable for complex networking with many VPCs from different regions.

VPN

VPN allows VPCs in different regions to communicate with each other over the Internet.

Using VPN to Connect VPCs Across Regions

Direct Connect

VPCs in different regions can be connected through Direct Connect connections.

Using Direct Connect to Connect VPCs in Different Regions

On-premises data centers

VPN

VPN connects on-premises data centers and VPCs over the Internet.

Configuring Enterprise Edition S2C VPN to Connect an On-premises Data Center to a VPC

Direct Connect

You can use Direct Connect to connect a VPC to an on-premises data center.

Using Direct Connect to Connecting an On-premises Data Center to the Cloud

Enabling IP as a Backend

  1. Go to the load balancer list page.
  2. On the load balancer list page, click the name of the target load balancer.
  3. On the Summary tab, click Enable next to IP as a Backend.
  4. Click OK.

Adding IP as Backend Servers

  1. Go to the load balancer list page.
  2. On the Backend Server Groups page, click the name of the target backend server group.
  3. Switch to the Backend Servers tab and click Add above the IP address as backend server list.
  4. Specify the IP addresses, backend ports, and weights.
  5. Click OK.

Modifying the Ports/Weights of IP as Backend Servers

The server weight ranges from 0 to 100. If you set the weight to 0, new requests will not be routed to this server.

The weights can only be specified when you select weighted round robin, weighted least connections, or source IP hash as the load balancing algorithm. For more information about load balancing algorithms, see Backend Server Weights.

Only certain regions support backend port modification. See the details on the management console.

  1. Go to the load balancer list page.
  2. On the Backend Server Groups page, click the name of the target backend server group.
  3. Switch to the Backend Servers tab and click IP as Backend Servers.
  4. Select the servers and click Modify Port/Weight up the server list.
  5. In the displayed dialog box, modify ports/weights as you need.
    • Modifying ports:
      • Modifying the port of an IP as backend server: Set the port in the Backend Port column.
      • Modifying the ports of multiple IP as backend servers: Set the port next to Batch Modify Ports, and click OK.
    • Modifying weights:
      • Modifying the weight of an IP as backend server: Set the weight in the Weight column.
      • Modifying the weights of multiple IP as backend servers: Set the weight next to Batch Modify Weights and click OK.

      You can set the weights of multiple servers to 0 to block them from receiving requests routed by each load balancer.

  6. Click OK.

Removing IP as Backend Servers

If a cloud server is removed, requests are still routed to it. This is because a persistent connection is established between the load balancer and the cloud server and requests are routed to this server until the TCP connection times out. If no data is transmitted over this TCP connection after it times out, ELB disconnects the connection.

  1. Go to the load balancer list page.
  2. On the Backend Server Groups page, click the name of the target backend server group.
  3. Switch to the Backend Servers tab and click IP as Backend Servers.
  4. Select the IP as backend servers to be removed and click Remove above the server list.
  5. In the displayed dialog box, click OK.