Traffic replication method and apparatus based on load balancing, and traffic replication node
By introducing traffic replication nodes in the load balancing environment, the problems of low traffic replication efficiency and resource occupation in the existing technology are solved, efficient traffic replication is achieved, operation and maintenance complexity and equipment costs are reduced, and the performance of the cloud service system is improved. and scalability.
Patent Information
- Application Number
- PCT/CN2024/083627
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-31
- Filing Date
- 2024-03-25
- Publication Date
- 2024-10-31
AI Technical Summary
Existing traffic mirroring technology is inefficient in load balancing environments, and the traffic mirroring process is deployed on the same node as the load balancer or cloud service application, resulting in resource congestion and high operation and maintenance complexity.
Introduce a traffic replication node in a load balancing environment, use this node to receive business packets sent by the load balancing node and generate new business packets according to the configured traffic replication rules to achieve traffic replication and avoid traffic on the computing node or load balancing node. Replication, providing dedicated computing resources for efficient replication.
It improves the efficiency of traffic replication, avoids resource occupation and operation and maintenance complexity of load balancing nodes by the traffic mirroring process, reduces equipment costs, and improves the overall performance and scalability of the cloud service system.
Smart Images

Figure CN2024083627_31102024_PF_FP_ABST
Abstract
Description
Traffic replication method, device, and traffic replication node based on load balancing
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on April 28, 2023, with application number 202310486882.6 and application name “A traffic distribution method and device based on programmable devices”, the entire contents of which are incorporated by reference into this application; this application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on July 31, 2023, with application number 202310952530.5 and application name “Traffic replication method, device and traffic replication node based on load balancing”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of cloud computing technology, and in particular to a traffic replication method, device, and traffic replication node based on load balancing. Background Art
[0004] Traffic mirroring technology can be used to replicate business traffic from a production environment to a production-like environment. Without end users' awareness, this traffic can be used to verify pre-release versions of applications in the production-like environment. This allows for the identification and resolution of pre-release issues before the application is released. The production environment can be understood as the business server cluster running cloud service applications, while the production-like environment can be understood as the test server cluster running pre-release versions of applications.
[0005] Current traffic mirroring technology typically deploys a traffic mirroring process on a load balancer or on a node device that hosts a production application. This process is responsible for replicating monitored service traffic and distributing it to a production-like environment. However, deploying the traffic mirroring process on the same node device as the load balancer or cloud service application not only consumes resources on the load balancer or cloud service application but also reduces traffic replication efficiency.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a traffic replication method, device, and traffic replication node based on load balancing. In a load balancing environment, efficient traffic replication can be achieved through the traffic replication node.
[0008] In a first aspect, an embodiment of the present application provides a traffic replication method based on load balancing, which can be applied to a traffic replication node set in an infrastructure. A first computing node, a second computing node, and a load balancing node can also be set in the infrastructure. The traffic replication method may include: the traffic replication node receives a traffic replication rule configured by a user, wherein the traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node. The traffic replication node can receive a first business message sent by the load balancing node, wherein the destination IP address of the first business message is the IP address of the first computing node. The traffic replication node sends the first business message to the first computing node, and generates a second business message based on the first business message and the traffic replication rule. wherein the destination IP address of the second business message is the IP address of the second computing node. The traffic replication node sends a second business message to the second computing node.
[0009] In the embodiments of the present application, traffic replication is implemented by adding a traffic replication node to the infrastructure. The traffic replication node generates a second service message based on the first service message sent by the load balancing node and the traffic replication rules, thereby achieving traffic replication without requiring traffic replication to be performed on the first computing node or the load balancing node. In a load balancing environment, the traffic replication node provides dedicated computing resources for traffic replication, thereby achieving efficient traffic replication.
[0010] In one possible implementation, the traffic replication rule may include a correspondence between the IP address of the first computing node and the IP address of the second computing node. After receiving the first service message sent by the load balancing node, the traffic replication node may replicate the first service message to obtain a mirror message of the first service message; and based on the correspondence between the IP address of the first computing node and the IP address of the second computing node, the traffic replication node may modify the IP address of the first computing node in the mirror message to the IP address of the second computing node to obtain the second service message.
[0011] In the above implementation, when there are multiple computing nodes, the traffic replication node can replicate the first business message based on the correspondence between the IP addresses of the computing nodes in the traffic replication rule, accurately determine the destination IP address of the second business message, and then obtain the second business message.
[0012] In one possible implementation, the destination port information of the first service message is the port information of the first application. The traffic replication node can send the first service message to the first application in the first computing node based on the IP address of the first computing node and the port information of the first application.
[0013] In the above implementation, when multiple applications are running in the first computing node, the traffic replication node can accurately send the first service message to the corresponding application in the first computing node according to the destination port information of the first service message.
[0014] In one possible implementation, the traffic replication rule may further include a correspondence between the port information of the first application and the port information of the second application, where the second application is an application in the second computing node. Based on the correspondence between the port information of the first application and the port information of the second application, the traffic replication node may determine that the destination port information of the second service packet is the port information of the second application, and send the second service packet to the second application in the second computing node based on the IP address of the second computing node and the port information of the second application.
[0015] In the above implementation, when multiple applications are running in the second computing node, the traffic replication node can accurately determine the destination port information of the second business message based on the correspondence between the port information of the applications in the traffic replication rules, and then send the second business message to the corresponding application in the second computing node.
[0016] In one possible implementation, after the traffic replication node sends the second business message to the second computing node, if it receives a first reply message for the first business message sent by the first computing node, it sends the first reply message to the load balancing node; if it receives a second reply message for the second business message sent by the second computing node, it discards the second reply message.
[0017] In one possible implementation, when a reply message is received, the traffic replication node can determine, based on the IP address and traffic replication rules carried in the reply message, that the reply message is the first reply message sent by the first computing node, or that the reply message is the second reply message sent by the second computing node.
[0018] Through the above process, based on the traffic replication rules, the traffic replication node can accurately distinguish between the reply packets returned by the first computing node and the reply packets returned by the second computing node. The traffic replication node can discard the reply packets returned by the second computing node, while sending the reply packets returned by the first computing node to the load balancing node to ensure normal business service communication flow.
[0019] In the second aspect, the embodiment of the present application also provides a traffic replication method based on load balancing technology, which can be applied to a management platform, which is used to manage infrastructure, wherein the infrastructure may include a load balancing node, a traffic replication node, a first computing node, and a second computing node. The traffic replication method may include: the management platform obtains a user-configured message distribution rule, wherein the message distribution rule includes the IP address of the first computing node; sends the message distribution rule to the load balancing node, wherein the message distribution rule is used to instruct the load balancing node to send a business message to the first computing node, wherein the business message is sent to the first computing node through the traffic replication node. The management platform obtains a user-configured traffic replication rule, wherein the traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node; sends the traffic replication rule to the traffic replication node, wherein the traffic replication rule is used to instruct the traffic replication node to replicate the business message and send it to the second computing node.
[0020] In a third aspect, an embodiment of the present application provides a traffic replication device based on load balancing, which is applied to a traffic replication node. The traffic replication node is set in an infrastructure. The infrastructure is further provided with a first computing node, a second computing node, and a load balancing node. The device includes:
[0021] A rule receiving unit, configured to receive a traffic replication rule configured by a user, the traffic replication rule including an IP address of a first computing node and an IP address of a second computing node;
[0022] A message receiving unit, configured to receive a first service message sent by the load balancing node, wherein the destination IP address of the first service message is the IP address of the first computing node;
[0023] A traffic distribution unit, configured to send a first service message to the first computing node;
[0024] The traffic mirroring unit is used to generate a second service message according to the first service message and the traffic replication rule, and send the second service message to the second computing node; the destination IP address of the second service message is the IP address of the second computing node.
[0025] In one possible implementation, the traffic replication rule includes a correspondence between an IP address of a first computing node and an IP address of a second computing node; and the traffic mirroring unit is specifically configured to:
[0026] Copying the first service message to obtain a mirror image message of the first service message;
[0027] According to the correspondence between the IP address of the first computing node and the IP address of the second computing node, the IP address of the first computing node in the mirrored message is modified to the IP address of the second computing node to obtain a second service message.
[0028] In a possible implementation, the destination port information of the first service message is port information of the first application; and the traffic distribution unit is specifically configured to:
[0029] The first service message is sent to the first application in the first computing node according to the IP address of the first computing node and the port information of the first application.
[0030] In one possible implementation, the traffic replication rule further includes a correspondence between port information of the first application and port information of the second application, where the second application is an application in the second computing node; and the traffic mirroring unit is specifically configured to:
[0031] Determining, based on a correspondence between the port information of the first application and the port information of the second application, that the destination port information of the second service message is the port information of the second application;
[0032] The second service message is sent to the second application in the second computing node according to the IP address of the second computing node and the port information of the second application.
[0033] In a possible implementation, the apparatus may further include a reply message processing unit, the reply message processing unit being configured to:
[0034] If a first reply message for the first service message sent by the first computing node is received, the first reply message is sent to the load balancing node;
[0035] If a second reply message for the second service message sent by the second computing node is received, the second reply message is discarded.
[0036] In a possible implementation, the reply message processing unit is further configured to:
[0037] When a reply message is received, it is determined, based on the IP address and traffic replication rule carried in the reply message, that the reply message is the first reply message sent by the first computing node, or that the reply message is the second reply message sent by the second computing node.
[0038] In a fourth aspect, an embodiment of the present application provides a traffic replication node, comprising a memory and a processor, wherein a computer program is stored in the memory; the processor is used to read and execute the computer program stored in the memory, so that any one of the methods provided in the first aspect is executed.
[0039] In a fifth aspect, an embodiment of the present application provides a cloud service system, which may include a traffic replication node, a first computing node, a second computing node, and a load balancing node; wherein the traffic replication node may adopt the traffic replication node provided in the fourth aspect. Exemplarily, the load balancing node is used to receive a message distribution rule configured by a user; the message distribution rule includes the IP address of the first computing node; the traffic replication node is used to receive a traffic replication rule configured by a user, the traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node; the load balancing node is also used to determine, based on the message distribution rule, that the destination IP address of the first business message is the IP address of the first computing node, and send the first business message to the traffic replication node; the traffic replication node is also used to receive the first business message, send the first business message to the first computing node, and generate a second business message based on the first business message and the traffic replication rule, and send the second business message to the second computing node; the destination IP address of the second business message is the IP address of the second computing node.
[0040] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any one of the methods provided in the first or second aspect above.
[0041] In a seventh aspect, an embodiment of the present application provides a computer program product comprising computer-executable instructions, which are used to enable a computer to execute any one of the methods provided in the first or second aspect above.
[0042] The technical effects that can be achieved in any of the second to seventh aspects can refer to the description of the beneficial effects in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] FIG1 is a schematic diagram of the structure of a cloud service system provided in an embodiment of the present application;
[0044] FIG2 is an interactive diagram of a traffic replication method based on load balancing provided in an embodiment of the present application;
[0045] FIG3 is a schematic diagram of traffic transmission between nodes provided in an embodiment of the present application;
[0046] FIG4 is a schematic diagram of the structure of another cloud service system provided in an embodiment of the present application;
[0047] FIG5 is a schematic diagram of a rule distribution process provided in an embodiment of the present application;
[0048] FIG6 is a schematic diagram of a flow distribution and flow replication process provided in an embodiment of the present application;
[0049] FIG7 is a flow chart of a traffic replication method based on load balancing provided in an embodiment of the present application;
[0050] FIG8 is a schematic diagram of another load balancing-based traffic replication device provided in an embodiment of the present application;
[0051] FIG9 is a schematic diagram of a traffic replication device based on load balancing provided in an embodiment of the present application;
[0052] FIG10 is a schematic diagram of another load balancing-based traffic replication device provided in an embodiment of the present application;
[0053] FIG11 is a schematic diagram of another traffic replication device based on load balancing provided in an embodiment of the present application;
[0054] FIG12 is a schematic diagram of the structure of a traffic replication node provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. The terms used in the implementation methods of this application are only used to explain the specific embodiments of the present application and are not intended to limit this application. Obviously, the embodiments described are only some embodiments of the present application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0056] Before introducing the specific solutions provided by the embodiments of the present application, some of the terms in the present application are explained to facilitate understanding by those skilled in the art, and the terms in the present application are not limited.
[0057] (1) Production-like environment: The production environment can be understood as a business server cluster running cloud service applications, while the production-like environment can be understood as a test server cluster running pre-release versions of applications. For applications, the production-like environment is a transition from the test environment to the production environment. Applications can be tested in the production-like environment for the final time before they are officially released. The configuration, database, and other aspects of the production-like environment are consistent with those of the production environment. Testing applications in the production-like environment helps to discover hidden problems caused by code changes in advance.
[0058] (2) Open System Interconnection (OSI) Model: The OSI model is a standard framework that allows various types of computers to be interconnected into a network. The OSI model divides the computer network architecture into seven layers. Each layer implements its own functions and protocols and completes interface communication with adjacent layers. The seven layers are: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, and application layer. Among them, the fourth layer is the transport layer, which is used to provide communication transmission services between computers. The main protocols used in the transport layer include TCP and UDP. The seventh layer is the application layer. The application layer can provide services for different network applications through different application layer protocols. The application layer protocols are used to define the interaction rules between applications.
[0059] (3) Application load balancer (ALB): A network component. ALB can be used to distribute and balance received business traffic across multiple servers or computing nodes in a cloud service system to improve the availability, scalability, and system performance of the cloud service system. Each business message received by the ALB is considered business traffic. The ALB can distribute the received business traffic to multiple computing nodes connected to the backend to ensure that each computing node receives a reasonable load and avoid overloading a single computing node.
[0060] In the embodiments of the present application, "multiple" refers to two or more. In view of this, in the embodiments of the present application, "multiple" can also be understood as "at least two". "At least one" can be understood as one or more, for example, one, two or more. For example, including at least one means including one, two or more, and does not limit which ones are included. For example, including at least one of A, B and C, then the included ones may be A, B, C, A and B, A and C, B and C, or A, B and C. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0061] Unless otherwise specified, ordinal numbers such as "first" and "second" in the embodiments of the present application are used to distinguish multiple objects and are not used to limit the order, timing, priority or importance of multiple objects.
[0062] Current traffic mirroring technology typically deploys a traffic mirroring process on the node devices of the ALB or production application. The traffic mirroring process is responsible for replicating and distributing monitored service traffic to a production-like environment. Deploying the traffic mirroring process on the same node device as the ALB or cloud service application not only consumes ALB or cloud service application resources but also reduces traffic replication efficiency.
[0063] Based on this, an embodiment of the present application provides a cloud service system that can be applied to an infrastructure. For example, the infrastructure can be the infrastructure in an automated testing scenario for an application. Figure 1 exemplarily shows a schematic diagram of the structure of a cloud service system. As shown in Figure 1, the cloud service system may include a load balancing node 100, a traffic replication node 200, a first computing node 400, and a second computing node 500. The first computing node 400 can be used to run a cloud service application, and the second computing node 400 can be used to run a test application to be tested. The first computing node 400 and the second computing node 500 can be understood as application carriers. For example, the first computing node 400 and the second computing node 500 can be virtual devices, such as containers, virtual machines, serverless functions, etc., or they can be physical servers. The traffic replication node 200 can receive user-configured traffic replication rules and replicate the service messages sent by the load balancing node 100 according to the traffic replication rules, sending the original service messages to the first computing node 400 and sending the replicated new service messages to the second computing node 500.
[0064] In some embodiments, the cloud service system may include multiple computing nodes for running cloud service applications and multiple computing nodes for running test applications. The first computing node 400 may be any one of the multiple computing nodes for running cloud service applications, and the second computing node 500 may be any one of the multiple computing nodes for running test applications.
[0065] In addition to being applied to automated testing scenarios of applications, the cloud service system shown in FIG1 can also be applied to other traffic replication scenarios, which is not limited in the embodiments of the present application.
[0066] In some embodiments, the cloud service system may further include a management platform 300, which is used to manage the infrastructure and may send message distribution rules to the load balancing node 100 and traffic replication rules to the traffic replication node 200. The load balancing node 100 may use an ALB. For received service messages, the ALB may determine the destination Internet Protocol (IP) address of the service message based on the message distribution rules (also known as load balancing rules) sent by the management platform 300, add the destination IP address of the service message to the service message, and send the service message to the traffic replication node 200. Assuming that the destination IP address of the business message is the IP address of the first computing node 400, the traffic replication node 200 is used to send the business message to the first computing node 400 according to the destination IP address carried in the business message, and copy the received business message, and determine the destination IP address of the copied business message according to the traffic replication rule. Assuming that the destination IP address of the copied business message is the IP address of the second computing node 500, the traffic replication node 200 can send the copied business message to the second computing node 500.
[0067] Exemplarily, the load balancing node 100 can be used to receive a user-configured message distribution rule, wherein the message distribution rule includes the IP address of the first computing node; the traffic replication node 200 can be used to receive a user-configured traffic replication rule, wherein the traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node. The load balancing node 100 can also be used to determine, based on the message distribution rule, that the destination IP address of the first business message is the IP address of the first computing node, and send the first business message to the traffic replication node; the traffic replication node 200 can also be used to receive the first business message, send the first business message to the first computing node, and generate a second business message based on the first business message and the traffic replication rule, and send the second business message to the second computing node; the destination IP address of the second business message is the IP address of the second computing node.
[0068] In an optional embodiment, the management platform 300 and the load balancing node 100 may be applications deployed on the infrastructure, and the traffic replication node 200 may be a hardware device within the infrastructure. The management platform 300 may instruct and send commands to the physical layer of the infrastructure, i.e., the hardware devices within the infrastructure.
[0069] In another optional embodiment, the management platform 300, the load balancing node 100, and the traffic replication node 200 may all be hardware devices in the infrastructure.
[0070] In the embodiments of the present application, traffic replication nodes are added to the cloud service system. Based on the service messages sent by the load balancing node and the traffic replication rules, the traffic replication nodes generate new service messages, thereby achieving traffic replication. This eliminates the need to perform traffic replication on the first computing node or the load balancing node. The traffic replication nodes provide dedicated computing resources for traffic replication, enabling efficient traffic replication.
[0071] When executing the load balancing-based traffic replication method, the interaction process between the load balancing node, the traffic replication node, the first computing node, and the second computing node is shown in Figures 2 and 3, and may include the following steps:
[0072] S201: When receiving a first service message, the load balancing node determines a destination IP address of the first service message and adds the destination IP address to the first service message.
[0073] When a client requests a service from a cloud service system, it can send a service message to the cloud service system. The client can be understood as an application installed on the user's terminal device. Service messages are considered service traffic. For example, service messages can be in the Hypertext Transfer Protocol (HTTP) format.
[0074] In some embodiments, a load balancing node in a cloud service system receives a first service packet sent by a client and can determine the destination IP address of the first service packet. Exemplarily, the management platform can send a packet distribution rule to the load balancing node. The packet distribution rule can include a correspondence between the IP addresses of multiple computing nodes used to run cloud service applications and the content of a first designated field in the service packet header. The packet distribution rule can be in a tabular format or other format. The load balancing node can determine the destination IP address of the first service packet based on the correspondence between the content of the first designated field in the service packet header and the IP addresses of each computing node, as well as the content of the first designated field in the first service packet. For example, assume that the content of the first designated field is "01," which corresponds to the IP addresses of multiple computing nodes, including the IP address of the first computing node; the content of the first designated field is "02," which corresponds to the IP addresses of multiple computing nodes, including the IP address of the third computing node; and the content of the first designated field is "03," which corresponds to the IP addresses of multiple computing nodes, including the IP address of the fifth computing node. The first, third, and fifth computing nodes are all computing nodes used to run cloud service applications. If the content of the first designated field in the header of the first business message is "01", the load balancing node selects a computing node with a smaller load from the IP addresses of multiple computing nodes corresponding to "01". For example, the load balancing node selects the first computing node from them, and can determine that the destination IP address of the first business message is the IP address of the first computing node, and add the IP address of the first computing node to the first business message.
[0075] In other embodiments, a computing node may run multiple cloud service applications. For example, a first computing node may run a first application, a third application, and a fifth application, all of which are cloud service applications. The message distribution rules may also include a correspondence between the port information of the multiple applications and the content of the second designated field in the service message header. The load balancing node may determine the destination port information of the first service message based on the correspondence between the content of the second designated field in the service message header and the port information of each application, as well as the content of the second designated field in the first service message. For example, assuming the content of the second designated field is "001," it corresponds to the port information of the first application; the content of the second designated field is "002," it corresponds to the port information of the third application; and the content of the second designated field is "003," it corresponds to the port information of the fifth application. If the content of the second designated field in the message header of the first service message is "001," the load balancing node may determine that the destination port information corresponding to the first service message is the port information of the first application, and the load balancing node may add the port information of the first application to the first service message.
[0076] Since service traffic is transmitted between devices using the standard OSI model, which has a seven-layer structure with Layer 1 being the physical layer, data is transmitted between devices as a bit stream at the physical layer. When a client sends a first service message to the cloud service system via its terminal device, the terminal device encapsulates the first service message at Layer 7 (application layer) layer by layer into a bit stream at the physical layer, i.e., the physical layer data of the first service message. The terminal device sends the physical layer data of the first service message to the load balancing node. The load balancing node decapsulates the received physical layer data layer by layer to obtain the first service message at Layer 7. The load balancing node determines the destination IP address and destination port information of the first service message based on the designated fields in the message header of the first service message and the message distribution rules, and adds the destination IP address and destination port information of the first service message to the first service message. For example, the load balancing node can add the destination IP address and destination port information of the first service message to the first service message through any of the following methods: eBPF, smartNIC, kernel module, etc.
[0077] S202: The load balancing node sends a first service message to the traffic replication node.
[0078] The first service message obtained by the load balancing node is layer 7 data. The load balancing node can encapsulate the first service message of layer 7 layer by layer to obtain the physical layer data of the first service message, and send the physical layer data of the first service message to the traffic replication node.
[0079] S203: The traffic replication node sends a first service message to the first computing node.
[0080] In some embodiments, upon receiving a first service message sent by a load balancing node, a traffic replication node may obtain a destination IP address carried in the first service message and, based on the destination IP address carried in the first service message, send the first service message to a corresponding computing node. Assuming that the destination IP address carried in the first service message is the IP address of the first computing node, the traffic replication node sends the first service message to the first computing node.
[0081] In other embodiments, if the first service message carries a destination IP address and destination port information, the traffic replication node, upon receiving the first service message sent by the load balancing node, can obtain the destination IP address and destination port information carried in the first service message and, based on the destination IP address and destination port information, send the first service message to the corresponding application in the corresponding computing node. For example, assuming that the destination IP address carried in the first service message is the IP address of the first computing node, and the destination port information is the port information of the first application, the traffic replication node can send the first service message to the first application running on the first computing node based on the IP address of the first computing node and the port information of the first application.
[0082] S204: The traffic replication node generates a second service message according to the first service message and the traffic replication rule.
[0083] Traffic replication nodes can receive user-configured traffic replication rules. Traffic replication rules can be sent to the nodes by the management platform, or they can be user-configured. The management platform receives user-configured traffic replication rules and sends them to the nodes. Traffic replication rules can be in a table or other format.
[0084] In some embodiments, the traffic replication rule may include a correspondence between the IP addresses of each computing node used to run the cloud service application and the IP addresses of each computing node used to run the test application. For example, the IP address of the first computing node corresponds to the IP address of the second computing node. Among them, the second computing node is a computing node used to run the test application. After the traffic replication node receives the first business message sent by the load balancing node, it can copy the first business message to obtain a mirror message of the first business message, and according to the correspondence between the IP address of the first computing node and the IP address of the second computing node, modify the IP address of the first computing node in the mirror message to the IP address of the second computing node to obtain the second business message.
[0085] In other embodiments, if multiple applications are running in a computing node, for example, a second application, a fourth application, and a sixth application are running in a second computing node, and the second application, the fourth application, and the sixth application are all test applications. The traffic replication rule may also include a correspondence between the port information of the cloud service application and the port information of the test application. For example, the port information of the first application corresponds to the port information of the second application. The first application is a cloud service application, and the second application is a test application. After the traffic replication node replicates the first business message and obtains a mirror message of the first business message, in addition to modifying the IP address of the first computing node in the mirror message to the IP address of the second computing node based on the correspondence between the IP address of the first computing node and the IP address of the second computing node, it may also modify the port information of the first application in the mirror message to the port information of the second application based on the correspondence between the port information of the cloud service application and the port information of the test application to obtain a second business message.
[0086] In some embodiments, the traffic replication node receives the physical layer data of the first business message sent by the load balancer, decapsulates the physical layer data of the first business message layer by layer, and obtains the first business message of layer 4, that is, the transport layer data of the first business message. The traffic replication node replicates the transport layer data of the first business message to obtain a mirror message of the first business message.
[0087] The traffic replication node replicates the service traffic at Layer 4 without having to decapsulate the physical layer data of the service traffic layer by layer to Layer 7. This can save the computing resources of the traffic replication node and improve the efficiency of the traffic mirroring process.
[0088] In some embodiments, traffic replication node 200 may be a programmable network processor device (NP) or a hardware-accelerated programmable network device. A programmable network processor device may also be referred to as a programmable NP device. A programmable network device can replicate service traffic to be distributed based on hardware, further improving the efficiency of the traffic mirroring process.
[0089] S205: The traffic replication node sends a second service message to the second computing node.
[0090] In some embodiments, the traffic replication node may send the second service packet to a corresponding computing node based on the destination IP address of the second service packet. For example, if the destination IP address of the second service packet is the IP address of the second computing node, the traffic replication node sends the second service packet to the second computing node.
[0091] In other embodiments, the traffic replication node may send the second service packet to the corresponding application on the corresponding computing node based on the destination IP address and destination port information of the second service packet. For example, if the destination IP address of the second service packet is the IP address of the second computing node, and the destination port information is the port information of the second application, the traffic replication node may send the second service packet to the second application running on the second computing node based on the IP address of the second computing node and the port information of the second application.
[0092] In other embodiments, step S203 may be performed after step S204, or after step S205, or simultaneously with step S205.
[0093] In some embodiments, when a cloud service application running on a first computing node receives a service message sent by a traffic replication node, it can send a reply message to the traffic replication node for the service message, with the reply message carrying the IP address of the first computing node. When a test application running on a second computing node receives a mirrored service message sent by the traffic replication node, it can also send a reply message to the traffic replication node for the mirrored service message, with the reply message carrying the IP address of the second computing node.
[0094] When the traffic replication node receives a first reply message for the first service message sent by the first computing node, the traffic replication node may send the first reply message to the load balancing node. When the traffic replication node receives a second reply message for the second service message sent by the second computing node, the traffic replication node may discard the second reply message.
[0095] Exemplarily, when a traffic replication node receives a reply message for a business message, it can determine, based on the IP address carried in the reply message and the traffic replication rule, whether the reply message is sent by a computing node running a cloud service application or a computing node used to run a test application. For example, if the reply message carries the IP address of the first computing node, then according to the traffic replication rule, it can be determined that the first computing node is a computing node used to run a cloud service application, and the reply message is the first reply message sent by the first computing node for the first business message, then the reply message can be sent to the load balancing node, and the load balancer sends the reply message to the client. If the reply message carries the IP address of the second computing node, then according to the traffic replication rule, it can be determined that the second computing node is a computing node used to run a test application, and the reply message is the second reply message sent by the second computing node for the second business message, then the reply message can be discarded.
[0096] To address the low efficiency of traffic replication in a load-balancing environment in related technologies, an embodiment of the present application adds a traffic replication node to the basic setup. The traffic replication node can be set between the load-balancing node and the computing node used to run the cloud service application. The traffic replication node receives user-configured traffic replication rules and, based on the traffic replication rules, replicates the first business message sent by the load-balancing node to generate a second business message. In a load-balancing environment, the traffic replication node provides dedicated computing resources for traffic replication, which can achieve efficient traffic replication.
[0097] Furthermore, traffic mirroring is achieved by replicating received service packets through traffic replication nodes, eliminating the need to deploy traffic mirroring processes on the compute nodes used to run cloud service applications. This prevents each cloud service application's compute node from maintaining its own traffic mirroring process, which would affect cloud service application performance. Traffic mirroring processes also do not need to be deployed on load balancing nodes, reducing the operational complexity of load balancing nodes and facilitating service stability. This also prevents traffic mirroring processes from crowding out physical resources such as connection resources, memory resources, and network interface card (NIC) bandwidth on load balancing nodes, improving load balancing node performance. Running traffic mirroring, cloud service applications, and load balancing nodes on different physical nodes decouples traffic mirroring from load balancing nodes and cloud service applications, improving the overall performance of the cloud service system.
[0098] In some embodiments, the load balancing nodes in the cloud service system can be load balancers, the traffic replication nodes can be traffic replication devices, the management platform can be control devices, the computing nodes used to run cloud service applications can be business servers, and the computing nodes used to run test applications can be test servers. The number of load balancers, traffic replication devices, control devices, business servers, and test servers can all be multiple. For example, as shown in Figure 4, the cloud service system may include a load balancer cluster 110, a traffic replication device cluster 210, a control device cluster 310, a business server cluster 410, and a test server cluster 510. The load balancer cluster 110 may include one or more load balancers, the traffic replication device cluster 210 may include one or more traffic replication devices, the control device cluster 310 may include one or more control devices, the business server cluster 410 may include one or more business servers, and the test server cluster 510 may include one or more test servers.
[0099] As shown in Figure 5, the control devices in control device cluster 310 are used to send message distribution rules to the load balancers in load balancer cluster 110. The message distribution rules are used to instruct the load balancers to determine the service servers and cloud service applications corresponding to service messages. The control devices in control device cluster 310 are also used to send traffic replication rules to the traffic replication devices in traffic replication device cluster 210. The traffic replication rules are used to instruct the traffic replication devices to determine the test servers and test applications corresponding to mirrored service messages. Mirrored service messages are obtained by traffic replication nodes replicating received service messages.
[0100] In an optional embodiment, load balancer cluster 110 may include multiple subclusters. As shown in FIG4 , load balancer cluster 110 may include two subclusters: load balancer subcluster A and load balancer subcluster B. Load balancer subcluster A and load balancer subcluster B may be active-active disaster recovery clusters, both providing service traffic proxy and routing services for cloud service applications. Alternatively, load balancer subcluster A and load balancer subcluster B may be two disaster recovery clusters with the same functionality. Load balancer subcluster A and load balancer subcluster B may monitor each other's health and perform function switching. If one load balancer subcluster unexpectedly ceases to function, it may be switched to another load balancer subcluster, allowing the load balancer cluster to continue functioning normally. Business server cluster 410 may also include multiple business servers, such as business server A and business server B. Both business server A and business server B are used to run cloud service applications, and each business server may run multiple cloud service applications. Test server cluster 510 may also include multiple test servers, such as test server A and test server B. Test server A and test server B are both used to run test applications, and each test server can run multiple test applications.
[0101] Control device cluster 310 may include two control devices, namely control device A and control device B. Control device A may send a message distribution rule for service server A to the load balancer in load balancer subcluster A. Control device B may send a message distribution rule for service server B to the load balancer in load balancer subcluster B.
[0102] Traffic replication device cluster 210 may include two traffic replication devices, namely traffic replication device A and traffic replication device B. Traffic replication device A can receive service packets sent by the load balancer in load balancer subcluster A, and traffic replication device B can receive service packets sent by the load balancer in load balancer subcluster B. Control device A can also send traffic replication rules for test server A to traffic replication device A. Control device B can also send traffic replication rules for test server B to traffic replication device B.
[0103] For example, load balancer subcluster A and load balancer subcluster B may each include 12 load balancers. As shown in Figure 6, upon receiving a service message, the 12 load balancers in load balancer subcluster A can, based on the message distribution rules sent by control device A, determine the compute node and destination cloud service application corresponding to the service message in the service server cluster, add the compute node's IP address and the destination cloud service application's port information to the service message, and send the service message to traffic replication device A. Traffic replication device A can transmit the service message to the destination cloud service application running on service server A based on the compute node's IP address and the destination cloud service application's port information carried in the service message, replicate the received service message to obtain a mirrored service message, determine the compute node's IP address and the destination test application's port information corresponding to the mirrored service message in the test server cluster based on the traffic replication rules sent by control device A, and transmit the mirrored service message to the destination test application running on test server A. When receiving a service message, the 12 load balancers in load balancer subcluster B can determine the compute node and destination cloud service application corresponding to the service message in the service server cluster based on the message distribution rules sent by control device B, add the compute node's IP address and the destination cloud service application's port information to the service message, and send the service message to traffic replication device B. Traffic replication device B can transmit the service message to the destination cloud service application running on business server B based on the compute node's IP address and the destination cloud service application's port information carried in the service message, replicate the received service message to obtain a mirrored service message, determine the compute node's IP address and the destination test application's port information corresponding to the mirrored service message in the test server cluster based on the traffic replication rules sent by control device B, and transmit the mirrored service message to the destination test application running on test server B.
[0104] The embodiments of the present application can reduce the equipment cost of the cloud service system. For example, taking the network card export bandwidth as an example, the network card export bandwidth of a load balancer is 4Gbps. If a traffic mirroring process is deployed on the load balancer, the 4Gbps bandwidth that can be used to transmit the business traffic to be distributed needs to allocate half of the bandwidth to transmit the mirrored business traffic obtained by traffic mirroring, so the bandwidth used to transmit the business traffic to be distributed is only 2Gbps. In order to maintain the original business traffic processing capacity of the cloud service system, the number of load balancers needs to be doubled. Assuming that there are 100 load balancers, if a traffic mirroring process is deployed on the load balancer, 100 more load balancers need to be added. The network card export bandwidth of a traffic replication device is 600Gbps. The traffic is mirrored by the traffic replication device, and one traffic replication node can serve 100 load balancers. The cost of a traffic replication device is much lower than the cost of 100 load balancers. Therefore, the embodiments of the present application can reduce the equipment cost of the cloud service system.
[0105] The cloud service system provided by the embodiments of the present application includes a load balancer cluster and a traffic replication device cluster. Because the performance of the traffic replication device is much higher than that of the load balancer, multiple load balancers in a large load balancer cluster can be connected to a single traffic replication device. The load balancer cluster provides the ability to distribute service traffic and determine the destination application for the service traffic, while the traffic replication device cluster provides traffic mirroring capabilities. The traffic mirror, cloud service application, and load balancer each run on different physical nodes.
[0106] The embodiments of the present application decouple traffic mirroring from the load balancer and cloud service application. Compared to deploying the traffic mirroring process within the load balancer or cloud service application, this can reduce the deployment cost of traffic mirroring and improve the overall performance of the cloud service system. When additional load balancers are needed, it is not necessary to deploy traffic mirroring on the newly added load balancers. Business expansion can be achieved with no or minimal addition of traffic replication nodes, thereby improving the scalability of the cloud service system.
[0107] In the above embodiment, the traffic replication method performed by the traffic replication device, as shown in FIG7 , may include the following steps:
[0108] S701: Receive traffic replication rules configured by a user.
[0109] The traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node.
[0110] S702: Receive a first service message sent by a load balancing node.
[0111] The destination IP address of the first service message is the IP address of the first computing node.
[0112] S703: Send a first service message to the first computing node.
[0113] S704: Generate a second service message according to the first service message and the traffic replication rule.
[0114] The destination IP address of the second service message is the IP address of the second computing node.
[0115] S705: Send a second service message to the second computing node.
[0116] In the embodiment of the present application, traffic replication is achieved by generating a second service message based on the first service message sent by the load balancing node and the traffic replication rule. In a load balancing environment, the traffic replication node provides dedicated computing resources for traffic replication, which can achieve efficient traffic replication.
[0117] In the above embodiment, the traffic replication method performed by the management platform, as shown in FIG8 , may include the following steps:
[0118] S801: Obtain the message distribution rules configured by the user.
[0119] The message distribution rule includes the IP address of the first computing node.
[0120] S802: Send the message distribution rules to the load balancing node.
[0121] The message distribution rule is used to instruct the load balancing node to send the service message to the first computing node. The service message is sent to the first computing node through the traffic replication node.
[0122] S803: Obtain the traffic replication rules configured by the user.
[0123] The traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node.
[0124] S804: Send the traffic replication rule to the traffic replication node.
[0125] The traffic replication rule is used to instruct the traffic replication node to replicate the service message and send it to the second computing node.
[0126] Based on the same inventive concept as the aforementioned method embodiment, the present embodiment also provides a load balancing-based traffic replication device, which can be applied to a traffic replication node in a cloud service system. In some embodiments, as shown in Figure 9, the traffic replication device 900 may include a rule receiving unit 901, a message receiving unit 902, a traffic distribution unit 903, and a traffic mirroring unit 904. The traffic replication device 900 can be used to implement the functions of the aforementioned method embodiment, thereby achieving the beneficial effects of the aforementioned method embodiment.
[0127] Among them, the rule receiving unit 901 can be used to receive the traffic replication rules configured by the user, and the traffic replication rules include the IP address of the first computing node and the IP address of the second computing node. The message receiving unit 902 can be used to load balance the first business message sent by the node, and the destination IP address of the first business message is the IP address of the first computing node. The traffic distribution unit 903 can be used to send the first business message to the first computing node. The traffic mirroring unit 904 can generate a second business message based on the first business message and the traffic replication rules, and send the second business message to the second computing node; the destination IP address of the second business message is the IP address of the second computing node.
[0128] In some embodiments, as shown in Figure 10, the traffic replication device 900 may also include a reply message processing unit 905, which can be used to: if a first reply message for a first business message sent by a first computing node is received, the first reply message is sent to the load balancing node; if a second reply message for a second business message is received from a second computing node, the second reply message is discarded.
[0129] For example, the rule receiving unit 901, the message receiving unit 902, the traffic distribution unit 903, the traffic mirroring unit 904, and the reply message processing unit 905 can be integrated into the traffic replication node 200 shown in FIG1 . The rule receiving unit 901, the message receiving unit 902, the traffic distribution unit 903, the traffic mirroring unit 904, and the reply message processing unit 905 can all be implemented via software or hardware. For example, the implementation of the rule receiving unit 901 will be described below. Similarly, the implementation of the message receiving unit 902, the traffic distribution unit 903, the traffic mirroring unit 904, and the reply message processing unit 905 can refer to the implementation of the rule receiving unit 901.
[0130] As an example of a software functional module, the rule receiving unit 901 may include code running on a computing instance. A computing instance may include at least one of a physical host (node device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the rule receiving unit 901 may include code running on multiple hosts / virtual machines / containers.
[0131] As an example of a hardware functional module, the rule receiving unit 901 can be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0132] The functional modules in the embodiments of the present application may be integrated into a single processor, or each module may exist physically separately, or two or more modules may be integrated into a single module. The integrated modules may be implemented in the form of hardware or software functional modules.
[0133] Based on the same inventive concept as the above-mentioned method embodiment, the present application also provides a load balancing-based traffic replication device, which can be applied to a management platform in a cloud service system. In some embodiments, as shown in Figure 11, the traffic replication device 1100 may include a first sending unit 1101 and a second sending unit 1102.
[0134] Among them, the first sending unit 1101 can be used to obtain the user-configured message distribution rules, which include the IP address of the first computing node; send the message distribution rules to the load balancing node, which instructs the load balancing node to send business messages to the first computing node, wherein the business messages are sent to the first computing node through the traffic replication node. The message receiving unit 902 can be used to obtain the user-configured traffic replication rules, which include the IP address of the first computing node and the IP address of the second computing node; send the traffic replication rules to the traffic replication node, which instructs the traffic replication node to replicate the business messages and send them to the second computing node.
[0135] For example, the first sending unit 1101 and the second sending unit 1102 can be integrated into the management platform 300 shown in Figure 1. Both the first sending unit 1101 and the second sending unit 1102 can be implemented via software or hardware. For example, the implementation of the rule receiving unit will be described below using the first sending unit 1101 as an example. Similarly, the implementation of the first sending unit 1101 and the second sending unit 1102 can refer to the implementation of the first sending unit 1101.
[0136] As an example of a software functional module, the first sending unit 1101 may include code running on a computing instance. A computing instance may include at least one of a physical host (node device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the first sending unit 1101 may include code running on multiple hosts / virtual machines / containers.
[0137] As an example of a hardware functional module, the first sending unit 1101 may be a device implemented by ASIC or PLD, etc. The PLD may be CPLD, FPGA, GAL or any combination thereof.
[0138] The functional modules in the embodiments of the present application may be integrated into a single processor, or each module may exist physically separately, or two or more modules may be integrated into a single module. The integrated modules may be implemented in the form of hardware or software functional modules.
[0139] Based on the same inventive concept as the above-mentioned method embodiment, the embodiment of the present application also provides a traffic replication node, which can be used to implement the functions of the method embodiment shown in Figure 7, thereby achieving the beneficial effects of the above-mentioned method embodiment.
[0140] In some embodiments, the structure of the traffic replication node 200 can be as shown in Figure 12, including a processor 210 and a memory 220 connected to the processor 210. The processor 210 and the memory 220 can be interconnected via a bus, and the processor 210 can serve as the main processor of the traffic replication node 200, that is, the control core of the traffic replication node 200. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The specific connection medium between the above-mentioned processor 210 and the memory 220 is not limited in the embodiments of the present application.
[0141] Memory 220 can be a volatile memory, such as random access memory; the memory can also be a non-volatile memory, such as read-only memory, flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 220 can be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. Memory 220 can be a combination of the above memories. Memory 220 can be used to store software programs and modules.
[0142] The processor 210 may include one or more processors. The processor 210 executes various functional applications and data processing of the traffic replication node 200 by running software programs and modules stored in the memory 220, such as the traffic distribution method provided in the embodiment of the present application.
[0143] In some embodiments, the traffic replication node 200 may further include a communication module, which is connected to the processor 210 and the memory 220 via a bus. The communication module may be used to communicate with the load balancer, the management platform, the service server, and the test server.
[0144] Exemplarily, when the traffic replication node 200 is used to implement the functions of the above-mentioned method embodiment, the processor 210 can be used to receive a user-configured traffic replication rule, wherein the traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node. The traffic replication node can receive a first service message sent by the load balancing node, wherein the destination IP address of the first service message is the IP address of the first computing node. The traffic replication node sends the first service message to the first computing node and generates a second service message based on the first service message and the traffic replication rule. The destination IP address of the second service message is the IP address of the second computing node. The traffic replication node sends the second service message to the second computing node.
[0145] It should be understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on node devices. In other embodiments of this application, node devices may include more or fewer components than shown, or combine or separate certain components, or arrange components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0146] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing a computer program or instruction. The computer program or instruction can constitute a computer program product.
[0147] The present application also provides a computer program product comprising computer-executable instructions. In one embodiment, the computer-executable instructions are used to enable a computer to perform the functions of the traffic replication node in the above method embodiment.
[0148] Computer-executable instructions can be stored in a computer-readable storage medium. Embodiments of the present application also provide a computer-readable storage medium having executable instructions stored therein. In one embodiment, the computer-executable instructions are used to cause a computer to perform the functions of the traffic replication node in the above-described method embodiment.
[0149] The computer-readable storage medium provided in the embodiments of the present application may be a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of computer-readable storage medium known in the art.
[0150] Computer-executable instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a computing device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video disc (DVD); or a semiconductor medium, such as a solid-state drive.
[0151] In the various embodiments of the present application, unless otherwise specified or logically conflicting, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or modules. Methods, systems, products, or devices are not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products, or devices.
[0152] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations thereof may be made without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are intended to be illustrative only of the solutions defined by the appended claims and are to be construed as covering any and all modifications, variations, combinations or equivalents within the scope of the present application.
[0153] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A traffic replication method based on load balancing, It is characterized in that The method is applied to a traffic replication node, the traffic replication node is set in an infrastructure, and the infrastructure is further provided with a first computing node, a second computing node and a load balancing node, and the method includes: Receiving a traffic replication rule configured by a user, the traffic replication rule including an IP address of the first computing node and an IP address of the second computing node; Receive a first service message sent by the load balancing node, where the destination IP address of the first service message is the IP address of the first computing node; Sending the first service message to the first computing node; Generate a second service message according to the first service message and the traffic replication rule, wherein the destination IP address of the second service message is the IP address of the second computing node; Send the second service message to the second computing node.
2. The method according to claim 1, It is characterized in that The traffic replication rule includes a correspondence between an IP address of the first computing node and an IP address of the second computing node; The generating a second service message according to the first service message and the traffic replication rule includes: Copying the first service message to obtain a mirror image message of the first service message; According to the correspondence between the IP address of the first computing node and the IP address of the second computing node, the IP address of the first computing node in the mirror message is modified to the IP address of the second computing node to obtain the second service message.
3. The method according to claim 1 or 2, It is characterized in that The destination port information of the first service message is port information of the first application; and the sending the first service message to the first computing node includes: The first service message is sent to the first application in the first computing node according to the IP address of the first computing node and the port information of the first application.
4. The method according to claim 3, It is characterized in that The traffic replication rule also includes a correspondence between port information of the first application and port information of the second application, where the second application is an application in the second computing node; and sending the second service message to the second computing node includes: Determining, according to the correspondence between the port information of the first application and the port information of the second application, that the destination port information of the second service message is the port information of the second application; The second service message is sent to the second application in the second computing node according to the IP address of the second computing node and the port information of the second application.
5. The method according to any one of claims 1 to 4, It is characterized in that After sending the second service message to the second computing node, the method further includes: If a first reply message for the first service message sent by the first computing node is received, the first reply message is sent to the load balancing node; If a second reply message for the second service message sent by the second computing node is received, the second reply message is discarded.
6. The method according to claim 5, It is characterized in that The method further comprises: When a reply message is received, it is determined, based on the IP address carried in the reply message and the traffic replication rule, that the reply message is the first reply message sent by the first computing node, or that the reply message is the second reply message sent by the second computing node.
7. A traffic replication device based on load balancing, It is characterized in that The device is applied to a traffic replication node, the traffic replication node is set in an infrastructure, the infrastructure is also provided with a first computing node, a second computing node and a load balancing node, and the device includes: A rule receiving unit, configured to receive a traffic replication rule configured by a user, wherein the traffic replication rule includes an IP address of the first computing node and an IP address of the second computing node; A message receiving unit, configured to receive a first service message sent by the load balancing node, wherein the destination IP address of the first service message is the IP address of the first computing node; A traffic distribution unit, configured to send the first service message to the first computing node; A traffic mirroring unit is used to generate a second service message according to the first service message and the traffic replication rule, and send the second service message to the second computing node; the destination IP address of the second service message is the IP address of the second computing node.
8. The device according to claim 7, It is characterized in that The traffic replication rule includes a correspondence between an IP address of a first computing node and an IP address of a second computing node; and the traffic mirroring unit is specifically configured to: Copying the first service message to obtain a mirror image message of the first service message; According to the correspondence between the IP address of the first computing node and the IP address of the second computing node, the IP address of the first computing node in the mirror message is modified to the IP address of the second computing node to obtain the second service message.
9. The device according to claim 7 or 8, It is characterized in that The destination port information of the first service message is the port information of the first application; the traffic distribution unit is specifically used to: The first service message is sent to the first application in the first computing node according to the IP address of the first computing node and the port information of the first application.
10. The device according to claim 9, It is characterized in that The traffic replication rule further includes a correspondence between port information of the first application and port information of the second application, where the second application is an application in the second computing node; and the traffic mirroring unit is specifically configured to: Determining, according to the correspondence between the port information of the first application and the port information of the second application, that the destination port information of the second service message is the port information of the second application; The second service message is sent to the second application in the second computing node according to the IP address of the second computing node and the port information of the second application.
11. The device according to any one of claims 7 to 10, It is characterized in that The device further includes a reply message processing unit, the reply message processing unit being configured to: If a first reply message for the first service message sent by the first computing node is received, the first reply message is sent to the load balancing node; If a second reply message for the second service message sent by the second computing node is received, the second reply message is discarded.
12. The device according to claim 11, It is characterized in that The reply message processing unit is further used for: When a reply message is received, it is determined, based on the IP address carried in the reply message and the traffic replication rule, that the reply message is the first reply message sent by the first computing node, or that the reply message is the second reply message sent by the second computing node.
13. A traffic replication node, It is characterized in that include: A memory and a processor, wherein the memory stores a computer program; and the processor is used to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 6.
14. A cloud service system, It is characterized in that The cloud service system includes a traffic replication node, a first computing node, a second computing node and a load balancing node; The load balancing node is used to receive a message distribution rule configured by a user; the message distribution rule includes an IP address of the first computing node; The traffic replication node is used to receive a traffic replication rule configured by a user, where the traffic replication rule includes an IP address of the first computing node and an IP address of the second computing node; The load balancing node is further used to determine, according to the message distribution rule, that the destination IP address of the first service message is the IP address of the first computing node, and send the first service message to the traffic replication node; The traffic replication node is also used to receive the first business message, send the first business message to the first computing node, generate a second business message according to the first business message and the traffic replication rule, and send the second business message to the second computing node; the destination IP address of the second business message is the IP address of the second computing node.
15. A computer-readable storage medium, It is characterized in that Computer executable instructions are stored, and the computer executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
16. A computer program product, It is characterized in that The method comprises computer executable instructions, wherein the computer executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Traffic mirroring method and device, virtual machine platform and storage medium
CN112235158A
Traffic mirroring request processing method and device and load balancing server
CN112437124A
Message forwarding method and network equipment
CN115695338A
Monitoring network traffic using traffic mirroring
WO2020256997A1
