Skip to content

You can use ELB to route traffic to backend servers in different VPCs connected over a VPC peering connection.

License

Notifications You must be signed in to change notification settings

HuaweiCloudDeveloper/huaweicloud-solution-adding-backend-instances-to-an-elb-across-vpcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[TOC]

Solution Overview

If you deploy services on multiple servers in different VPCs, you can use ELB to route traffic to backend servers in different VPCs connected over a VPC peering connection.

For details, visit https://www.huaweicloud.com/intl/en-us/solution/implementations/rtbsdvpc.html.

Solution Architecture

Architecture

Architecture Overview

To use this solution, you need to:

  • Create two ECSs in different VPCs for running services.
  • Configure a security group to control traffic to and from the two ECSs.
  • Create a dedicated load balancer to distribute incoming traffic to the two ECSs.

Organizational Structure

huaweicloud-solution-adding-backend-instances-to-an-elb-across-vpcs
├── adding-backend-instances-to-an-elb-across-vpcs.tf.json -- Resource orchestration template

Getting Started

  1. Log in to the EIP console, create two EIPs, and bind them respectively to the two ECSs created as instructed in Section 3.2 Quick Deployment of the deployment guide.

    Figure 1 Creating EIPs Creating EIPs

  2. Log in to the two ECSs created as instructed in Section 3.2 Quick Deployment of the deployment guide, deploy the httpd service on each ECS, and run the command below. Note that you can configure the message in the double quotation marks in the second line whatever you like. If the load balancer routes the request to the ECSs, this message will be returned.

    yum -y install httpd

    echo "www.test01.com" > /var/www/html/index.html

    chmod 777 /var/www/html/index.html

    systemctl start httpd

    curl localhost

    Figure 2 Logging in to the ECSs Logging in to the ECSs

    Figure 3 Installing the httpd service Installing the httpd service

    Figure 4 Installing the httpd service Installing the httpd service

  3. Unbind the EIPs bound to the two ECSs in step 2 and release the EIPs.

    Figure 5 Unbinding and releasing the EIPs Unbinding and releasing the EIPs

  4. On the ELB console, view the dedicated load balancer you have created for deploying this solution.

    Figure 6 Viewing the load balancer Viewing the load balancer

  5. Enter the EIP address assigned in step 4 in the address box of your browser to access the dedicated load balancer. If the following two pages are displayed, the load balancer routes the requests to the two ECSs.

    Figure 7 Verifying that the request is routed to one ECS

    Verifying that the request is routed to one ECS

    Figure 8 Verifying that the request is routed to the other ECS

    Verifying that the request is routed to the other ECS

About

You can use ELB to route traffic to backend servers in different VPCs connected over a VPC peering connection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published