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/ Ubiquitous Cloud Native Service/ Best Practices/ Traffic Distribution/ Using Traffic Distribution to Implement Traffic Switchover

Using Traffic Distribution to Implement Traffic Switchover

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

Application Scenarios

Distributed clusters are often deployed on the clouds or regions nearest to users for low latency. However, if a cluster in a region is faulty, service access in that region will be affected. UCS allows you to manage application traffic and data for traffic switchover, scheduling, and migration across clouds and clusters. Figure 1 shows how UCS switches traffic from a faulty cluster to ensure service continuity.

Figure 1 Traffic switchover in multi-cloud clusters

Constraints

  • You have two available clusters of version 1.19 or later, and each cluster must have at least one available node.
  • You have added a public zone to Huawei Cloud DNS. For details, see Routing Internet Traffic to a Website.

Setting Up the Environment

  1. Register clusters to UCS and configure cluster access. For details, see Registering a Cluster.

    For example, register ccecluster01 and ccecluster02 to UCS and check whether they are running normally.

  2. Create a workload in each connected cluster.

    NOTE:

    In this example, container images with different tags are used to create workloads, aiming to show you more clearly how application traffic is switched.

    • ccecluster01: Image tag 1.0.0 is used.
    • ccecluster02: Image tag 2.0.0 is used.

  3. Create a LoadBalancer Service for the workloads in each cluster.

    NOTE:

    Only LoadBalancer Services are supported and displayed.

  4. Use a browser to access the IP of the LoadBalancer Service to check the deployment result.

Verifying Traffic Switchover

You have deployed applications in clusters ccecluster01 and ccecluster02 and allowed external access via LoadBalancer Services.

The following describes how to distribute application traffic to realize traffic switchover and ensure high availability.

NOTE:

In this example, example clusters and workloads are not limited in terms of service providers, regions, and quantity.

  1. Log in to the UCS console. In the navigation pane, choose Traffic Distribution.
  2. Click Create Traffic Policy. In the window that slides from the right, enter the domain name (use demo.example.com here).

    Figure 2 Creating a traffic policy

  3. Add scheduling policies for the two clusters and click OK.

    In this example, three scheduling policies are added to simulate cluster application deployment in different regions:

    • For ccecluster01, set Line Type to Region line - Global/Asia-Pacific/Singapore.
    • For ccecluster02, set Line Type to Region line - Chinese Mainland/South China/Guangdong.
    • Add a default line for the domain name. For ccecluster01, set Line Type to Default. If no default line is added for the domain name, users in regions beyond the specified lines cannot access the applications.

  4. View the scheduling policies. Three policies have been added for demo.example.com. User traffic can access applications in the two clusters based on the configured line type and weight.

    • Users in Singapore will access application 1.0.0 in ccecluster01.
    • Users in Guangdong will access application 2.0.0 in ccecluster02.
    • Users in other regions will access application 1.0.0 in ccecluster01 by default.

  5. A user in Guangdong visits demo.example.com to access the application. The response shows that the user is accessing application 2.0.0 in ccecluster02.

    Figure 3 Checking the access result

  6. Manually stop the application in ccecluster02 and change the number of pods to 0 to simulate a fault.

    Figure 4 Adjusting the pod quantity

  7. When a user in Guangdong accesses the application, the request is still sent to ccecluster02 and an error is returned.

    In this case, click Suspend for the corresponding scheduling policy of ccecluster02 on the Traffic Distribution page to perform traffic switchover.

    After that, the subsequent access requests of this user will be sent to ccecluster01 through the default line, and the access becomes normal. After the faulty cluster is recovered, you can click Enable to enable the policy again.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback