Traffic replication method and device 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. .
Patent Information
- Application Number
- CN202310952530.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2023-07-31
- Publication Date
- 2024-10-29
AI Technical Summary
Existing traffic mirroring technology is inefficient in a load balancing environment, 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 the load balancing environment, receive the business packets sent by the load balancing node through this node and generate new business packets according to the configured traffic replication rules to achieve traffic replication and avoid replication on the computing node or load balancing node , providing dedicated computing resources for traffic 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 CN118869713A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims the priority of the Chinese patent application filed with the China National Intellectual Property Administration 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 in 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 copy the business traffic of the production environment to the quasi-production environment. Without the end user's awareness, the business traffic of the production environment can be used to verify the pre-release version of the application in the quasi-production environment, discover problems with the pre-release version before the application is released, and solve the problems in advance. Among them, the production environment can be understood as the business server cluster running the cloud service application, and the quasi-production environment can be understood as the test server cluster running the pre-release version of the application.
[0005] The current traffic mirroring technology usually deploys a traffic mirroring process in the node device of the load balancer or the application in the production environment. The traffic mirroring process is responsible for copying and distributing the monitored business traffic to the production-like environment. However, the traffic mirroring process and the load balancer or cloud service application are deployed on the same node device, which not only squeezes the resources of the load balancer or cloud service application, but also has low efficiency in traffic replication. Summary of the invention
[0006] 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.
[0007] 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 a 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. Among them, 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.
[0008] In the embodiment of the present application, a traffic replication node is added to the infrastructure, and 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 rule to achieve traffic replication, without the need to perform traffic replication 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, which can achieve efficient traffic replication.
[0009] In a 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; based on 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 may be modified to the IP address of the second computing node to obtain the second service message.
[0010] 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.
[0011] In a 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 according to the IP address of the first computing node and the port information of the first application.
[0012] 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.
[0013] In a 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, wherein the second application is an application in the second computing node. The traffic replication node may determine, based on 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, and send the second service message 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.
[0014] 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 rule, and then send the second business message to the corresponding application in the second computing node.
[0015] In one possible implementation, after the traffic replication node sends the second business message to the second computing node, if the traffic replication node receives a first reply message for the first business message sent by the first computing node, the first reply message is sent to the load balancing node; if the traffic replication node receives a second reply message for the second business message sent by the second computing node, the second reply message is discarded.
[0016] 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.
[0017] Through the above process, according to the traffic replication rules, the traffic replication node can accurately distinguish the reply message returned by the first computing node and the reply message returned by the second computing node. For the reply message returned by the second computing node, the traffic replication node can discard the reply message, and for the reply message returned by the first computing node, the traffic replication node can send the reply message to the load balancing node to ensure the normal business service communication process.
[0018] 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, and the management platform 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 message distribution rule configured by the user, and the message distribution rule includes the IP address of the first computing node; sends the message distribution rule to the load balancing node, and 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 traffic replication rule configured by the user, and 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, and 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.
[0019] In a third aspect, an embodiment of the present application provides a traffic replication device based on load balancing, the device is applied to a traffic replication node, the traffic replication node is set in an infrastructure, and the infrastructure is also provided with a first computing node, a second computing node and a load balancing node, the device includes:
[0020] 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 a first computing node and an IP address of a second computing node;
[0021] A message receiving unit, configured to receive a first service message sent by a load balancing node, wherein the destination IP address of the first service message is the IP address of the first computing node;
[0022] A traffic distribution unit, configured to send a first service message to a first computing node;
[0023] 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.
[0024] In a 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:
[0025] Copying the first service message to obtain a mirror image message of the first service message;
[0026] 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 a second service message.
[0027] In a possible implementation manner, the destination port information of the first service message is the port information of the first application; and the traffic distribution unit is specifically configured to:
[0028] 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.
[0029] In a 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:
[0030] According to the correspondence between the port information of the first application and the port information of the second application, determining that the destination port information of the second service message is the port information of the second application;
[0031] 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.
[0032] In a possible implementation, the device may further include a reply message processing unit, the reply message processing unit being configured to:
[0033] 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;
[0034] If a second reply message for the second service message sent by the second computing node is received, the second reply message is discarded.
[0035] In a possible implementation, the reply message processing unit is further configured to:
[0036] 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 a first reply message sent by the first computing node, or that the reply message is a second reply message sent by the second computing node.
[0037] 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.
[0038] 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, and 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, according to 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 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.
[0039] 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 aspect or the second aspect above.
[0040] 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 aspect or the second aspect.
[0041] The technical effects that can be achieved in any of the second to seventh aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of the structure of a cloud service system provided in an embodiment of the present application;
[0043] Figure 2 An interactive schematic diagram of a traffic replication method based on load balancing provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of traffic transmission between nodes provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of another cloud service system provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of a rule distribution process provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of a flow distribution and flow replication process provided in an embodiment of the present application;
[0048] Figure 7 A flow chart of a traffic replication method based on load balancing provided in an embodiment of the present application;
[0049] Figure 8 A schematic diagram of another load balancing-based traffic replication device provided in an embodiment of the present application;
[0050] Fig. 9 A schematic diagram of a traffic replication device based on load balancing provided in an embodiment of the present application;
[0051] Fig.10 A schematic diagram of another load balancing-based traffic replication device provided in an embodiment of the present application;
[0052] Fig.11 A schematic diagram of another load balancing-based traffic replication device provided in an embodiment of the present application;
[0053] Fig.12 A schematic diagram of the structure of a traffic replication node provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0055] Before introducing the specific solutions provided by the embodiments of the present application, some 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.
[0056] (1) Production-like environment: The production environment can be understood as a business server cluster running cloud service applications, and 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 last time before they are officially released. The configuration and database 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.
[0057] (2) Open System Interconnection (OSI) model: The OSI model is a standard framework that allows all 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 communications 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 4th 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 7th 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.
[0058] (3) Application load balancer (ALB): is a network component. ALB can be used to distribute and balance received business traffic among 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 ALB belongs to business traffic. ALB can distribute the received business traffic to multiple computing nodes connected to the backend to ensure that each computing node can get a reasonable load and avoid overloading a single computing node.
[0059] In the embodiments of the present application, "multiple" refers to two or more than two. 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 there is no restriction on which ones are included. For example, including at least one of A, B and C, then A, B, C, A and B, A and C, B and C, or A and B and C may be included. "And / or" describes the association relationship of associated objects, indicating that three relationships may 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 previously associated objects are in an "or" relationship.
[0060] Unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned 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 the multiple objects.
[0061] The current traffic mirroring technology usually deploys a traffic mirroring process in the node device of the ALB or production environment application. The traffic mirroring process is responsible for copying and distributing the monitored business traffic to the production-like environment. Since the traffic mirroring process and the ALB or cloud service application are deployed on the same node device, it not only occupies the resources of the ALB or cloud service application, but also has low traffic replication efficiency.
[0062] Based on this, an embodiment of the present application provides a cloud service system, which can be applied to an infrastructure. Exemplarily, the infrastructure can be an infrastructure in an automated testing scenario of an application. Figure 1 The schematic diagram of the structure of a cloud service system is shown as an example. Figure 1 As shown, 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. Among them, 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 carriers of the application. 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 physical servers of entities. The traffic replication node 200 can receive the traffic replication rules configured by the user, and replicate the business message sent by the load balancing node 100 according to the traffic replication rules, send the original business message to the first computing node 400, and send the replicated new business message to the second computing node 500.
[0063] 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.
[0064] Figure 1 In addition to being applied to automated testing scenarios of applications, the cloud service system shown can also be applied to other traffic replication scenarios, which is not limited in the embodiments of the present application.
[0065] In some embodiments, the cloud service system may further include a management platform 300, which is used to manage 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 ALB, and for received service messages, the ALB may determine the destination Internet protocol (IP) address of the service message according to the message distribution rule sent by the management platform 300, which may also be referred to as a load balancing rule, 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 to copy the received business message, and to 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.
[0066] Exemplarily, the load balancing node 100 can be 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 200 can be 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 100 can also be used to determine, according to 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 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.
[0067] 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 in the infrastructure. The management platform 300 may instruct and send instructions to the physical layer of the infrastructure, that is, the hardware devices in the infrastructure.
[0068] 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.
[0069] In the embodiment of the present application, a traffic replication node is added to the cloud service system, and a new service message is generated by the traffic replication node based on the service message sent by the load balancing node and the traffic replication rule to achieve traffic replication, without the need to perform traffic replication on the first computing node or the load balancing node. The traffic replication node provides dedicated computing resources for traffic replication, which can achieve efficient traffic replication.
[0070] When executing the traffic replication method based on load balancing, the interaction process between the load balancing node, the traffic replication node, the first computing node and the second computing node is as follows: Figure 2 and Figure 3 As shown, the following steps may be included:
[0071] 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.
[0072] When a client requests a cloud service system to provide a service, it can send a business message to the cloud service system. The client can be understood as an application installed on the user's terminal device. Business messages belong to business traffic. Exemplarily, business messages can be messages in the hypertext transfer protocol (HTTP) format.
[0073] In some embodiments, a load balancing node in a cloud service system receives a first service message sent by a client, and can determine the destination IP address of the first service message. Exemplarily, the management platform can send a message distribution rule to the load balancing node, and the message distribution rule can include a correspondence between the IP addresses of multiple computing nodes for running cloud service applications and the content of the first designated field of the business message header. The message distribution rule can be in a table form or in other forms. The load balancing node can determine the destination IP address of the first business message based on the correspondence between the content of the first designated field of the business message header and the IP address of each computing node, and the content of the first designated field of the first business message. For example, assuming that the content of the first designated field is "01", it 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; 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. Among them, the first computing node, the third computing node and the fifth computing node are all computing nodes for running 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 adds the IP address of the first computing node to the first business message.
[0074] 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, and the first application, the third application, and the fifth application are all cloud service applications. The message distribution rule may also include the correspondence between the port information of multiple applications and the content of the second designated field of the service message header. The load balancing node may determine the destination port information of the first service message according to the correspondence between the content of the second designated field of the service message header and the port information of each application, and the content of the second designated field of the first service message. For example, assuming that the content of the second designated field is "001", corresponding to the port information of the first application; the content of the second designated field is "002", corresponding to the port information of the third application; the content of the second designated field is "003", corresponding 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 adds the port information of the first application to the first service message.
[0075] Since the standard framework OSI model is used to transmit service traffic between various devices, the OSI model adopts a seven-layer structure, and the first layer is the physical layer. When data is transmitted between various devices, the bit stream of the physical layer is transmitted. When the client sends the first service message to the cloud service system through the user's terminal device, the terminal device will encapsulate the first service message of the 7th layer (application layer) layer by layer, and encapsulate it into a bit stream of the physical layer, that is, 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 of the 7th layer. The load balancing node determines the destination IP address and destination port information of the first service message according to the specified field in the message header of the first service message and the message distribution rule, and adds the destination IP address and destination port information of the first service message to the first service message. Exemplarily, 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 one of eBPF, smartNIC, kernel module, etc.
[0076] S202: The load balancing node sends a first service message to the traffic replication node.
[0077] 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.
[0078] S203: The traffic replication node sends a first service message to the first computing node.
[0079] In some embodiments, the traffic replication node receives the first service message sent by the load balancing node, and can obtain the destination IP address carried in the first service message, and send the first service message to the corresponding computing node according to the destination IP address carried in the first service message. 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.
[0080] In other embodiments, if the first service message carries the destination IP address and the destination port information, the traffic replication node receives the first service message sent by the load balancing node, and can obtain the destination IP address and the destination port information carried in the first service message, and send the first service message to the corresponding application in the corresponding computing node according to the destination IP address and the destination port information. 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 according to the IP address of the first computing node and the port information of the first application.
[0081] S204: The traffic replication node generates a second service message according to the first service message and the traffic replication rule.
[0082] The traffic replication node can receive the traffic replication rules configured by the user. The traffic replication rules can be sent to the traffic replication node by the management platform. The traffic replication rules can be configured by the user. The management platform receives the traffic replication rules configured by the user and sends the traffic replication rules to the traffic replication node. The traffic replication rules can be in a table form or in other forms.
[0083] 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.
[0084] 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. Among them, 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 the 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 according to the correspondence between the IP address of the first computing node and the IP address of the second computing node, it can also modify the port information of the first application in the mirror message to the port information of the second application according to the correspondence between the port information of the cloud service application and the port information of the test application to obtain the second business message.
[0085] 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.
[0086] The traffic replication node replicates the service traffic at Layer 4 without decapsulating the physical layer data of the service traffic layer by layer to Layer 7, which can save the computing resources of the traffic replication node and improve the efficiency of the traffic mirroring process.
[0087] In some embodiments, the traffic replication node 200 may be a programmable network processor device, or a programmable network device based on hardware acceleration. The programmable network processor device may also be referred to as a programmable NP device; the programmable network device may implement the replication of the service traffic to be distributed based on hardware, further improving the efficiency of the traffic mirroring process.
[0088] S205: The traffic replication node sends a second service message to the second computing node.
[0089] In some embodiments, the traffic replication node may send the second service message to the corresponding computing node according to the destination IP address of the second service message. For example, if 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.
[0090] In other embodiments, the traffic replication node may send the second service message to the corresponding application in the corresponding computing node according to the destination IP address and destination port information of the second service message. For example, the destination IP address of the second service message 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 message to the second application running on the second computing node according to the IP address of the second computing node and the port information of the second application.
[0091] In other embodiments, step S203 may be performed after step S204, or after step S205, or simultaneously with step S205.
[0092] In some embodiments, when the cloud service application running on the first computing node receives a service message sent by the traffic replication node, it can send a reply message of the service message to the traffic replication node, and the reply message carries the IP address of the first computing node. When the test application running on the second computing node receives a mirror service message sent by the traffic replication node, it can also send a reply message of the mirror service message to the traffic replication node, and the reply message carries the IP address of the second computing node.
[0093] When the traffic replication node receives the first reply message for the first service message sent by the first computing node, the first reply message can be sent to the load balancing node. When the traffic replication node receives the second reply message for the second service message sent by the second computing node, the second reply message is discarded.
[0094] Exemplarily, when a traffic replication node receives a reply message for a business message, it can determine whether the reply message is sent by a computing node running a cloud service application or a computing node for running a test application based on the IP address and traffic replication rules carried in the reply message. For example, if the reply message carries the IP address of the first computing node, then according to the traffic replication rules, it can be determined that the first computing node is a computing node for running 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 rules, it can be determined that the second computing node is a computing node for running 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.
[0095] In order to solve the problem of low efficiency of traffic replication in a load balancing environment in the related art, the embodiment of the present application adds a traffic replication node in the basic setting, and 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 the traffic replication rules configured by the user, and according to 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.
[0096] In addition, the traffic replication node replicates the received service messages to achieve service traffic mirroring, without the need to deploy the traffic mirroring process in the computing nodes used to run the cloud service application, which can avoid the phenomenon that each computing node of the cloud service application maintains its own traffic mirroring process, affecting the performance of the cloud service application; there is no need to deploy the traffic mirroring process on the load balancing node, which can reduce the operation and maintenance complexity of the load balancing node, which is conducive to maintaining the service stability of the load balancing node itself, and at the same time avoid the traffic mirroring process from crowding out the connection resources, memory resources, network card export bandwidth and other physical resources of the load balancing node, which can improve the performance of the load balancing node. Running the traffic mirroring, cloud service application and load balancing node on different physical nodes respectively realizes the decoupling of traffic mirroring from the load balancing node and cloud service application, which can improve the overall performance of the cloud service system.
[0097] In some embodiments, the load balancing node in the cloud service system may be a load balancer, the traffic replication node may be a traffic replication device, the management platform may be a control device, the computing node for running the cloud service application may be a business server, the computing node for running the test application may be a test server, and the number of load balancers, traffic replication devices, control devices, business servers, and test servers may all be multiple. For example, Figure 4 As shown, 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.
[0098] like Figure 5As shown, the control device in the control device cluster 310 is used to send the message distribution rule to the load balancer in the load balancer cluster 110, and the message distribution rule is used to instruct the load balancer to determine the business server and cloud service application corresponding to the business message. The control device in the control device cluster 310 is also used to send the traffic replication rule to the traffic replication device in the traffic replication device cluster 210, and the traffic replication rule is used to instruct the traffic replication device to determine the test server and test application corresponding to the mirrored business message. Among them, the mirrored business message is obtained by the traffic replication node replicating the received business message.
[0099] In an optional embodiment, the load balancer cluster 110 may include multiple sub-clusters. Figure 4 As shown, the load balancer cluster 110 may include two subclusters, namely, load balancer subcluster A and load balancer subcluster B. Among them, load balancer subcluster A and load balancer subcluster B may be active-active disaster recovery clusters, both of which can provide business traffic proxy and routing services for cloud service applications; it can also be understood that load balancer subcluster A and load balancer subcluster B are two disaster recovery clusters with the same functions, and load balancer subcluster A and load balancer subcluster B can monitor each other's health status and switch functions. When a load balancer subcluster stops working due to an accident, it can be switched to another load balancer subcluster, so that the function of the load balancer cluster can continue to work normally. The business server cluster 410 may also include multiple business servers, such as business server A and business server B. Business server A and business server B are both used to run cloud service applications, and multiple cloud service applications can be run on each business server. The test server cluster 510 may also include multiple test servers, such as test server A and test server B. Both test server A and test server B are used to run test applications, and each test server can run multiple test applications.
[0100] The 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 the load balancer subcluster A. Control device B may send a message distribution rule for service server B to the load balancer in the load balancer subcluster B.
[0101] The 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 may receive service messages sent by the load balancer in the load balancer subcluster A, and traffic replication node B may receive service messages sent by the load balancer in the load balancer subcluster B. Control device A may also send traffic replication rules for test server A to traffic replication device A. Control device B may also send traffic replication rules for test server B to traffic replication device B.
[0102] For example, load balancer sub-cluster A and load balancer sub-cluster B may each include 12 load balancers. Figure 6 As shown, when receiving a service message, the 12 load balancers in the load balancer subcluster A can determine the computing node and the destination cloud service application corresponding to the service message in the service server cluster according to the message distribution rule sent by the control device A, add the IP address of the computing node and the port information of the destination cloud service application to the service message, and send the service message to the traffic replication device A. The traffic replication device A can transmit the service message to the destination cloud service application running in the service server A according to the IP address of the computing node and the port information of the destination cloud service application carried in the service message, and replicate the received service message to obtain a mirror service message, and determine the IP address of the computing node and the port information of the destination test application corresponding to the mirror service message in the test server cluster according to the traffic replication rule sent by the control device A, and transmit the mirror service message to the destination test application running in the test server A. When receiving a service message, the 12 load balancers in the load balancer subcluster B can determine the computing node and the destination cloud service application corresponding to the service message in the service server cluster according to the message distribution rule sent by the control device B, add the IP address of the computing node and the port information of the destination cloud service application to the service message, and send the service message to the traffic replication device B. The traffic replication device B can transmit the service message to the destination cloud service application running in the service server B according to the IP address of the computing node and the port information of the destination cloud service application carried in the service message, and replicate the received service message to obtain a mirrored service message, and determine the IP address of the computing node and the port information of the destination test application corresponding to the mirrored service message in the test server cluster according to the traffic replication rule sent by the control device B, and transmit the mirrored service message to the destination test application running in the test server B.
[0103] 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 the 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 be divided into half of the bandwidth for transmitting the mirrored business traffic obtained by the traffic mirroring, and 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 the 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 mirroring is performed 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.
[0104] The cloud service system provided by the embodiment of the present application includes a load balancer cluster and a traffic replication device cluster. Since 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 one traffic replication device. The load balancer cluster provides the ability to distribute business traffic and determine the destination application corresponding to the business traffic. The traffic replication device cluster provides traffic mirroring capabilities. Traffic mirroring, cloud service applications and load balancers run on different physical nodes respectively.
[0105] The embodiment of the present application realizes the decoupling of traffic mirroring from the load balancer and the cloud service application. Compared with deploying the traffic mirroring process in the load balancer or the cloud service application, it can reduce the deployment cost of traffic mirroring and improve the overall performance of the cloud service system. When a load balancer needs to be added, it is not necessary to deploy traffic mirroring on the newly added load balancer. Business expansion can be achieved without adding or with a small amount of traffic replication nodes, thereby improving the scalability of the cloud service system.
[0106] In the above embodiment, the traffic replication method performed by the traffic replication device is as follows: Figure 7 As shown, the following steps may be included:
[0107] S701, receiving a traffic replication rule configured by a user.
[0108] The traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node.
[0109] S702: Receive a first service message sent by a load balancing node.
[0110] The destination IP address of the first service message is the IP address of the first computing node.
[0111] S703: Send a first service message to the first computing node.
[0112] S704: Generate a second service message according to the first service message and the traffic replication rule.
[0113] The destination IP address of the second service message is the IP address of the second computing node.
[0114] S705: Send a second service message to the second computing node.
[0115] 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.
[0116] In the above embodiment, the traffic replication method executed by the management platform is as follows: Figure 8 As shown, the following steps may be included:
[0117] S801, obtaining a message distribution rule configured by a user.
[0118] The message distribution rule includes the IP address of the first computing node.
[0119] S802: Send message distribution rules to the load balancing node.
[0120] 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.
[0121] S803, obtaining the traffic replication rule configured by the user.
[0122] The traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node.
[0123] S804, sending the traffic replication rule to the traffic replication node.
[0124] 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.
[0125] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a traffic replication device based on load balancing, which can be applied to a traffic replication node in a cloud service system. Fig. 9As shown, 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 distribution device 900 may be used to implement the functions of the above method embodiment, and thus may achieve the beneficial effects of the above method embodiment.
[0126] Among them, the rule receiving unit 901 can be used to receive the traffic replication rule configured by the user, and the traffic replication rule includes 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 for the first business message sent by the load balancing 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 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.
[0127] In some embodiments, Fig.10 As shown, the traffic replication device 900 may also include a reply message processing unit 905, which may 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 sent by a second computing node is received, the second reply message is discarded.
[0128] 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 in the following manner: Figure 1 In the traffic replication node 200 shown. 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 by software, or can be implemented by hardware. Exemplarily, the implementation of the rule receiving unit 901 is introduced 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.
[0129] As an example of a software function module, the rule receiving unit 901 may include code running on a computing instance. The computing instance may include at least one of a physical host (node device), a virtual machine, and a container. Further, 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.
[0130] As an example of a hardware functional module, the rule receiving unit 901 can be a device implemented by 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.
[0131] Each functional module in the embodiment of the present application can be integrated into one processor, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0132] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a traffic replication device based on load balancing, which can be applied to a management platform in a cloud service system. Fig.11 As shown, the traffic replication device 1100 may include a first sending unit 1101 and a second sending unit 1102 .
[0133] Among them, the first sending unit 1101 can be used to obtain the message distribution rule configured by the user, the message distribution rule includes the IP address of the first computing node; send the message distribution rule to the load balancing node, 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 message receiving unit 902 can be used to obtain the traffic replication rule configured by the user, the traffic replication rule includes the IP address of the first computing node and the IP address of the second computing node; send the traffic replication rule to the traffic replication node, 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.
[0134] For example, the first sending unit 1101 and the second sending unit 1102 may be integrated in Figure 1In the management platform 300 shown in FIG. 1 , the first sending unit 1101 and the second sending unit 1102 can be implemented by software or by hardware. By way of example, the implementation of the rule receiving unit is described below by taking 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.
[0135] As an example of a software function module, the first sending unit 1101 may include code running on a computing instance. The computing instance may include at least one of a physical host (node device), a virtual machine, and a container. Further, 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.
[0136] 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.
[0137] Each functional module in the embodiment of the present application can be integrated into one processor, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0138] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a traffic replication node, which can be used to implement Figure 7 The functions of the method embodiment shown can therefore achieve the beneficial effects of the above method embodiment.
[0139] In some embodiments, the structure of the traffic replication node 200 can be as follows: Fig.12 As shown, it includes 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.
[0140] The memory 220 may be a volatile memory, such as a random access memory; the memory may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 220 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 220 may be a combination of the above memories. The memory 220 may be used to store software programs and modules.
[0141] 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.
[0142] 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 a load balancer, a management platform, a business server, and a test server.
[0143] Exemplarily, when the traffic replication node 200 is used to implement the functions of the above method embodiment, the processor 210 can be used to receive the traffic replication rules configured by the user, wherein the traffic replication rules include the IP address of the first computing node and the IP address of the second computing node. The traffic replication node can receive the 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 rules. The destination IP address of the second business message is the IP address of the second computing node. The traffic replication node sends the second business message to the second computing node.
[0144] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the node device. In other embodiments of the present application, the node device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0145] The method steps in the embodiments of the present application may be implemented by hardware, or by a processor executing a computer program or instruction. The computer program or instruction may constitute a computer program product.
[0146] The present application also provides a computer program product, which includes computer executable instructions. In one embodiment, the computer executable instructions are used to enable a computer to execute the function of the traffic replication node in the above method embodiment.
[0147] The computer executable instructions may be stored in a computer readable storage medium. The present application also provides a computer readable storage medium, wherein the computer readable storage medium stores executable instructions. In one embodiment, the computer executable instructions are used to enable a computer to execute the function of the traffic replication node in the above method embodiment.
[0148] 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.
[0149] Computer executable instructions may be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer program or instructions may be transferred from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer readable storage medium may 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 may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disc (DVD); it may also be a semiconductor medium, such as a solid state drive.
[0150] In each embodiment of the present application, if there is no special explanation and logical conflict, 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 of their variations 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.
[0151] Although the present application has been described in conjunction with specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, the present specification and the accompanying drawings are merely exemplary illustrations of the schemes defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application.
[0152] Obviously, those skilled in the art can 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 also intended to include these modifications and variations.
Claims
1. A traffic replication method based on load balancing, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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
Cited By
Traffic replication method and apparatus based on load balancing, and traffic replication node
EP4694086A1
