CN116346713A - System, method, storage medium and program product for switching devices across AZ - Google Patents

System, method, storage medium and program product for switching devices across AZ Download PDF

Info

Publication number
CN116346713A
CN116346713A CN202310156572.8A CN202310156572A CN116346713A CN 116346713 A CN116346713 A CN 116346713A CN 202310156572 A CN202310156572 A CN 202310156572A CN 116346713 A CN116346713 A CN 116346713A
Authority
CN
China
Prior art keywords
ecs
address
havip
virtual
virtual router
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310156572.8A
Other languages
Chinese (zh)
Inventor
康达祥
杨博文
宋扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202310156572.8A priority Critical patent/CN116346713A/en
Publication of CN116346713A publication Critical patent/CN116346713A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/252Store and forward routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a cross-AZ device switching system, a method, a storage medium and a program product, and belongs to the technical field of clouds. The method comprises the following steps: when detecting that the HAVIP address of the virtual router is available on a first ECS in the first AZ, the position service equipment generates a first routing table item pointing to the first ECS, wherein the HAVIP address of the virtual router is a global IP address which can span different AZ; when it is detected that the virtual router HAVIP address is not available on the first ECS and is available on a second ECS within the second AZ, the location services device generates a second routing table entry directed to the second ECS; the location services device switches the first routing entry to a second routing entry to enable the second ECS to provide services via the virtual router HAVIP address. In the application, the HAVIP address of the virtual router is a global IP address crossing the AZ, so that the device switching crossing the AZ can be realized based on the HAVIP address of the virtual router.

Description

System, method, storage medium and program product for switching devices across AZ
Technical Field
The present application relates to the field of cloud technologies, and in particular, to a system, a method, a storage medium, and a program product for switching devices across AZ.
Background
With the continuous development of cloud technology, the requirements of VPC (Virtual Private Cloud ) are increasingly higher, such as elasticity, security, reliability, privacy, interconnection, high availability, and the like. To achieve high availability, a plurality of ECSs (Elastic Compute Service, cloud servers) are deployed on the VPC, and when one ECS fails and cannot provide service to the outside, by switching the virtual switch vip (High Availability Virtual Internet Protocol ) address from one ECS to another ECS, the other ECS can continue to provide service through the virtual switch vip address.
Because the HAVIP address of the virtual switch belongs to the corresponding network segment of the virtual switch, the corresponding network segment of the virtual switch can only serve one AZ (Availability Zone, available area), and device switching cannot be performed across the AZ. Therefore, there is a need to provide a device switching method across AZ.
Disclosure of Invention
The embodiment of the application provides a system, a method, a storage medium and a program product for switching equipment across AZ, which can switch the equipment across AZ. The technical scheme is as follows:
in a first aspect, there is provided a device switching system across AZ, the system comprising: the system comprises a location service device, at least two virtual switches and at least one ECS connected with each virtual switch, wherein the location service device is connected with the at least two virtual switches;
The location service device and at least two virtual switches are located in the same data center, the at least two virtual switches are located in the same VPC of the data center, the VPC comprises at least two AZ, each virtual switch and a connected ECS are deployed in one AZ, ECS connected by the at least two virtual switches have the use authority of a virtual router high HAVIP address, the virtual router HAVIP address is distributed by the VPC, and the virtual router HAVIP address is a global IP address which can cross different AZ;
each virtual switch is used for forwarding messages between the location service equipment and the connected ECS;
each ECS connected with the virtual switch is used for providing service through the virtual router HAVIP address when becoming a main ECS, and the main ECS is an ECS available for the virtual router HAVIP address;
the location service device is configured to generate and manage a routing table entry of the active ECS, where the routing table entry is configured to instruct forwarding, to the active ECS, a packet that accesses the HAVIP address of the virtual router.
In a second aspect, there is provided a method for switching devices across AZ, the method being applied to the system for switching devices across AZ according to the first aspect, the method comprising:
When the virtual router HAVIP address is detected to be available on a first ECS, the location service equipment generates a first routing table item pointing to the first ECS, wherein the first ECS is any ECS in a first AZ of the VPC, and the first routing table item is used for indicating the address of the first ECS so as to forward a message accessing the virtual router HAVIP address to the first ECS;
when the virtual router HAVIP address is detected to be unavailable on the first ECS and available on a second ECS, the location services device generates a second routing table entry pointing to the second ECS, the second ECS being any ECS within a second AZ of the VPC, the second routing table entry being used to indicate an address of the second ECS, so as to forward a message accessing the virtual router HAVIP address to the second ECS;
and the location service equipment switches the first routing table entry into the second routing table entry so that the second ECS provides service through the virtual router HAVIP address.
In a third aspect, there is provided a computer readable storage medium having stored therein at least one computer program which, when executed by a processor, is capable of implementing a method of device switching across AZs as described in the second aspect.
In a fourth aspect, there is provided a computer program product comprising a computer program capable of implementing a method of device switching across AZs as described in the second aspect when executed by a processor.
The beneficial effects that technical scheme that this application embodiment provided brought are:
the virtual router HAVIP address is a global IP address which is distributed for the VPC and can cross different AZ, and ECS in different AZ of the VPC can bind the virtual router HAVIP address at the same time, so that the virtual router HAVIP address has the use authority. In an ECS group consisting of a plurality of ECSs bound to virtual router HAVIP addresses within different AZ, when a location service device detects that the virtual router HAVIP addresses are available on a first ECS, a first routing table entry pointing to the first ECS is generated, and the first ECS provides services for access devices of the virtual router HAVIP addresses. When it is detected that the virtual router HAVIP address is not available on the first ECS and is available on the second ECS, the location services device generates a second routing table entry pointing to the second ECS, and the second ECS is enabled to service the access device of the virtual router HAVIP address by switching the first routing table entry to the second routing table entry. Since the ECSs within the ECS group are identical in their status, when a first ECS that is the active ECS fails, the active ECS selected by the ECS group may be an ECS that is located within the same AZ as the first ECS, or may be an ECS that is located within a different AZ than the first ECS, and whichever ECS the location service device may generate a routing table that points to that ECS, thereby providing a high availability service for devices that access the virtual router HAVIP address.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a device switching system across AZ according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a device switching system across AZ according to an embodiment of the present application;
fig. 3 is a schematic diagram of a subject on which a HAVIP address of a virtual router is mounted according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another device switching system across AZ according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of another device switching system across AZ according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of another device switching system across AZ according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a flowchart of a method for switching devices across AZ according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It will be understood that, as used in the embodiments of the present application, the terms "each," "plurality," and "any" and the like, a plurality includes two or more, each refers to each of the corresponding plurality, and any refers to any of the corresponding plurality. For example, the plurality of words includes 10 words, and each word refers to each of the 10 words, and any word refers to any one of the 10 words.
Information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals referred to herein are user-authorized or fully authorized by parties, and the collection, use, and processing of relevant data requires compliance with relevant laws and regulations and standards of the relevant country and region.
First, before executing the embodiments of the present application, terms related to the embodiments of the present application will be explained.
VPC is a dynamically configured pool of public cloud computing resources that requires the use of encryption protocols, tunneling protocols, and other security procedures to transfer data between a residential enterprise and a cloud service provider. The VPC contains three important components, the virtual switch, the gateway and the controller. The virtual switch and the gateway form a critical path of a data path, and the controller uses a self-grinding protocol to send a forwarding table to the gateway and the virtual switch, so that the critical path of the configuration path is completed. The configuration path and the data path are separated from each other. Virtual switches in the VPC are distributed nodes, the gateway and the controller are in cluster deployment and are mutually provided with multiple machines, and all links are provided with redundancy disaster recovery, so that the overall usability of the VPC is improved.
ARP (Address Resolution Protocol ) is a TCP/IP (Transmission Control Protocol/Internet Protocol, transmission control protocol/internet protocol) protocol that obtains a physical address from an IP address. Broadcasting an ARP request containing a target IP address to all hosts on a local area network when the hosts send information, and receiving a return message so as to determine the physical address of the target; after receiving the return message, the IP address and the physical address are stored in the local ARP cache and kept for a certain time, and the ARP cache is directly inquired when the request is next time so as to save resources.
The HAVIP address is a private network IP resource that can be created and released independently. The HAVIP address can be matched with high-availability software (such as keep-alive) to be used, so that high-availability active and standby services are built, and the availability is improved.
CIDR (classification Inter-Domain Routing), is a method for assigning IP addresses to users and efficiently Routing IP packets over the internet to classify the IP addresses. CIDR is called no category inter-domain routing because it does not distinguish between class a, class B, class C addresses, but rather uses the value of the CIDR prefix to specify the number of bits in the address as the network ID. The essence of CIDR is to constantly assign codes of the host part to network prefixes, thereby creating new sub-networks.
Keepalive is a software similar to layer3, 4 and 5 switching mechanisms, i.e., layer3, layer 4 and layer 5 switching. The function of keepalive is to detect the state of the server, if one server is down or the work fails, the keepalive eliminates the detected failed server from the system, and other servers are used to replace the server to work, and when the server works normally, the keepalive automatically adds the server into the server group.
Region refers to a physical data center. That is, an area is a separate physical data center.
The available area refers to a physical area where power and network are isolated under the same area. The internal networks among the available areas are communicated, and different available areas are physically isolated.
High availability refers to the ability of a system to perform its function without interruption, representing the degree of availability of the system.
Redundancy switching is the operation in which a non-emergency failure occurs while the system is running, and the master system switches to the slave system.
A virtual router (vruter) is the hub of a proprietary network. As an important functional component in the private network, it may connect to various virtual switches within the private network, as well as gateway devices that connect to the private network and other networks. After each proprietary network is successfully created, the system automatically creates a router. Each router is associated with a routing table.
Cloud technology (Cloud technology) refers to a hosting technology for integrating hardware, software, network and other series resources in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The cloud technology is based on a cloud computing business mode, and can form a resource pool by applying network technology, information technology, integration technology, management platform technology, application technology and the like, so that the cloud technology is flexible and convenient as required. With the high development and application of the internet industry, the background service of the technical network system needs a large amount of computing and storage resources, such as video websites, picture websites and more portal websites, which can only be realized through cloud computing (closed computing).
Cloud Computing is an important support for cloud technology, and is a product of fusion of traditional computer and network technology development such as Grid Computing (Grid Computing), distributed Computing (distributed Computing), parallel Computing (Parallel Computing), utility Computing (Utility Computing), network storage (Network Storage Technologies), virtualization (Virtualization), load balancing (Load Balance), and the like, and required resources can be obtained in an on-demand and easily-extensible manner through a network. Virtualization is one of main technologies for realizing cloud computing, is a software technology for mapping and managing logic of resources, is a technical solution for simplifying computing resource management and optimizing resource utilization, and simply speaking, virtualizes hardware resources to realize isolation, expandability, full utilization of resources, safety and the like of the resources.
In a virtualized scenario, a user may create a virtual network that is self-owned in a cloud environment without regard to the underlying physical network environment. The virtual network comprises a public cloud network, a private cloud network, a hybrid cloud network and the like. Under a virtual network, each device must have a unique IP address, which is an abstraction of the host hardware address, in short, the MAC (Media Access Control Address ) address is a physical address and the IP address is a logical address, no matter how the network is connected. The virtual IP is an IP address which is not assigned to a real device, that is, a device which provides a service to the outside, and a virtual IP which can be connected to the device using either one of the two IP addresses, in addition to a real IP.
Typically virtual IP addresses are used for the purpose of achieving high availability. To achieve the goal of high availability, existing VPC networks typically deploy multiple AZs, each with one virtual switch inside, each corresponding to one virtual switch vip address, and each binding at least two ECSs inside the AZ at the same time. The prior art performs domain name level resolution through DNS (Domain Name System ) to achieve device switching across AZs. Specifically, the correspondence between the domain name and the HAVIP addresses of the two virtual switches is preset, and each virtual switch HAVIP address is bound with the ECS in the corresponding AZ. When the main ECS in one AZ fails, the main ECS is switched to another virtual switch HAVIP address corresponding to the domain name through the DNS, namely the virtual switch HAVIP address corresponding to the standby ECS in the other AZ, and further the service is continuously provided through the standby ECS. However, the DNS system generally sets a buffer TTL (Time To Live), and in the set TTL, the DNS system does not perform domain name resolution, but directly obtains the HAVIP address of the virtual switch corresponding To the domain name from the buffer, where if the active ECS fails, the active ECS cannot be switched To the standby ECS, so that high availability of VPC cannot be actually achieved in the inter-AZ scenario.
To achieve high availability of VPCs in a cross-AZ scenario, the present application innovatively proposes a new CIDR, namely a virtual router CIDR, allocated by the VPC, which is part of the CIDR of the VPC. Like the VPC, the virtual router CIDR is set with granularity of a data center (region). The virtual router CIDR belongs to global CIDR and can be used across different AZs in the VPC. The virtual router CIDR is not overlapped with the CIDR of the appointed virtual switch configuration, so that the situation that the same IP address has different attributes and cannot provide service is avoided.
Optionally, to meet the needs of the tenant in the VPC, multiple virtual routers CIDR may be configured for the tenant.
In addition, the virtual router HAVIP address and EIP (Elastic IP address) are bound, so that the capability of accessing the public network can be obtained. The EIP is a NAT IP, is positioned on a public network gateway, and can be mapped to the bound cloud resources in a NAT mode. The EIP support is bound to ECS instances of proprietary network types, CLB (Classic Load Balancer, legacy load balancing) instances of proprietary network types, ALB (application load balancing Application Load Balancer) of proprietary network types, auxiliary elastic network cards of proprietary network types, NAT gateway, HAVIP, etc.
It should be noted that, in order to facilitate distinguishing CIDRs with different attributes, in the embodiments of the present application, a CIDR created by a designated virtual switch is referred to as a virtual switch CIDR, and a CIDR created by a designated VPC is referred to as a virtual router CIDR. In the prior art, the virtual switch HAVIP address adopted in the device switching process belongs to the virtual switch CIDR, and the virtual router HAVIP address adopted in the device switching process belongs to the virtual router CIDR. Because the virtual router CIDR is a global network segment that can span different AZs within the VPC, and the virtual router HAVIP addresses belong to the virtual router CIDR, the virtual router HAVIP addresses also have the ability to span different AZs within the VPC. The virtual router HAVIP address may be bound to ECS in different AZs in the VPC based on the ability to cross different AZs in the VPC. In the process of providing service based on the HAVIP address of the virtual router, when the main ECS fails and cannot provide service, equipment switching can be conducted across AZ.
For any virtual router HAVIP address allocated by VPC, the embodiments of the present application provide a device switching system across AZ, see fig. 1, which includes: a location service device, at least two virtual switches (fig. 1 shows only two virtual switches by way of example, but does not represent that only two virtual switches are included in the system), and at least one ECS to which each virtual switch is connected (fig. 1 shows only a virtual switch-to-ECS connection relationship by way of example, and in practice each virtual switch may connect two or more ECSs), the location service device being connected to at least two virtual switches.
Referring to fig. 1, a location service device and at least two virtual switches are located in the same data center, the data center includes at least one VPC, the at least two virtual switches are located in the same VPC of the data center, the VPC includes at least two AZs, each virtual switch is deployed in one AZ with a connected ECS, the ECSs connected to the at least two virtual switches each have a right to use a virtual router vip address, the virtual router vip address is allocated by the VPC, and the virtual router vip address is a global IP address that can span different AZs.
The virtual switch is basic network equipment forming the VPC and is used for connecting different cloud resources. After the VPC is created, one or more subnets may be partitioned for the VPC by creating virtual switches. The intranet intercommunication among different virtual switches in the same VPC can improve the usability of the application by deploying the application in the virtual switches in different available areas. Each virtual switch is connected with the location service device and is used for forwarding messages between the location service device and the connected ECS.
The ECS is a service providing device in the VPC, and is used for providing accurate and rapid computing service, storing massive data, realizing data sharing, and the like. The ECS to which each virtual switch is connected is configured to provide services via the virtual router vip address when the ECS becomes the active ECS, which is the ECS available to the virtual router vip address.
The location service device is used as a management device of a virtual router in the data center, is a new device deployed for managing the HAVIP address of the virtual router allocated to each VPC in the data center in the embodiment of the present application, and is not deployed in the existing device switching system. The location service device has multiple functions, including probing the ECS bound by the HAVIP address of the virtual router, generating a routing table entry for the host ECS, managing the routing table entry of the host ECS, and the like, where the routing table entry is used to indicate the address of the host ECS, so as to forward the message accessing the HAVIP address of the virtual router to the host ECS. The location service device may be a single physical server, a cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), and the like.
Referring to fig. 1, the system further comprises: a private network gateway. The private network gateway is located within each VPC of the data center and is connected to the location services device and each virtual switch within each VPC. The private network gateway is capable of providing private network address translation services to ECSs within the VPC, such that multiple ECSs may access a local data center or other VPC private network gateway via a transit private network address (i.e., NAT IP address). Based on the private network gateway, messages of the client devices in other VPCs of the data center accessing the HAVIP address of the virtual router can be forwarded to the master ECS.
Referring to fig. 1, the system further comprises: and a public network gateway. The public network gateway is positioned in the data center and is connected with the location service equipment. The public network gateway is an enterprise-level security gateway product aiming at public network access, provides NAT proxy functions (SNAT and DNAT), and has forwarding capacity of 100Gbps and disaster recovery capacity crossing available areas. The public network gateway has the characteristics of high performance, automatic elasticity, flexible charging, fine operation and maintenance and the like, and can help users to better manage the public network access flow. Based on the public network gateway, the message of the client device outside the data center accessing the address of the virtual router HAVIP can be forwarded to the main ECS.
For the device switching system across AZ shown in fig. 1, the structure and function of the device switching system will be described with reference to fig. 2 for more visual explanation. The device switching system shown in fig. 2 includes: a location service device 101, a first ECS102, a first virtual switch 103, a second ECS104, and a second virtual switch 105 (the private network gateway of VPC1 is not shown in the figure). Wherein the location services device 101, the first virtual switch 103 and the second virtual switch 105 are located in the same data center, and the first virtual switch 103 and the second virtual switch 105 are located in the VPC 1. The first virtual switch 103 is a virtual switch on a physical machine where the first ECS104 is located, where the first virtual switch 103 is connected to the first ECS104, and is used for forwarding a packet sent and received by the first ECS 102. The second virtual switch 105 is a virtual switch on a physical machine where the second ECS104 is located, where the second virtual switch 105 is connected to the second ECS106, and is configured to forward a packet sent and received by the second ECS 104. The VPC1 includes a plurality of AZs, for example, a first AZ (denoted as AZ1 in the figure) and a second AZ (denoted as AZ2 in the figure) and the like, wherein the first virtual switch 103 and the first ECS104 are disposed in the AZ1, and the second virtual switch 105 and the second ECS106 are disposed in the AZ 2.
It should be noted that, although the private network gateway included in the VPC1 is not shown in fig. 2, whether the ECS in the same data center access the message of the HAVIP address of the virtual router or the client device outside the data center accesses the message of the HAVIP address of the virtual router, the private network gateway is required to forward to the host ECS in the VPC 1.
In this embodiment of the present application, after the VPC1 network is created, each ECS in the VPC1 may bind with the HAVIP address of the virtual router allocated by the VPC1 network, and announce the usage rights to the HAVIP address of the virtual router through an ARP message. After the first ECS102 in the first AZ becomes the active ECS in the ECS group, the first ECS102 sends an active announcement packet for the HAVIP address of the virtual router to the location service device 101, where the active announcement packet is in ARP form, that is, the active announcement packet is an ARP packet. The first virtual switch 103 receives the primary announcement packet, adds the location information of the first ECS102 to the ARP primary announcement packet, and sends the ARP primary announcement packet to the location service device 101, and when receiving the primary announcement packet, the location service device 101 determines that the HAVIP address of the virtual router is available on the first ECS102, and further generates a first routing table entry pointing to the first ECS102, where the first routing table entry is used to indicate an address of the first ECS102, so as to send a packet accessing the HAVIP address of the virtual router to the first ECS102.
In order to be able to provide high availability services to devices accessing the virtual router HAVIP address, a plurality of ECSs bound to the virtual router HAVIP address form an ECS group and probe each other within the ECS group, and when the first ECS102 is detected as unavailable, the second ECS104 is reselected within the ECS group as the active ECS. When becoming the active ECS within the ECS group, the second ECS104 sends an active announcement message for the virtual router vip address to the location services device 101. The second virtual switch 105 receives the primary advertisement message, and adds the location information of the second ECS104 to the primary advertisement message, so as to send the primary advertisement message to the location service device 101. Upon receiving the primary advertisement message, the location service device 101 determines that the virtual router HAVIP address is not available on the first ECS102 and is available on the second ECS104, and generates a second routing table entry directed to the second ECS104, where the second routing table entry is used to indicate the address of the second ECS104 to send a message to the second ECS104 that accesses the virtual router HAVIP address.
Taking the active sending of the active announcement message by the active ECS to the location service 101 as an example, in an actual scenario, the location service 101 may also send, to each ECS in the ECS group, a probe message carrying the HAVIP address of the virtual router, where the probe message is used to trigger the active ECS in the ECS group to respond, so as to send a reply message to the location service 101 by responding to the probe message, and when receiving the reply message, the location service determines that the HAVIP address of the virtual router is available on the ECS.
In this embodiment, the location service device maintains a routing table, where the routing table includes a plurality of routing entries, and each routing entry is used to indicate an address of the active ECS in a corresponding time. Thus, upon determining that the virtual router HAVIP address is available on the second ECS104, the location services device also switches the first routing table entry to the second routing table entry so that the second ECS104 can provide services through the virtual router HAVIP address.
In this embodiment of the present application, the object for mounting the HAVIP address of the virtual router may be an ECS, or may be an aggregation port (for example, an ENI bonding, etc.), or may be a HAVIP address of the virtual switch, etc. When the mounting object of the virtual router HAVIP address is an aggregation port, a plurality of ECSs connected by the aggregation port are virtualized to provide service together. When the aggregate port is selected from the ECS group as the active ECS, the ECSs connected to the aggregate port need to send the active announcement message to the location service 101. After successful announcement, the multiple ECSs that aggregate port connections collectively service the devices that access the virtual router HAVIP addresses. Further, after the announcement is successful, the aggregation port aggregates the location information of the connected ECSs, and then sends the aggregated location information to the location service device 101. When the object on which the virtual router HAVIP address is mounted is a virtual switch HAVIP address, the virtual router HAVIP address and the virtual switch HAVIP address are subjected to nesting processing, specifically, the virtual router HAVIP address is mapped to the virtual switch HAVIP address, and the virtual switch HAVIP address is mapped to the ECS. In this case, when location information is queried, nested query is needed, that is, the mounted virtual switch vip address is queried according to the virtual router vip address, and then location information of the ECS configuring the virtual switch vip address is queried according to the virtual switch vip address.
In this embodiment, when the objects on which the HAVIP addresses of the virtual switches are mounted are different, the first ECS102 and the second ECS104 are also different.
Specifically, when the object on which the HAVIP address of the virtual switch is mounted is an ECS, the first ECS102 may be any ECS connected to the first virtual switch 103 in the first AZ, and the second ECS104 may be any ECS connected to the second virtual switch 105 in the second AZ. For example, the first ECS102 may be ECS1 in AZ1 in fig. 3, and the second ECS104 may be ECS7 in AZ2 in fig. 3.
Specifically, when the mounting object of the HAVIP address of the virtual router is an aggregation port, the first ECS may be a plurality of ECSs connected to the first aggregation port in the first AZ, and the second ECS may be a plurality of ECSs connected to the second aggregation port in the second AZ. For example, the first ECS102 may be ECS2, ECS3, and ECS4 in AZ1 in fig. 3, and the second ECS104 may be ECS8, ECS9, and ECS10 in AZ2 in fig. 3.
Specifically, when the object for mounting the virtual routing HAVIP address is a virtual switch HAVIP address, the first ECS may be an ECS configured with the first virtual switch HAVIP address in the first AZ, and the second ECS may be an ECS configured with the second virtual switch HAVIP address in the second AZ. For example, the first ECS102 may be the ECS5 or the ECS6 corresponding to the address of the virtual switch vip1 in AZ1 in fig. 3, and the second ECS104 may be the ECS11 or the ECS12 corresponding to the address of the virtual switch vip2 in AZ2 in fig. 3.
In an actual scenario, the VPC network structure is complex, and may include at least two ECSs, aggregation ports and virtual switch HAVIP addresses, and the object for mounting the virtual router HAVIP addresses may be an ECS, an aggregation port, a virtual switch HAVIP address, etc., so the first ECS102 may be any one ECS connected to the first virtual switch 103 in the first AZ, a plurality of ECSs connected to the first aggregation port in the first AZ, any one ECS configured with the first virtual switch HAVIP address in the first AZ, and the second ECS104 may be any one ECS connected to the second virtual switch 105 in the second AZ, a plurality of ECSs connected to the second aggregation port in the second AZ, or any one ECS configured with the second virtual switch HAVIP address in the second AZ. That is, the first ECS102 and the second ECS104 include the following:
in the first case, the first ECS102 is any ECS connected to the first virtual switch 103 in the first AZ, and the second ECS104 is any ECS connected to the second virtual switch 105 in the second AZ. For example, the first ECS102 is ECS1 in fig. 3 and the second ECS104 is ECS7 in fig. 3.
In the second case, the first ECS102 is any ECS connected to the first virtual switch 103 in the first AZ, and the second ECS104 is a plurality of ECSs connected to the second aggregation ports in the second AZ. For example, the first ECS102 is ECS1 in fig. 3, and the second ECS104 is ECS8, ECS9, and ECS10 connected by the ENI bonding 2 in fig. 3.
In case three, the first ECS102 is any ECS connected to the first virtual switch 103 in the first AZ, and the second ECS104 is an ECS configured with the second virtual switch vip address in the second AZ. For example, the first ECS102 is ECS1 in fig. 3, and the second ECS104 is ECS11 or ECS12 connected by Vswitch vip2 in fig. 3.
In case four, the first ECS102 is a plurality of ECSs connected to a first aggregation port in the first AZ, and the second ECS104 is any ECS connected to a second virtual switch 105 in the second AZ. For example, the first ECS102 is ECS2, ECS3, and ECS4 connected by ENI bonding 1 in fig. 3, and the second ECS104 is ECS7 in fig. 3.
In case five, the first ECS102 is a plurality of ECSs connected to a first aggregation port in the first AZ, and the second ECS104 is a plurality of ECSs connected to a second aggregation port in the second AZ. For example, the first ECS102 is ECS2, ECS3 and ECS4 connected by ENI bonding 1 in FIG. 3, and the second ECS104 is ECS8, ECS9 and ECS10 connected by ENI bonding 2 in FIG. 3.
In case six, the first ECS102 is a plurality of ECSs connected to the first aggregation port in the first AZ, and the second ECS104 is an ECS configured with the second virtual switch HAVIP address in the second AZ. For example, the first ECS102 is ECS2, ECS3 and ECS4 connected by ENI bonding 1 in FIG. 3, and the second ECS104 is ECS11 or ECS12 connected by Vswitch HAVIP2 in FIG. 3.
In case seven, the first ECS102 is an ECS configured with the first virtual switch vip address in the first AZ, and the second ECS104 is any ECS connected to the second virtual switch 105 in the second AZ. For example, the first ECS102 is ECS5 or ECS6 connected by Vswitch HAVIP1 in fig. 3, and the second ECS104 is ECS7 in fig. 3.
In the eighth case, the first ECS102 is an ECS configured with the first virtual switch HAVIP address in the first AZ, and the second ECS104 is a plurality of ECSs connected to the second aggregation port in the second AZ. For example, the first ECS102 is ECS5 or ECS6 connected by Vswitch HAVIP1 in FIG. 3, and the second ECS104 is ECS8, ECS9 and ECS10 connected by ENI bonding 2 in FIG. 3.
In case nine, the first ECS102 is an ECS configured with the first virtual switch vip address in the first AZ, and the second ECS104 is an ECS configured with the second virtual switch vip address in the second AZ. The first ECS102 is either ECS5 or ECS6 with Vswitch vip1 connection in fig. 3, and the second ECS104 is either ECS11 or ECS12 with Vswitch vip2 connection in fig. 3.
In this embodiment of the present application, the access device may send an access packet for the HAVIP address of the virtual router, and when receiving the access packet sent by the access device, the forwarding device obtains the location information of the active ECS, and then sends the access packet to the active ECS. The forwarding device has a number of situations depending on the network in which the access device and the active ECS are located. Taking the master ECS as the first ECS as an example, referring to the device switching system shown in fig. 4, when the access device 106 is a third ECS106 located in the same VPC as the first ECS, the forwarding device 107 is a virtual switch on the physical machine where the third ECS106 is located, that is, a third virtual switch. Referring to the device switching system shown in fig. 5, when the access device 106 is a third ECS106 located in the VPC2 of the same data center as the first ECS, the forwarding device 107 is a private gateway in the VPC2 where the third ECS106 is located. Referring to the device switching system shown in fig. 6, when the access device 106 is any client device outside the data center where the first ECS is located, the forwarding device 107 is a public network gateway of the data center.
The above-mentioned primary ECS is taken as the first ECS, and when the primary ECS is another ECS in the ECS group, the configuration of the device switching system is similar to that of the device switching system across AZ shown in any of the above-mentioned fig. 4 to 6, and will not be described here.
Fig. 7 shows a block diagram of an electronic device 700 according to an exemplary embodiment of the present application. The electronic device 700 may be any of the devices involved in the above-described device switching system across AZs. In general, the electronic device 700 includes: a processor 701 and a memory 702.
The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). Processor 701 may also include a main processor, which is a processor for processing data in an awake state, and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 701 may also include an artificial intelligence processor for processing computing operations related to machine learning.
The Memory 702 may include one or more computer-readable storage media, which may be non-transitory computer-readable storage media, such as CD-ROM (Compact Disc Read-Only Memory), ROM, RAM (Random Access Memory ), magnetic tape, floppy disk, optical data storage device, and the like. The computer readable storage medium stores at least one computer program which, when executed, enables the above-described method of switching devices across AZ.
Of course, the electronic device described above may necessarily also include other components, such as input/output interfaces, communication components, and the like. The input/output interface provides an interface between the processor and a peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the electronic device and other devices, and the like.
Those skilled in the art will appreciate that the structure shown in fig. 7 is not limiting of the electronic device 700 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
The embodiment of the present application provides a method for switching devices across AZ, taking an embodiment of executing the present application by using a system for switching devices across AZ as an example, referring to fig. 8, a method flow provided by the embodiment of the present application includes:
801. when it is detected that the virtual router HAVIP address is available on the first ECS, the location services device generates a first routing table entry directed to the first ECS.
Under a virtual network, a VPC network may deploy at least two AZs, each of which deploys at least two ECSs. When the VPC creates a virtual router vip address, the location service device may bind the virtual router vip address with ECS devices within at least two AZs in the VPC network in order to be able to provide highly available services to devices accessing the virtual router vip address. The AZ used for binding with the HAVIP address of the virtual router may be all or part of the AZ deployed in the VPC network, and the ECS used in the AZ used for binding with the HAVIP address of the virtual router may be all or part of the ECS in the AZ.
To facilitate management of multiple ECSs bound to virtual router HAVIP addresses, embodiments of the present application may group multiple ECSs bound to virtual router HAVIP addresses into one ECS group. For each ECS in the ECS group, although a binding relationship is established with the virtual router vip address, the virtual router vip address is only used, and the virtual router vip address cannot be used for providing services. To provide services using the virtual router vip address, the bound virtual router vip address needs to be enabled inside the ECS. Typically, the HAVIP address of the virtual router is only enabled (configured) on one ECS device, and cannot be enabled simultaneously on two or more ECSs, so that one ECS, i.e., the active ECS, needs to be selected within the ECS group before the HAVIP address of the virtual router is enabled. When each ECS in the ECS group selects the active ECS, the active ECS may be implemented based on preset software (e.g., keepalive, etc.), a preset protocol, a tenant setting, a type of each ECS, etc., which is not specifically limited in the embodiment of the present application.
In the embodiment of the application, when the location service device detects that the HAVIP address of the virtual router is available on the first ECS in the first AZ, the location service device detects whether the current routing table entry points to the first ECS, and if the current routing table entry does not point to the first ECS, generates the first routing table entry pointing to the first ECS. The first routing table entry characterizes a mapping relationship between the virtual router HAVIP address and the first ECS, and is used for indicating the address of the first ECS, so as to forward the message accessing the virtual router HAVIP address to the first ECS.
When the location service device detects whether the HAVIP address of the virtual router is available on the first ECS in the first AZ, the following two ways may be adopted:
in the first mode, the location server sends a detection message carrying the virtual router HAVIP address to each ECS in the ECS group every a first preset time period (the first preset time period can be set according to requirements), and the detection message is used for triggering a main ECS configured with the virtual router HAVIP address in the ECS group to respond. The probe message may be in ARP form, that is, the probe message may be an ARP message. When the first ECS receives the probe message, the first ECS responds to the probe message, and other ECSs in the ECS group do not respond to the probe message. In response to the probe message, the first ECS sends a first reply message to the location service device, and when the first reply message is received, the location service device determines that the virtual router HAVIP address is available on the first ECS.
In a second manner, when becoming a primary ECS within the ECS group, the first ECS sends a first primary advertisement message to the virtual router vip address to the location service device, and upon receiving the first primary advertisement message, the location service device determines that the virtual router vip address is available on the first ECS.
It should be noted that, the probe packet sent by the location service device to each ECS in the ECS group, the first reply packet sent by the first ECS to the location service device, and the first primary announcement packet sent by the first ECS to the location service device all need to be forwarded by using an intermediate device. For the first ECS, the intermediate device is a first virtual switch on a physical machine where the first ECS resides. When the position service equipment sends a detection message to a first ECS in a first AZ of the VPC, the first virtual switch receives the detection message and forwards the detection message to the first ECS; when the first ECS sends a first reply message to the position service equipment, the first virtual switch receives the first reply message and sends the first reply message to the position service equipment; when the first ECS sends a first primary advertisement message to the location service device, the first virtual switch receives the first primary advertisement message and sends the first primary advertisement message to the location service device.
In this embodiment of the present application, in order to be able to forward, to the first ECS, a message that the third ECS accesses the HAVIP address of the virtual router, the first virtual switch needs to report, to the location service device, location information of the first ECS, where the location information includes a MAC address of the first ECS, an IP address of a physical machine where the first ECS is located, and so on. When the first virtual switch reports the position information of the first ECS to the position service device, the first virtual switch can report a message sent by the position service device by means of the first ECS. Because the message sent by the first ECS to the location service device is the first reply message or the first primary announcement message, for the two messages, the manner in which the first virtual switch reports the location information to the location service device includes, but is not limited to, the following two types of messages:
in the first mode, when a first reply message sent by a first ECS is received, the first virtual switch adds the position information of the first ECS to the first reply message to obtain a second reply message, and sends the second reply message to the position service equipment.
Further, when the second reply message is received, the location service device stores a correspondence between the HAVIP address of the virtual router and the location information of the first ECS. The storage form of the correspondence relationship on the location service device may be a key-value form, where the HAVIP address of the virtual router is a key value, and the location information of the first ECS is a value. And in response to the second reply message, the location service device converts the corresponding relation between the address of the virtual router HAVIP and the location information of the first ECS into a first routing table entry.
In the second mode, when a first main announcement message sent by a first ECS is received, the first virtual switch adds the position information of the first ECS to the first main announcement message to obtain a second main announcement message, and sends the second main announcement message to the position service equipment.
Further, when the second primary announcement message is received, the location service device stores a correspondence between the virtual router HAVIP address and the location information. And in response to the second primary announcement message, the location service device converts the correspondence between the virtual router HAVIP address and the location information of the first ECS into a first routing table entry.
In the process that the first ECS provides services based on the virtual router HAVIP address, when the access equipment needs to acquire the services provided by the virtual router HAVIP address, the access equipment generates a first access message carrying the virtual router HAVIP address and sends the first access message. When a first access message sent by an access device is received, a forwarding device obtains the position information of a first ECS from a position service device according to the HAVIP address of a virtual router, encapsulates the first access message according to the position information of the first ECS to obtain a second access message, and then sends the second access message to a first virtual switch. When the second access message is received, the first virtual switch sends the second access message to the first ECS according to the position information of the first ECS encapsulated by the second access message, so that the access of the third ECS to the HAVIP address of the virtual router is realized.
The forwarding device may acquire the location information of the first ECS according to the HAVIP address of the virtual router, where the method may include: the forwarding device sends a location information acquisition request carrying the virtual router HAVIP address to the location service device, when the location information acquisition request is received, the location service device queries the current routing table entry as a first routing table entry, further obtains the location information of the first ECS based on the corresponding relation between the virtual router HAVIP address and the location information of the first ECS, then sends the location information of the first ECS to the forwarding device, and the conversion device receives the location information of the first ECS sent by the location service device, thereby obtaining the location information of the first ECS.
The forwarding device encapsulates the first access message according to the position information of the first ECS, and when obtaining the second access message, the following method may be adopted: and the forwarding equipment encapsulates the first access message by taking the MAC address of the first ECS as an inner address and taking the IP address of the physical machine where the first ECS is positioned as an outer address to obtain a second access message.
The forwarding device is a device for forwarding a message sent and received by the access device, and according to the network where the access device and the first ECS are located, the forwarding device can have multiple situations.
When the access device is a third ECS located in the same VPC as the first ECS, the forwarding device may be a third virtual switch on a physical machine where the third ECS is located; when the access device is any client device in other VPCs located in the same data center as the first ECS, the forwarding device may be a private network gateway in the VPC where the client device is located; when the access device is any client device external to the data center, the forwarding device may be a public network gateway of the data center.
As can be seen from the relationship between the access device and the forwarding device, the method provided by the embodiment of the application can be applied to the following several scenarios:
the first scene is a scene that client devices in the same VPC of the same data center access the HAVIP address of the virtual router;
the second scenario is a scenario in which client devices in different VPCs of the same data center access the HAVIP address of the virtual router;
the third scenario is a scenario where a client device outside the data center accesses a virtual router HAVIP address.
802. When it is detected that the virtual router HAVIP address is not available on the first ECS and is available on the second ECS, the location services device generates a second routing table entry directed to the second ECS.
To ensure that the service of accessing the HAVIP address of the virtual router is highly available, the first ECS serving as the active ECS is prevented from malfunctioning, and the device accessing the HAVIP address of the virtual router cannot be provided with the access service, so that each ECS in the ECS group can perform the probing. When each ECS in the ECS group are detected to be active, the heartbeat data packet may be broadcast in the ECS group at intervals of a second preset duration (the second preset duration may be set according to the requirement) based on a Keepalive mechanism, and if other ECSs in the ECS group do not receive the heartbeat data packet broadcast by the first ECS, the other ECSs in the ECS group determine that the first ECS fails. Further, when it is determined that the first ECS fails, in order to continuously provide services to the device accessing the HAVIP address of the virtual router, other ECSs in the ECS group select a second ECS in the second AZ as a master ECS to continue providing services. The method for selecting the second ECS from the ECS group is the same as the method for selecting the first ECS from the ECS group, and will not be described again.
In the embodiment of the application, when the location service device detects that the address of the HAVIP of the virtual router is not available on the first ECS but is available on a second ECS within the second AZ, the location service device detects whether the current routing table entry points to the second ECS, and if the current routing table entry does not point to the second ECS, generates a second routing table entry pointing to the second ECS. The second routing table entry characterizes a mapping relationship between the HAVIP address of the virtual router and the second ECS, and is used for indicating the address of the second ECS, so as to forward the message accessing the HAVIP address of the virtual router to the second ECS.
When the location service device detects whether the HAVIP address of the virtual router is available on the second ECS in the second AZ, the following two ways may be adopted:
in the first manner, the location server sends a probe message carrying the HAVIP of the virtual router to each ECS in the ECS group every a first preset time period (the first preset time period can be set according to the requirement). When the ECS in the ECS group selects the second ECS as the main ECS, the second ECS responds to the detection message after receiving the detection message, and other ECSs in the ECS group do not respond to the detection message. In response to the probe message, the second ECS sends a third reply message to the location service device, and when the third reply message is received, the location service device determines that the virtual router HAVIP address is available on the second ECS.
In a second manner, when becoming a primary ECS within the ECS group, the second ECS sends a third primary advertisement message to the virtual router vip address to the location service device, and when receiving the third primary advertisement message, the location service device determines that the virtual router vip address is available on the second ECS.
It should be noted that, the probe packet sent by the location service device to each ECS in the ECS group, the third reply packet sent by the second ECS to the location service device, and the third primary announcement packet sent by the second ECS to the location service device all need to be forwarded by using an intermediate device. For the second ECS, the intermediary device is a second virtual switch. When the location service device sends a detection message to a second ECS in a second AZ, the second virtual switch receives the detection message and forwards the detection message to the second ECS; when the second ECS sends a third reply message to the position service equipment, the second virtual switch receives the third reply message and sends the third reply message to the position service equipment; when the second ECS sends a third primary advertisement message to the location service device, the second virtual switch receives the third primary advertisement message and sends the third primary advertisement message to the location service device.
In this embodiment of the present application, in order to be able to forward a message that the third ECS accesses the HAVIP address of the virtual router to the second ECS, the second virtual switch needs to report location information of the second ECS to the location service device, where the location information of the second ECS includes a MAC address of the second ECS and an IP address of a physical machine where the second ECS is located. When the second virtual switch reports the position information of the second ECS to the position service device, the second virtual switch can report a message sent by the position service device by means of the second ECS. Because the message sent by the second ECS to the location service device is the third reply message or the third primary announcement message, for the two messages, the manner in which the second virtual switch reports the location information to the location service device includes, but is not limited to, the following two types of messages:
in the first mode, when receiving a third reply message sent by the second ECS, the second virtual switch adds the position information of the second ECS to the third reply message to obtain a fourth reply message, and sends the fourth reply message to the position service equipment.
Further, when the fourth reply message is received, the location service device stores a correspondence between the HAVIP address of the virtual router and the location information of the second ECS. The corresponding relation is used for indicating the current position of the virtual router HAVIP address, the storage form of the corresponding relation on the position service equipment can be a key-value form, wherein the virtual router HAVIP address is a key value, and the position information of the second ECS is a value. And in response to the fourth reply message, the location service device converts the corresponding relation between the virtual router HAVIP address and the location information of the second ECS into a second routing table entry.
In the second mode, when receiving a third main announcement message sent by the second ECS, the second virtual switch adds the position information of the second ECS to the third main announcement message to obtain a fourth main announcement message, and sends the fourth main announcement message to the position service equipment.
Further, when the fourth primary advertisement message is received, the location service device stores a correspondence between the HAVIP address of the virtual router and the location information. And in response to the fourth primary advertisement message, the location service device converts the correspondence between the virtual router HAVIP address and the location information of the second ECS into a second routing table entry.
803. The location services device switches the first routing entry to a second routing entry to enable the second ECS to provide services via the virtual router HAVIP address.
In this embodiment of the present application, the current routing table entry is used to indicate an address of a device where the HAVIP address of the virtual router is currently located, after the first ECS fails and fails to provide a service, the location service device generates a second routing table entry for the second ECS, in order to enable the device accessing the HAVIP address of the virtual router to continue providing the service, the location server switches the current routing table entry from the first routing table entry to the second routing table entry, so that when an access packet to the HAVIP address of the virtual router is received, the access packet can be forwarded to the second ECS based on the current routing table entry, and thus the second ECS continues providing the service through the HAVIP address of the virtual router.
The method provided by the embodiment of the application can realize second-level switching of the HAVIP address of the virtual router among the AZ-crossing devices, ensures high service availability, and is particularly effective for the AZ-crossing application network elements (such as GLSB, gateway and the like) and the AZ-crossing high availability systems of users.
According to the method provided by the embodiment of the application, the HAVIP address of the virtual router is a global IP address which can span different AZ, and ECS in different AZ can bind the HAVIP address of the virtual router at the same time, so that the method has the use authority of the HAVIP address of the virtual router. In an ECS group consisting of a plurality of ECSs bound to virtual router HAVIP addresses within different AZ, when a location service device detects that the virtual router HAVIP addresses are available on a first ECS, a first routing table entry pointing to the first ECS is generated, and the first ECS provides service for access devices to the virtual router HAVIP addresses. When it is detected that the virtual router HAVIP address is not available on the first ECS and is available on the second ECS, the location services device generates a second routing table entry pointing to the second ECS, and the second ECS is enabled to service the access device of the virtual router HAVIP address by switching the first routing table entry to the second routing table entry. Since the ECSs within the ECS group are identical in their status, when a first ECS that is a master ECS fails, the master ECS selected by the ECS group may be an ECS that is located within the same AZ as the first ECS, or may be an ECS that is located within a different AZ than the first ECS, and whichever ECS the location service device may generate a routing table that points to that ECS, thereby providing a high availability service for devices that access the virtual router HAVIP address.
The embodiment of the application provides a computer readable storage medium, wherein at least one computer program is stored in the computer readable storage medium, and the at least one computer program can realize the device switching method crossing AZ when being executed by a processor.
Embodiments of the present application provide a computer program product comprising a computer program capable of implementing the above-described inter-AZ device switching method when executed by a processor.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (14)

1. A system for switching devices across AZ, the system comprising: the cloud server ECS is connected with the position service equipment, the at least two virtual switches and each virtual switch, and the position service equipment is connected with the at least two virtual switches;
the location service device and at least two virtual switches are located in the same data center, the at least two virtual switches are located in the same Virtual Private Cloud (VPC) of the data center, the VPC comprises at least two available Areas (AZ), each virtual switch and a connected ECS are deployed in one AZ, the ECS connected with the at least two virtual switches has the use authority of a high-availability virtual network interconnection protocol (HAVIP) address of a virtual router, the HAVIP address of the virtual router is distributed by the VPC, and the HAVIP address of the virtual router is a global IP address which can span different AZ;
each virtual switch is used for forwarding messages between the location service equipment and the connected ECS;
each ECS connected with the virtual switch is used for providing service through the virtual router HAVIP address when becoming a main ECS, and the main ECS is an ECS available for the virtual router HAVIP address;
The location service device is configured to generate and manage a routing table entry of the active ECS, where the routing table entry is configured to indicate an address of the active ECS, so as to forward a message accessing the HAVIP address of the virtual router to the active ECS.
2. The system of claim 1, wherein the system further comprises: the private network gateway is located in the VPC, is connected with the location service equipment and at least two virtual switches in the VPC, and is used for forwarding messages of client equipment in other VPCs of the data center accessing the address of the virtual router HAVIP to the main ECS.
3. The system according to claim 1 or 2, characterized in that the system further comprises: the public network gateway is positioned in the data center and connected with the position service equipment, and is used for forwarding a message of the virtual router HAVIP address accessed by the client equipment outside the data center to the main ECS.
4. A method of switching devices across AZ, the method being applied to the system of switching devices across AZ according to any one of claims 1 to 3, the method comprising:
When the virtual router HAVIP address is detected to be available on a first ECS, the location service equipment generates a first routing table item pointing to the first ECS, wherein the first ECS is any ECS in a first AZ of the VPC, and the first routing table item is used for indicating the address of the first ECS so as to forward a message accessing the virtual router HAVIP address to the first ECS;
when the virtual router HAVIP address is detected to be unavailable on the first ECS and available on a second ECS, the location services device generates a second routing table entry pointing to the second ECS, the second ECS being any ECS within a second AZ of the VPC, the second routing table entry being used to indicate an address of the second ECS, so as to forward a message accessing the virtual router HAVIP address to the second ECS;
and the location service equipment switches the first routing table entry into the second routing table entry so that the second ECS provides service through the virtual router HAVIP address.
5. The method of claim 4, wherein the location services device detecting that the virtual router vip address is available on the first ECS comprises:
The position service equipment sends a detection message carrying the virtual router HAVIP address to each ECS in an ECS group, wherein the ECS group consists of ECSs with the virtual router HAVIP address use permission in the VPC, and the detection message is used for triggering a main ECS in the ECS group to respond;
responding to the received detection message, and sending a first reply message to the position service equipment by the first ECS;
upon receiving the first reply message, the location services device determines that the virtual router HAVIP address is available on the first ECS.
6. The method of claim 5, wherein the method further comprises:
when the first reply message sent by the first ECS is received, a first virtual switch adds the position information of the first ECS to the first reply message to obtain a second reply message, and sends the second reply message to the position service equipment, wherein the first virtual switch is a virtual switch connected with the first ECS;
the location service device generating a first routing table entry directed to the first ECS, comprising:
and when the second reply message is received, the position service equipment converts the corresponding relation between the virtual router HAVIP address and the position information into the first routing table entry.
7. The method of claim 4, wherein the location services device detecting that the virtual router vip address is available on the first ECS comprises:
when the ECS is a main ECS in an ECS group, the first ECS sends a first main announcement message for the virtual router HAVIP address to the position service equipment, and the ECS group consists of ECSs with the virtual router HAVIP address use authority in the VPC;
upon receiving the first primary advertisement message, the location service device determines that the virtual router vip address is available on the first ECS.
8. The method of claim 7, wherein the method further comprises:
when a first main announcement message sent by the first ECS is received, a first virtual switch adds the position information of the first ECS to the first main announcement message to obtain a second main announcement message, and sends the second main announcement message to the position service equipment, wherein the first virtual switch is a virtual switch connected with the first ECS;
the location service device generating a first routing table entry directed to the first ECS, comprising:
And when the second main announcement message is received, the position service equipment converts the corresponding relation between the virtual router HAVIP address and the position information into the first routing table entry.
9. The method according to claim 6 or 8, wherein after the location service device generates a first routing table entry directed to the first ECS, further comprising:
when a first access message of the access equipment to the virtual router HAVIP address is received, the forwarding equipment acquires the position information from the position service equipment according to the virtual router HAVIP address;
the forwarding equipment encapsulates the first access message according to the position information to obtain a second access message;
the forwarding device sends the second access message to the first virtual switch;
and when the second access message is received, the first virtual switch sends the second access message to the first ECS so as to realize the access of the access equipment to the HAVIP address of the virtual router.
10. The method of claim 9, wherein the location information includes a MAC address of the first ECS and an IP address of a physical machine where the first ECS is located, and the forwarding device encapsulates the first access packet according to the location information to obtain the second access packet, including:
And the forwarding device encapsulates the first access message by taking the MAC address of the first ECS as an inner layer address and taking the IP address of the physical machine where the first ECS is positioned as an outer layer address to obtain the second access message.
11. The method of claim 9, wherein the access device is any ECS within the VPC and the forwarding device is a virtual switch to which the ECS is connected; or alternatively, the process may be performed,
the access equipment is any client equipment in other VPCs of the data center, and the forwarding equipment is a private network gateway in the VPC where the client equipment is located; or alternatively, the process may be performed,
the access device is any client device outside the data center, and the forwarding device is the public network gateway.
12. The method according to any one of claims 4 to 11, wherein when the object on which the HAVIP address of the virtual router is mounted is an ECS, the first ECS is any ECS connected to a first virtual switch in the first AZ, and the second ECS is any ECS connected to a second virtual switch in the second AZ;
when the mounting object of the virtual router HAVIP address is an aggregation port, the first ECS is a plurality of ECSs connected with the first aggregation port in the first AZ, and the second ECS is a plurality of ECSs connected with the second aggregation port in the second AZ;
When the mounting object of the virtual router HAVIP address is a virtual switch HAVIP address, the first ECS is an ECS with the first virtual switch HAVIP address configured in the first AZ, and the second ECS is an ECS with the second virtual switch HAVIP address configured in the second AZ.
13. A computer readable storage medium, characterized in that at least one computer program is stored in the computer readable storage medium, which at least one computer program, when being executed by a processor, enables the method of switching devices across AZs according to any of claims 4 to 12.
14. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, enables the method of switching devices across AZ according to any of claims 4 to 12.
CN202310156572.8A 2023-02-20 2023-02-20 System, method, storage medium and program product for switching devices across AZ Pending CN116346713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310156572.8A CN116346713A (en) 2023-02-20 2023-02-20 System, method, storage medium and program product for switching devices across AZ

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310156572.8A CN116346713A (en) 2023-02-20 2023-02-20 System, method, storage medium and program product for switching devices across AZ

Publications (1)

Publication Number Publication Date
CN116346713A true CN116346713A (en) 2023-06-27

Family

ID=86881402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310156572.8A Pending CN116346713A (en) 2023-02-20 2023-02-20 System, method, storage medium and program product for switching devices across AZ

Country Status (1)

Country Link
CN (1) CN116346713A (en)

Similar Documents

Publication Publication Date Title
EP3367638B1 (en) Load balancing method, device and system
US10911398B2 (en) Packet generation method based on server cluster and load balancer
US11277471B2 (en) Managing replication of computing nodes for provided computer networks
US10567308B1 (en) Virtual machine virtual fabric login system
CN110113441B (en) Computer equipment, system and method for realizing load balance
US10749936B1 (en) Managing communications having multiple alternative destinations
US9736016B2 (en) Managing failure behavior for computing nodes of provided computer networks
US9749181B2 (en) Managing communications for modified computer networks
US11822443B2 (en) Highly-available distributed network address translation (NAT) architecture with failover solutions
EP3486776A1 (en) Providing logical networking functionality for managed computer networks
US11671401B2 (en) Providing persistent external internet protocol address for extra-cluster services
CN101827039B (en) Method and equipment for load sharing
CN107872368B (en) Method and device for detecting accessibility of gateway in network node cluster and terminal
CN104618243A (en) Routing method, device and system, and gateway scheduling method and device
US9154367B1 (en) Load balancing and content preservation
US10924397B2 (en) Multi-VRF and multi-service insertion on edge gateway virtual machines
CN116346713A (en) System, method, storage medium and program product for switching devices across AZ
US20210352004A1 (en) Multi-vrf and multi-service insertion on edge gateway virtual machines
EP4315799A1 (en) Providing persistent external internet protocol address for extra-cluster services
US12028314B2 (en) Providing persistent external internet protocol address for extra-cluster services
CN114826887B (en) Private network connection communication method and system
CN116781625A (en) Load balancing method, device, equipment and computer readable storage medium
CN117354309A (en) Method for realizing source ip transparent transmission by load balancing system based on lvs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination