หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Load Balance/ Best Practices/ Using IP as a Backend to Route Traffic Across Backend Servers/ Routing Traffic to Backend Servers in the Same VPC as the Load Balancer

Routing Traffic to Backend Servers in the Same VPC as the Load Balancer

Updated on 2024-11-12 GMT+08:00

Scenarios

You can use ELB to route traffic to backend servers in the same VPC as the load balancer.

Solution

  • Dedicated load balancer ELB-Test is running in a VPC named vpc-peering (10.1.0.0/16).
  • An ECS named ECS-Test is also running in vpc-peering (10.1.0.0/16).
  • IP as a Backend is enabled for ELB-Test, and ECS-Test in vpc-peering (10.1.0.0/16) is added to the backend server group associated with ELB-Test in vpc-peering.
Figure 1 Topology

Advantages

You can enable IP as a Backend for a dedicated load balancer to route traffic to backend servers in the same VPC as the load balancer.

Resource and Cost Planning

The actual cost shown on the Huawei Cloud console is used.

Table 1 Resource planning

Resource Type

Resource Name

Description

Quantity

VPC

vpc-peering

The VPC where ELB-Test and ECS-Test are running:

10.1.0.0/16

1

VPC peering connection

Peering-Test

The connection that connects the VPC where ELB-Test is running and other VPCs.

Local VPC: 10.1.0.0/16

Peer VPC: any VPC

1

Route table

Route-VPC-Test-01

The route table of VPC-Test-01.

Destination: 10.1.0.0/16

1

ELB

ELB-Test

The dedicated load balancer to distribute incoming traffic.

Private IP address: 10.1.0.9

1

EIP

EIP-Test

The EIP bound to ELB-Test:

120.46.131.153

1

ECS

ECS-Test

The ECS that is running in vpc-peering.

Private IP address: 10.1.0.56

1

Operation Process

Figure 2 Process for adding backend servers in the same VPC as the load balancer

Step 1: Create a VPC

  1. Log in to the management console.
  2. Choose Networking > Virtual Private Cloud. On the displayed page, click Create VPC.
  3. Configure the parameters as follows and click Create Now. For details on how to create a VPC, see the Virtual Private Cloud User Guide.
    • Name: vpc-peering
    • IPv4 CIDR Block: 10.1.0.0/16
    • Configure other parameters as required.

Step 2: Create a VPC Peering Connection

  1. In the navigation pane on the left, click VPC Peering Connections.
  2. In the upper right corner, click Create VPC Peering Connection.
  3. Configure the parameters as follows and click Create Now. For details on how to create a VPC peering connection, see the Virtual Private Cloud User Guide.
    • Name: Peering-Test
    • Local VPC: vpc-peering
    • Peer VPC: any VPC
    • Configure other parameters as required.

Step 3: Add Routes for Peering-Test

  1. In the navigation pane on the left, click Route Tables.
  2. In the upper right corner, click Create Route Table.
  3. Configure the parameters as follows and click OK. For details on how to create a route table, see the Virtual Private Cloud User Guide.
    • Name: Route-VPC-Test-01
    • VPC: vpc-peering
    • Destination: 10.1.0.0/16
    • Next Hop Type: VPC peering connection
    • Next Hop: Peering-Test

Step 4: Create an ECS

  1. Under Compute, click Elastic Cloud Server.
  2. In the upper right corner, click Buy ECS.
  3. Configure the parameters as required. For details, see the Elastic Cloud Server User Guide.

    Select vpc-peering as the VPC and set Name to ECS-Test.

  4. Deploy Nginx on the ECS-Test.
    Figure 3 Deploying Nginx on ECS-Test

Step 5: Create a Dedicated Load Balancer with an HTTP Listener and Associate a Backend Server Group

  1. On the management console, choose Networking > Elastic Load Balance.
  2. In the upper right corner, click Buy Elastic Load Balancer.
  3. Configure the parameters as follows. For details, see Elastic Load Balance User Guide.
    • Type: Dedicated
    • VPC: vpc-peering
    • Name: ELB-Test
    • IP as a Backend: Enable it.
    • Configure other parameters as required.
  4. Add an HTTP listener to ELB-Test and associate a backend server group with it.

Step 6: Add ECS-Test to the Backend Server Group

Locate ELB-Test and click its name.

  1. On the Default Backend Server Group area of the Summary tab, click View/Add Backend Server on the right.
  2. The page for adding backend servers is displayed.
  3. Click IP as Backend Servers on the lower part of the page. Click Add on the right, set parameters as required, and click OK. For details, see Elastic Load Balance User Guide.
    • IP Address: Set it to the private IP address of ECS-Test (10.1.0.56).
    • Backend Port: Set it as required.
    • Weight: Set it as required.

Step 7: Verify Traffic Routing

  1. Locate ELB-Test and click More in the Operation column.
  2. Select Bind IPv4 EIP to bind an EIP (120.46.131.153) to ELB-Test.
  3. Enter http://120.46.131.153/ in the address box of your browser to access ELB-Test. If the following page is displayed, ELB-Test routes the request to ECS-Test, which processes the request and returns the requested page.
    Figure 4 Verifying that the request is routed to ECS-Test

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback