Message queue management method based on message middleware node and message middleware node
By introducing multiple sites into the cloud service system and performing load analysis, the MQ node with the smallest load is determined as the deployment node for the primary message queue and the standby message queue, the business interruption problem caused by MQ node failure is solved, and fast response and high service quality are achieved.
Patent Information
- Application Number
- CN202410114581.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-27
- Filing Date
- 2024-01-26
- Publication Date
- 2025-04-29
AI Technical Summary
In the cloud service system, when the MQ node fails, multiple standby MQ nodes need to negotiate to determine the primary message queue migration target, resulting in too long service interruption.
By introducing multiple sites in the cloud service system and deploying multiple MQ nodes in each site, using load analysis to determine the MQ node with the lowest load as the deployment node for the primary message queue and the standby message queue, physical anti-affinity is achieved, so as to respond quickly when the primary message queue is migrated.
It reduces the duration of business interruption of computing nodes, improves the service quality of cloud service systems, and ensures the performance and availability of MQ nodes.
Smart Images

Figure CN119906683A_ABST
Abstract
Description
[0001] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office on October 27, 2023, with application number 202311412582.X and invention name “A node scheduling method and cloud management platform based on cloud management platform”, the entire contents of which are incorporated by reference in this application. Technical Field
[0002] The embodiments of the present application relate to the field of cloud technology, and in particular to a message queue management method based on a message middleware (rabbit message queue, MQ) node and an MQ node. Background Art
[0003] With the rapid development of cloud technology, cloud vendors can use MQ nodes as the message transmission medium between computing nodes. The computing nodes that provide messages and the computing nodes that consume messages cannot perceive each other. Both face the MQ nodes, which can ensure the information security between computing nodes.
[0004] In the cloud service system of the related technology, for a certain MQ node, it is usually necessary to set up multiple MQ nodes associated with the MQ node, so that the MQ node can deploy the main message queue of the computing node, and the multiple MQ nodes associated with the MQ node all have backup message queues for deploying the main message queue. In this way, when the MQ node fails, it is necessary to negotiate with the multiple MQ nodes associated with the MQ node to determine whether to migrate the main message queue on the MQ node to one of the multiple MQ nodes, while the remaining MQ nodes still retain the backup message queue.
[0005] In the above process, since there are multiple MQ nodes for deploying the backup message queue, when the MQ node for deploying the main message queue fails, these multiple MQ nodes need to spend a certain amount of time to determine which MQ node will carry the main message queue, resulting in a long service interruption time. Summary of the invention
[0006] The embodiment of the present application provides a message queue management method based on MQ nodes and an MQ node, which can reduce the duration of computing node business interruption to a certain extent, thereby ensuring the service quality provided by the cloud service system.
[0007] A first aspect of an embodiment of the present application provides a message queue management method based on a message middleware MQ node, the method being applied to a cloud service system, the cloud service system comprising a first site and a second site located in different geographical locations, the first site comprising a plurality of MQ nodes, the second site comprising a plurality of MQ nodes, the method comprising:
[0008] When a computing node needs to create a message queue, the computing node can access any MQ node in the first site, that is, the first MQ node. Then, the computing node can send a queue creation request to the first MQ node to request the first MQ node to create a main message queue and a backup message queue for the computing node.
[0009] After receiving the queue creation request from the computing node, the first MQ node may select an MQ node with the smallest load value from the multiple MQ nodes of the first site and the multiple MQ nodes of the second site, that is, the second MQ node. Then, the first MQ node may create the main message queue of the computing node in the second MQ node.
[0010] After determining the second MQ node, the first MQ node can detect whether the second MQ node is located in the first site or in the second site. If the multiple MQ nodes of the first site include the second MQ node, that is, the second MQ node is located in the first site, the first MQ node can determine the MQ node with the smallest load value among the multiple nodes of the second site as the third MQ node for deploying the standby message queue of the computing node, and create a standby message queue for the computing node in the third MQ node. If the multiple MQ nodes of the second site include the second MQ node, that is, the second MQ node is located in the second site, the first MQ node can determine the MQ node with the smallest load value among the multiple nodes of the first site as the third MQ node for deploying the standby message queue of the computing node, and create a standby message queue for the computing node in the third MQ node.
[0011] It can be seen from the above method that the first MQ node can deploy the main message queue of the computing node and the backup message queue of the computing node in the second MQ node and the third MQ node respectively. Since the second MQ node and the third MQ node are located in the first site and the second site respectively, it is equivalent to deploying the main message queue and the backup message queue of the computing node in the first site and the second site respectively, realizing physical anti-affinity. Then, if the second MQ node is unavailable, that is, the main message queue of the computing node deployed on the second MQ node needs to be migrated, the backup message queues corresponding to these main message queues are only deployed on the third MQ node (that is, only one backup or one mirror is required), and the third MQ node does not need to perform any negotiation operations, and can directly respond and upgrade the backup message queue of the computing node to the main message queue of the computing node, thereby quickly completing the migration of the main message queue of the computing node. In this way, the duration of the computing node service interruption can be reduced to a certain extent, thereby ensuring the service quality provided by the cloud service system.
[0012] In a possible implementation, the first MQ node determines the second MQ node with the smallest load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site based on the queue creation request, including: the first MQ node processes the load information of the multiple MQ nodes of the first site and the load information of the multiple MQ nodes of the second site based on the queue creation request to obtain the load values of the multiple MQ nodes of the first site and the load values of the multiple MQ nodes of the second site; the first MQ node determines the second MQ node with the smallest load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site. In the aforementioned implementation, after receiving the queue creation request of the computing node, the first MQ node can determine that a main message queue and a backup message queue need to be created for the computing node based on the queue creation request. Then, the first MQ node can first obtain the load information of the multiple MQ nodes of the first site and the load information of the multiple MQ nodes of the second site, and perform a series of processing on the load information of the multiple MQ nodes of the first site and the load information of the multiple MQ nodes of the second site, so as to obtain the load values of the multiple MQ nodes of the first site and the load values of the multiple MQ nodes of the second site. Subsequently, the first MQ node may determine the MQ node with the smallest load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site as the second MQ node for deploying the main message queue of the computing node. It can be seen that by analyzing and selecting the load of each MQ node in the two sites, a main MQ node (i.e., the second MQ node) with a lighter load can be allocated to the computing node, which is conducive to ensuring the performance and availability of the main MQ node, thereby maintaining the service quality of the entire cloud service system.
[0013] In a possible implementation, the load information of the multiple MQ nodes of the first site includes at least one of the following: the number of TCPs of the multiple MQ nodes of the first site, the number of main message queues of the multiple MQ nodes of the first site, the number of standby message queues of the multiple MQ nodes of the first site, the number of queue producers connected to the multiple MQ nodes of the first site, and the number of queue consumers connected to the multiple MQ nodes of the first site. In the aforementioned implementation, among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site, for any MQ node, the load information of the MQ node may include one or more of the load indicators such as the number of TCPs of the MQ node, the number of main message queues of the MQ node, the number of standby message queues of the MQ node, the number of queue producers connected to the MQ node, and the number of queue consumers connected to the MQ node, so the first MQ node can calculate these load indicators of the MQ node and the corresponding weights, thereby obtaining the load value of the MQ node. It can be seen from this that by repeatedly executing the aforementioned calculation process, the load values of all MQ nodes in the two sites can be finally obtained, which is conducive to selecting the main MQ node and the standby MQ node (i.e., the third MQ node) for the calculation node.
[0014] In a possible implementation, the method further includes: if the first MQ node is unavailable, the first MQ node migrates multiple main message queues of the first MQ node to the fourth MQ node of the first site and the multiple MQ nodes of the second site, so that the number of main message queues of the fourth MQ node and the number of main message queues of the multiple MQ nodes of the second site are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site; the first MQ node migrates multiple standby message queues of the first MQ node to the fourth MQ node. In the aforementioned implementation, when it is determined that the first MQ node is unavailable, in the fourth MQ node of the first site (the remaining MQ nodes in the first site except the first MQ node) and the multiple MQ nodes of the second site, the first MQ node can refer to the load value of each MQ node to determine the number of main message queues to be allocated to each MQ node, so after the first MQ node migrates the multiple main message queues of the first MQ node to the fourth MQ node of the first site and the multiple MQ nodes of the second site, the number of main message queues of the fourth MQ node of the first site and the number of main message queues of the multiple MQ nodes of the second site can be kept the same or similar. In this way, the fourth MQ node of the first site and the multiple MQ nodes of the second site can achieve load balancing. It can be seen that by completing the migration of the main message queue of a certain MQ node for the purpose of load balancing, the load of these MQ nodes used to receive these main message queues can still be within a reasonable range, so as to maintain the performance and availability of these MQ nodes, thereby ensuring the service quality provided by the cloud service system.
[0015] In a possible implementation, the method further includes: if the first site is unavailable, the first MQ node migrates multiple main message queues of the first MQ node to multiple MQ nodes of the second site, so that the number of main message queues of the multiple MQ nodes of the second site is the same or similar. In the aforementioned implementation, when it is determined that multiple MQ nodes in the first site are all unavailable, among the multiple MQ nodes of the second site, the first MQ node can refer to the load value of each MQ node to determine the number of main message queues to be allocated to each MQ node, so after the first MQ node migrates multiple main message queues of the first MQ node to multiple MQ nodes of the second site, the number of main message queues of the multiple MQ nodes of the second site can be kept the same or similar. In this way, the multiple MQ nodes of the second site can achieve load balancing. Similarly, the remaining sites in the first site can also perform operations like those performed by the first MQ node, so all main message queues in the entire first site can be migrated to multiple MQ nodes of the second site, and multiple MQ nodes of the second site can achieve load balancing. It can be seen that by completing the migration of the main message queue of a certain site for the purpose of load balancing, the load of multiple MQ nodes in another site used to receive these main message queues can remain within a reasonable range, so as to maintain the performance and availability of these MQ nodes, thereby ensuring the service quality provided by the cloud service system.
[0016] In a possible implementation, the method further includes: if the first site adds a fifth MQ node, the first MQ node migrates several standby message queues of the first MQ node to the fifth MQ node, so that the number of standby message queues of the first MQ node, the number of standby message queues of the fourth node of the first site, and the number of standby message queues of the fifth MQ node are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site. In the aforementioned implementation, if the first site adds a fifth MQ node (new MQ node), the first MQ node can select several standby message queues based on its own load value and migrate these standby message queues to the fifth MQ node. Similarly, the fourth MQ node in the first site, except for the first MQ node and the fifth MQ node, can also perform the same operation as the first MQ node, so after the first MQ node and the fourth MQ node migrate their respective standby message queues to the fifth MQ node, the number of standby message queues of the first MQ node, the number of standby message queues of the fourth MQ node, and the number of standby message queues of the fifth MQ node can be kept the same or similar. In this way, each MQ node in the first site can achieve load balancing. It can be seen that, based on the addition of a new MQ node to a site, the migration of the standby message queue can be completed within the site for the purpose of load balancing, so that the load of all MQ nodes in the site is still within a reasonable range, so as to maintain the performance and availability of all MQ nodes in the site, thereby ensuring the service quality provided by the cloud service system.
[0017] In one possible implementation, the first site is any one of the following: a region, an availability zone, a data center, and a computer room.
[0018] In one possible implementation, the first MQ node is any one of the following: a physical server, a virtual machine, a micro virtual machine, a container, and a bare metal server.
[0019] A second aspect of an embodiment of the present application provides an MQ node, wherein the MQ node serves as a first MQ node, and the first MQ node is arranged in a cloud service system. The cloud service system further includes a first site and a second site located in different geographical locations, and the multiple MQ nodes of the first site include the first MQ node. The first MQ node includes: a receiving module, which is used to receive a queue creation request from a computing node, and the multiple MQ nodes of the first site include the first MQ node; a first creation module, which is used to determine, based on the queue creation request, a second MQ node with the smallest load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site, and create a main message queue of the computing node in the second MQ node; a second creation module, which is used to determine, if the multiple MQ nodes of the first site include the second MQ node, a third MQ node with the smallest load value among the multiple MQ nodes of the second site, and create a backup message queue of the computing node in the third MQ node; a third creation module, which is used to determine, if the multiple MQ nodes of the second site include the second MQ node, a third MQ node with the smallest load value among the multiple MQ nodes of the first site, and create a backup message queue of the computing node in the third MQ node.
[0020] In one possible implementation, the first creation module is used to: based on a queue creation request, process the load information of multiple MQ nodes at the first site and the load information of multiple MQ nodes at the second site to obtain the load values of the multiple MQ nodes at the first site and the load values of the multiple MQ nodes at the second site; and determine the second MQ node with the smallest load value among the multiple MQ nodes at the first site and the multiple MQ nodes at the second site.
[0021] In one possible implementation, the load information of the multiple MQ nodes of the first site includes at least one of the following: the number of TCPs of the multiple MQ nodes of the first site, the number of main message queues of the multiple MQ nodes of the first site, the number of backup message queues of the multiple MQ nodes of the first site, the number of queue producers connected to the multiple MQ nodes of the first site, and the number of queue consumers connected to the multiple MQ nodes of the first site.
[0022] In one possible implementation, the first MQ node also includes: a first migration module, which is used to migrate multiple main message queues of the first MQ node to the fourth MQ node of the first site and the multiple MQ nodes of the second site if the first MQ node is unavailable, so that the number of main message queues of the fourth MQ node and the number of main message queues of the multiple MQ nodes of the second site are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site; the first MQ node migrates multiple backup message queues of the first MQ node to the fourth MQ node.
[0023] In one possible implementation, the first MQ node also includes: a second migration module, which is used to migrate multiple main message queues of the first MQ node to multiple MQ nodes of the second site if the first site is unavailable, so that the number of main message queues of the multiple MQ nodes of the second site is the same or similar.
[0024] In one possible implementation, the first MQ node also includes: a third migration module, which is used to migrate several backup message queues of the first MQ node to the fifth MQ node if a fifth MQ node is added to the first site, so that the number of backup message queues of the first MQ node, the number of backup message queues of the fourth node of the first site, and the number of backup message queues of the fifth MQ node are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site.
[0025] In one possible implementation, the first site is any one of the following: a region, an availability zone, a data center, and a computer room.
[0026] In one possible implementation, the first MQ node is any one of the following: a physical server, a virtual machine, a micro virtual machine, a container, and a bare metal server.
[0027] A third aspect of an embodiment of the present application provides a computing device cluster, the computing device cluster includes at least one computing device, each computing device includes a processor and a memory: the memory is used to store instructions; the processor is used to enable the computing device cluster to execute the method described in the first aspect or any possible implementation method of the first aspect according to the instructions.
[0028] A fourth aspect of an embodiment of the present application provides a computer storage medium, which stores one or more instructions. When the instructions are executed by one or more computers, the one or more computers implement the method described in the first aspect or any possible implementation method of the first aspect.
[0029] A fifth aspect of the embodiments of the present application provides a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the method provided in the fourth aspect of the embodiments of the present application.
[0030] The cloud service system used in the embodiment of the present application includes a first site and a second site, the first site includes multiple MQ nodes, and the second site includes multiple MQ nodes. In the cloud service system, when a computing node needs to create a queue, the computing node can send a queue creation request to the first MQ node located in the first site. Then, the first MQ node can determine the second MQ node with the smallest load value from the multiple MQ nodes of the first site and the multiple MQ nodes of the second site based on the queue creation request, and create the main message queue of the computing node in the second MQ node. Then, the first MQ node can detect whether the second MQ node is located in the first site or the second site. If the second MQ node is located in the first site, the first MQ node can determine the third MQ node with the smallest load value from the multiple MQ nodes of the second site, and create a backup message queue of the computing node in the third MQ node. If the second MQ node is located in the second site, the first MQ node can determine the third MQ node with the smallest load value from the multiple MQ nodes of the first site, and create a backup message queue of the main message queue in the third MQ node. In the above process, the first MQ node can deploy the main message queue of the computing node and the backup message queue of the computing node in the second MQ node and the third MQ node respectively. Since the second MQ node and the third MQ node are located in the first site and the second site respectively, it is equivalent to deploying the main message queue and the backup message queue of the computing node in the first site and the second site respectively, realizing physical anti-affinity. Then, if the second MQ node is unavailable, that is, the main message queue of the computing node deployed on the second MQ node needs to be migrated, the backup message queues corresponding to these main message queues are only deployed on the third MQ node (that is, only one backup or one mirror is required), and the third MQ node does not need to perform any negotiation operations, and can directly respond and upgrade the backup message queue of the computing node to the main message queue of the computing node, thereby quickly completing the migration of the main message queue of the computing node. In this way, the duration of the computing node service interruption can be reduced to a certain extent, thereby ensuring the service quality provided by the cloud service system. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the structure of a cloud service system provided in an embodiment of the present application;
[0032] Figure 2 A schematic diagram of the structure of an MQ node provided in an embodiment of the present application;
[0033] Figure 3 A flow chart of a message queue management method based on MQ nodes provided in an embodiment of the present application;
[0034] Figure 4 Another structural diagram of the cloud service system provided in the embodiment of the present application;
[0035] Figure 5 Another structural diagram of the cloud service system provided in the embodiment of the present application;
[0036] Figure 6a Another structural diagram of the cloud service system provided in the embodiment of the present application;
[0037] Figure 6b Another structural diagram of the cloud service system provided in the embodiment of the present application;
[0038] Figure 7 Another structural diagram of the cloud service system provided in the embodiment of the present application;
[0039] Figure 8 A schematic diagram of the structure of an MQ node provided in an embodiment of the present application;
[0040] Fig. 9 A schematic diagram of a structure of a computing device provided in an embodiment of the present application;
[0041] Fig.10 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0042] Fig.11 A schematic diagram of computer devices in a computer cluster provided in an embodiment of the present application being connected via a network. DETAILED DESCRIPTION
[0043] The embodiment of the present application provides a message queue management method based on MQ nodes and an MQ node, which can reduce the duration of computing node business interruption to a certain extent, thereby ensuring the service quality provided by the cloud service system.
[0044] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0045] With the rapid development of cloud technology, cloud vendors can use MQ nodes as the message transmission medium between computing nodes. The computing nodes that provide messages and the computing nodes that consume messages cannot perceive each other. Both face the MQ nodes, which can ensure the information security between computing nodes.
[0046] In the cloud service system of the related technology, for a certain MQ node, it is usually necessary to set up multiple MQ nodes associated with the MQ node, so that the MQ node can deploy the main message queue of the computing node, and the multiple MQ nodes associated with the MQ node all have backup message queues for deploying the main message queue. In this way, when the MQ node fails, it is necessary to negotiate with the multiple MQ nodes associated with the MQ node to determine whether to migrate the main message queue on the MQ node to one of the multiple MQ nodes (that is, the multiple MQ nodes select one MQ node and let the MQ node upgrade its backup message queue to the main message queue), while the remaining MQ nodes still retain the backup message queue.
[0047] In the above process, since there are multiple MQ nodes for deploying the backup message queue, when the MQ node for deploying the main message queue fails, these multiple MQ nodes need to spend a certain amount of time to determine which MQ node will carry the main message queue, resulting in a long service interruption time.
[0048] Furthermore, when multiple MQ nodes determine a certain MQ node to carry the main message queue, the MQ node may be overloaded, reducing the performance and availability of the MQ node and affecting the service quality of the entire cloud service system.
[0049] Furthermore, in some scenarios, the MQ node cluster often needs to add new MQ nodes. In this case, it is also necessary to create a backup message queue in the new MQ node, which will make the load of the new MQ node cluster too high, thereby reducing the performance and availability of the new MQ node and affecting the service quality of the entire cloud service system.
[0050] In order to solve the above problems, the embodiment of the present application provides a message queue management method based on MQ node, which can be implemented through a cloud service system. Figure 1 A schematic diagram of the structure of the cloud service system provided in the embodiment of the present application is as follows: Figure 1 As shown, the cloud service system includes infrastructure for providing cloud services to tenants. These infrastructures may include multiple sites located in different geographical locations. For any one of the multiple sites, the site may include multiple MQ nodes and multiple computing nodes, and any computing node in the site may be connected to any MQ node in the site. The following introduces MQ nodes and computing nodes respectively:
[0051] MQ nodes can also be called rabbitMQ nodes. For ease of introduction, the following uses two sites in the cloud service system as an example. For any MQ node in one of the two sites, the MQ node can be accessed by the computing nodes of the site. Of course, the MQ node can also be accessed by the computing nodes of the other site to provide message proxy services for the computing nodes of the two sites. Figure 2 As shown ( Figure 2A structural diagram of an MQ node provided in an embodiment of the present application) is shown, the MQ node has a mirror migration module, a mirror algorithm module, a resource monitoring module and an interface module. The following introduces these four modules respectively: (1) The interface module of the MQ node can be exposed to the outside so that the computing nodes of the two sites, the remaining MQ nodes of the site and all the MQ nodes of the other site can access the MQ node, and receive their requests to process these requests in conjunction with other modules, and return corresponding responses. For example, the interface module of the MQ node can receive a queue creation request from the computing node, and send the queue creation request to the mirror algorithm module of the MQ node, so that the mirror algorithm module selects two MQ nodes for the computing node, that is, the main MQ node and the backup MQ node, to create the main message queue and the backup message queue (also called the mirror message queue) of the computing node on these two MQ nodes. For another example, the interface module of the MQ node can also receive load query requests from the remaining MQ nodes of the site and all the MQ nodes of the other site, and return the load information of the MQ node to these MQ nodes, etc. (2) The resource monitoring module of the MQ node can periodically send load query requests to the remaining MQ nodes of the site and all MQ nodes of another site to periodically obtain the load information of these MQ nodes and provide it to the resource algorithm module of the MQ node for use. In addition, the resource monitoring module of the MQ node can also periodically monitor its own load information and provide it to the resource algorithm module and interface module of the MQ node for use. (3) The mirror algorithm module of the MQ node can calculate the load values of these MQ nodes based on the load information of all MQ nodes in the two sites (generally, the MQ node is located in one of the two sites) under the queue creation request of the computing node, so as to determine the MQ node with the lowest load value as the main MQ node. The main MQ node is usually located in a certain site. The mirror algorithm module of the MQ node can also determine the MQ node with the lowest load value in the MQ nodes of another site as the backup MQ node, so as to create the main message queue and backup message queue of the computing node on these two MQ nodes respectively. (4) After the MQ node fails, the mirror migration module of the MQ node can migrate all the main message queues on the MQ node to the remaining MQ nodes of the site and all the MQ nodes of another site, and migrate all the backup message queues on the MQ node to the remaining MQ nodes of the site to maintain the availability and reliability of the business.
[0052] Computing nodes usually run user applications or microservices and perform corresponding tasks to meet user business needs. For any computing node in one of the two sites, the computing node can communicate with another computing node in the site or a computing node in another site through the MQ node in the site. Generally, the message sent by the computing node is usually cached in the MQ node in the form of a message queue and consumed by another computing node connected to the MQ node. Therefore, it can be regarded that the computing node has completed the communication with the other computing node. It can be seen that the computing node can be understood as the producer of the message queue, and the other computing node can be understood as the consumer of the message queue.
[0053] Furthermore, for any computing node, the computing node can generate at least one main message queue. The MQ node to which the computing node is connected will usually allocate a main MQ node and a backup MQ node to the computing node at the request of the computing node. The main MQ node allocated to the computing node is used to deploy at least one main message queue of the computing node, and the backup MQ node allocated to the computing node can be used to deploy at least one backup message queue corresponding to at least one main message queue of the computing node. It is worth noting that since the main MQ node and the backup MQ node allocated to the computing node are respectively located in two sites at different physical locations, that is, the main message queue and the backup message queue of the computing node are also respectively deployed in two sites at different physical locations, there is physical anti-affinity. In addition, no matter whether the main message queue of the computing node is migrated, its main message queue and its backup message queue still strictly maintain physical anti-affinity after migration.
[0054] Furthermore, for any MQ node, the computing node can be deployed with multiple main message queues and multiple backup message queues at the same time. These multiple main message queues usually belong to a certain part of the computing nodes, and these multiple backup message queues usually belong to another part of the computing nodes. It can be seen that the MQ node can be used as the main MQ node of one part of the computing nodes, and can also be used as a backup MQ node for another part of the MQ nodes.
[0055] Furthermore, whether it is an MQ node or a computing node, both are essentially cloud instances created by the cloud management platform in the cloud service system. The cloud instance can be presented in a variety of ways. For example, the cloud instance can be a physical server designated by the cloud management platform. In another example, the cloud instance can also be a virtual machine (VM) created by the cloud management platform on the physical server through virtualization technology. In another example, the cloud instance can also be a container (docker) created by the cloud management platform on the physical server through virtualization technology. In another example, the cloud instance can also be a micro virtual machine (microVM) created by the cloud management platform on the physical server through virtualization technology. In another example, the cloud instance can also be a container (docker) created by the cloud management platform on the physical server through virtualization technology. In another example, the cloud instance can also be a bare metal server designated by the cloud management platform, and so on.
[0056] Furthermore, the multiple sites in the cloud service system can be presented in various forms. For example, the multiple sites can be multiple regions in the infrastructure. In another example, the multiple sites can be multiple availability zones in the infrastructure. In another example, the multiple sites can be multiple data centers (DC) in the infrastructure. In another example, the multiple sites can be multiple computer rooms (rooms) in the infrastructure. In another example, the multiple sites can be at least one edge site and at least one central cloud site in the infrastructure, and so on.
[0057] It can be seen that the MQ node can deploy the main message queue and the backup message queue of the computing node in two sites located in different geographical locations, that is, the main message queue of the computing node is deployed in the main MQ node of one of the sites, and the backup message queue of the computing node is deployed in the backup MQ node of the other site. The physical anti-affinity between the main message queue and the backup message queue is achieved through the existence of two physically isolated MQ nodes. In this case, even if the main MQ node is unavailable, the backup MQ node can respond quickly and be upgraded to a new main MQ node, so that the service interruption duration can be controlled within a shorter range to improve the service quality of the cloud service system. In order to further understand the above process, the following is combined with Figure 3 To further describe this process, Figure 3 A flow chart of a message queue management method based on MQ nodes provided in an embodiment of the present application is as follows: Figure 3 As shown, this method is applied to Figure 1 In the cloud service system shown in FIG. 1 , it is assumed that the cloud service system includes two sites located in different geographical locations, which are referred to as the first site and the second site, respectively, hereinafter. The first site includes multiple MQ nodes, and the second site also includes multiple MQ nodes. The method includes:
[0058] 301. A first MQ node receives a queue creation request from a computing node, wherein multiple MQ nodes of a first site include the first MQ node.
[0059] In this embodiment, when a computing node in the first site needs to create a message queue, the computing node can access the first MQ node in the first site and send a queue creation request to the first MQ node. It can be understood that the first MQ node is any MQ node among the multiple MQ nodes of the first site.
[0060] For example, Figure 4 As shown ( Figure 4 Another structural diagram of the cloud service system provided in the embodiment of the present application) is provided in the cloud service system including AZ1 and AZ2, AZ1 includes MQ node 1 and MQ node 2, and AZ2 includes MQ node 3 and MQ node 4. When a computing node of AZ1 needs to create a queue, it can randomly access MQ node 2 and send a queue creation request to MQ node 2.
[0061] 302. The first MQ node determines a second MQ node with the smallest load value among multiple MQ nodes at the first site and multiple MQ nodes at the second site based on the queue creation request, and creates a main message queue of the computing node in the second MQ node.
[0062] After receiving the queue creation request from the computing node, the first MQ node can parse the queue creation request and determine that a main message queue and a backup message queue need to be created for the computing node. Therefore, the first MQ node can select the second MQ node with the smallest load value (i.e., the main MQ node assigned to the computing node) from the multiple MQ nodes of the first site and the multiple MQ nodes of the second site, and then create the main message queue of the computing node in the second MQ node.
[0063] Specifically, the first MQ node may determine the second MQ node in the following manner:
[0064] (1) After receiving the queue creation request from the computing node, the first MQ node can parse the queue creation request and determine that a main message queue and a backup message queue need to be created for the computing node. Then, the first MQ node can first obtain the load information of multiple MQ nodes of the first site and the load information of multiple MQ nodes of the second site, and perform a series of processing on the load information of multiple MQ nodes of the first site and the load information of multiple MQ nodes of the second site, so as to obtain the load values of multiple MQ nodes of the first site and the load values of multiple MQ nodes of the second site.
[0065] Among them, for any one of the multiple MQ nodes at the first site, the load information of the MQ node may include the number of transmission control protocol (TCP) of the MQ node (generally, there may be multiple TCP connections between the MQ node and a computing node), the number of primary message queues of the MQ node, the number of backup message queues of the MQ node, the number of queue producers connected to the MQ node, the number of queue consumers connected to the MQ node, and other load indicators, one or more of them. Similarly, for any one of the multiple MQ nodes at the second site, the load information of the MQ node may include the number of TCP of the MQ node, the number of primary message queues of the MQ node, the number of backup message queues of the MQ node, the number of queue producers connected to the MQ node, the number of queue consumers connected to the MQ node, and other load indicators, one or more of them.
[0066] Then, for any one of the multiple MQ nodes of the first site, the first MQ node can calculate at least one load indicator of the MQ node and the weight corresponding to the at least one load indicator, so as to obtain the load value of the MQ node. For the remaining MQ nodes of the first site and the multiple MQ nodes of the second site, the first MQ node can also perform the same operation as that performed on the MQ node, so the load values of the multiple MQ nodes of the first site and the load values of the multiple MQ nodes of the second site can be finally obtained.
[0067] Still like the above example, after receiving the queue creation request from the computing node, MQ node 2 can calculate the various load indicators and corresponding weights of MQ node 1, thereby obtaining the load value of MQ node 1. Similarly, MQ node 2 can also perform the same operation on itself, MQ node 3 and MQ node 4, thus obtaining the load value of MQ node 2, the load value of MQ node 3 and the load value of MQ node 4.
[0068] (2) After obtaining the load values of multiple MQ nodes of the first site and the load values of multiple MQ nodes of the second site, the first MQ node can determine the MQ node with the smallest load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site as the second MQ node for deploying the main message queue of the computing node.
[0069] Still as in the above example, after obtaining the load value of MQ node 1, the load value of MQ node 2, the load value of MQ node 3 and the load value of MQ node 4, MQ node 2 can determine that MQ node 1 is the MQ node with the lowest load value, so MQ node 2 can select MQ node 1 as the main MQ node of the computing node, and create the main message queue Q1 (M) of the computing node on MQ node 1.
[0070] 303. If the multiple MQ nodes of the first site include the second MQ node, the first MQ node determines a third MQ node with the smallest load value among the multiple MQ nodes of the second site, and creates a backup message queue of the computing node in the third MQ node.
[0071] After determining the second MQ node, the first MQ node can detect whether the second MQ node is located in the first site or in the second site. If the multiple MQ nodes of the first site include the second MQ node, that is, the second MQ node is located in the first site, the first MQ node can determine the MQ node with the smallest load value among the multiple nodes of the second site as the third MQ node for deploying the backup message queue of the computing node (that is, the backup MQ node allocated to the computing node), and create the backup message queue of the computing node in the third MQ node. In this way, the main message queue and the backup message queue of the computing node strictly meet the physical affinity.
[0072] It should be noted that when the second MQ node is located in the first site, the first MQ node and the second MQ node may be the same MQ node in the first site, or may be two different MQ nodes, and there is no limitation here.
[0073] Still as in the above example, after determining that MQ node 1 is the main MQ node of the computing node, MQ node 2 can determine that MQ node 3 is the MQ node with the lowest load value among MQ node 3 and MQ node 4. Therefore, MQ node 2 can select MQ node 3 as the backup MQ node of the computing node and create a backup message queue Q1(S) of the computing node on MQ node 3.
[0074] 304. If the multiple MQ nodes of the second site include the second MQ node, the first MQ node determines a third MQ node with the smallest load value among the multiple MQ nodes of the first site, and creates a backup message queue of the computing node in the third MQ node.
[0075] If the multiple MQ nodes of the second site include the second MQ node, that is, the second MQ node is located in the second site, the first MQ node can determine the MQ node with the smallest load value among the multiple nodes of the first site as the third MQ node for deploying the backup message queue of the computing node (that is, the backup MQ node allocated to the computing node), and create the backup message queue of the computing node in the third MQ node. In this way, the main message queue and the backup message queue of the computing node strictly meet the physical affinity.
[0076] For example, Figure 5 As shown ( Figure 5 Another structural diagram of the cloud service system provided in the embodiment of the present application) is provided in the cloud service system including AZ1 and AZ2, AZ1 includes MQ node 1 and MQ node 2, and AZ2 includes MQ node 3 and MQ node 4. When a computing node of AZ1 needs to create a queue, it can randomly access MQ node 2 and send a queue creation request to MQ node 2.
[0077] After receiving the queue creation request from the computing node, MQ node 2 can calculate the various load indicators and corresponding weights of MQ node 1, thereby obtaining the load value of MQ node 1. Similarly, MQ node 2 can also perform the same operation on itself, MQ node 3, and MQ node 4, thereby obtaining the load value of MQ node 2, the load value of MQ node 3, and the load value of MQ node 4.
[0078] After obtaining the load value of MQ node 1, the load value of MQ node 2, the load value of MQ node 3 and the load value of MQ node 4, MQ node 2 can determine that MQ node 3 is the MQ node with the lowest load value, so MQ node 3 can select MQ node 1 as the main MQ node of the computing node, and create the main message queue Q1 (M) of the computing node on MQ node 3.
[0079] After determining that MQ node 3 is the main MQ node of the computing node, MQ node 2 can determine that MQ node 1 is the MQ node with the lowest load value between MQ node 1 and MQ node 2. Therefore, MQ node 2 can select MQ node 1 as the backup MQ node of the computing node and create a backup message queue Q1 (S) of the computing node on MQ node 1.
[0080] Specifically, if the first MQ node is unavailable (for example, the first MQ node fails or is being upgraded, etc.), the first MQ node may perform the following operations:
[0081] (1) When it is determined that the first MQ node is unavailable, the first MQ node can migrate multiple main message queues of the first MQ node to the remaining MQ nodes (i.e., the aforementioned fourth MQ node) in the first site except the first MQ node and the multiple MQ nodes in the second site. It should be noted that for the remaining MQ nodes in the first site and the multiple MQ nodes in the second site, the first MQ node can refer to the load value of each MQ node to determine the number of main message queues to be allocated to each MQ node. Therefore, after the first MQ node migrates the multiple main message queues of the first MQ node to the remaining MQ nodes in the first site except the first MQ node and the multiple MQ nodes in the second site, the number of main message queues of the remaining MQ nodes in the first site and the number of main message queues of the multiple MQ nodes in the second site can be kept the same or similar. In this way, the remaining MQ nodes in the first site and the multiple MQ nodes in the second site can achieve load balancing.
[0082] It is worth noting that for any one of the multiple main message queues of the first MQ node, if the first MQ node migrates the main message queue to a certain MQ node of the first site, the backup message queue corresponding to the main message queue will be migrated to a certain MQ node of the second site, so the backup message queue corresponding to the main message queue can meet the physical anti-affinity with the main message queue. For the remaining main message queues of the first MQ node, the first MQ node will also perform similar operations, so that the multiple main message queues of the first MQ node and the backup message queues corresponding to these multiple main message queues can meet the physical anti-affinity.
[0083] For example, Figure 6a As shown ( Figure 6a Another structural diagram of the cloud service system provided in the embodiment of the present application is shown in FIG. Figure 6a is Figure 4 or Figure 5 (drawn on the basis of ), when MQ node 1 fails, MQ node 1 can divide its multiple main message queues Q(S) into three parts. The first part of the main message queue Qa(S) is migrated to MQ node 2, the second part of the main message queue Qb(S) is migrated to MQ node 3, and the third part of the main message queue Qc(S) is migrated to MQ node 4. After the migration is completed, the number of main message queues of MQ node 2 and the number of main message queues of MQ node 3 are very close to the number of main message queues of MQ node 4, and the three can achieve load balancing.
[0084] (2) When it is determined that the first MQ node is unavailable, the first MQ node may also migrate multiple standby message queues of the first MQ node to the remaining MQ nodes of the first site. It is worth noting that since the main message queues corresponding to the multiple standby message queues of the first MQ node are originally deployed in one or some MQ nodes of the second site, the first MQ node only needs to migrate the multiple standby message queues of the first MQ node to the remaining MQ nodes of the first site, so that the physical anti-affinity can be satisfied between the multiple standby message queues of the first MQ node and the main message queues corresponding to the multiple standby message queues.
[0085] Still as in the above example, when MQ node 1 fails, MQ node 1 can migrate its multiple standby message queues Q(M) to MQ node 2.
[0086] More specifically, if the first site is unavailable (for example, multiple MQ nodes in the first site fail or are being upgraded, etc.), the first MQ node may perform the following operations:
[0087] When it is determined that multiple MQ nodes in the first site are unavailable, the first MQ node migrates multiple main message queues of the first MQ node to multiple MQ nodes in the second site. It should be noted that for multiple MQ nodes in the second site, the first MQ node can refer to the load value of each MQ node to determine the number of main message queues to be allocated to each MQ node. Therefore, after the first MQ node migrates multiple main message queues of the first MQ node to multiple MQ nodes in the second site, the number of main message queues of multiple MQ nodes in the second site can be kept the same or similar. In this way, multiple MQ nodes in the second site can achieve load balancing.
[0088] Similarly, the remaining sites in the first site can also perform operations similar to those performed by the first MQ node, so all main message queues in the entire first site can be migrated to multiple MQ nodes in the second site.
[0089] For example, Figure 6b As shown ( Figure 6b Another structural diagram of the cloud service system provided in the embodiment of the present application is shown in FIG. Figure 6b is Figure 4 or Figure 5), when both MQ node 1 and MQ node 2 fail, MQ node 1 can divide its multiple main message queues Q`(S) into two parts, the first part of the main message queue Qa(S) is migrated to MQ node 3, and the second part of the main message queue Qb(S) is migrated to MQ node 4. Similarly, MQ node 2 can also divide its multiple main message queues Q``(S) into two parts, the first part of the main message queue Qc(S) is migrated to MQ node 3, and the second part of the main message queue Qd(S) is migrated to MQ node 4. After the migration is completed, the number of main message queues of MQ node 3 is very close to the number of main message queues of MQ node 4, and the two can achieve load balancing.
[0090] More specifically, if a new MQ node (ie, the fifth MQ node mentioned above) is added to the first site, the first MQ node may perform the following operations:
[0091] If a new MQ node is added to the first site, the first MQ node can select several standby message queues from its multiple standby message queues based on its own load value, and migrate these standby message queues to the new MQ node. Similarly, the remaining MQ nodes in the first site except the first MQ node and the new MQ node can also perform the same operations as the first MQ node. Therefore, after the first MQ node and the remaining MQ nodes migrate their respective standby message queues to the new MQ node, the number of standby message queues of the first MQ node, the number of standby message queues of the remaining MQ nodes, and the number of standby message queues of the new MQ node can be kept the same or similar. In this way, each MQ node in the first site can achieve load balancing.
[0092] For example, Figure 7 As shown ( Figure 7 Another structural diagram of the cloud service system provided in the embodiment of the present application is shown in FIG. Figure 7 is Figure 4 or Figure 5 After MQ node 5 is added to AZ1, MQ node 1 can migrate part of the standby message queue Qa(M) to MQ node 5, and MQ node 2 can migrate part of the standby message queue Qb(M) to MQ node 5. After the migration is completed, the number of standby message queues of MQ node 1 and the number of standby message queues of MQ node 2 are very close to the number of standby message queues of MQ node 5, and the three can achieve load balancing.
[0093] The cloud service system used in the embodiment of the present application includes a first site and a second site, the first site includes multiple MQ nodes, and the second site includes multiple MQ nodes. In the cloud service system, when a computing node needs to create a queue, the computing node can send a queue creation request to the first MQ node located in the first site. Then, the first MQ node can determine the second MQ node with the smallest load value from the multiple MQ nodes of the first site and the multiple MQ nodes of the second site based on the queue creation request, and create the main message queue of the computing node in the second MQ node. Then, the first MQ node can detect whether the second MQ node is located in the first site or the second site. If the second MQ node is located in the first site, the first MQ node can determine the third MQ node with the smallest load value from the multiple MQ nodes of the second site, and create a backup message queue of the computing node in the third MQ node. If the second MQ node is located in the second site, the first MQ node can determine the third MQ node with the smallest load value from the multiple MQ nodes of the first site, and create a backup message queue of the main message queue in the third MQ node. In the above process, the first MQ node can deploy the main message queue of the computing node and the backup message queue of the computing node in the second MQ node and the third MQ node respectively. Since the second MQ node and the third MQ node are located in the first site and the second site respectively, it is equivalent to deploying the main message queue and the backup message queue of the computing node in the first site and the second site respectively, realizing physical anti-affinity. Then, if the second MQ node is unavailable, that is, the main message queue of the computing node deployed on the second MQ node needs to be migrated, the backup message queues corresponding to these main message queues are only deployed on the third MQ node (that is, only one backup or one mirror is required), and the third MQ node does not need to perform any negotiation operations, and can directly respond and upgrade the backup message queue of the computing node to the main message queue of the computing node, thereby quickly completing the migration of the main message queue of the computing node. In this way, the duration of the computing node service interruption can be reduced to a certain extent, thereby ensuring the service quality provided by the cloud service system.
[0094] Furthermore, in the embodiment of the present application, when the first MQ node is unavailable, the first MQ node can migrate its multiple main message queues to the remaining sites (i.e., the fourth MQ node) in the first site except the first MQ node and multiple sites in the second site, so that the number of main message queues of these MQ nodes remains the same or similar, that is, to keep these MQ nodes load balanced. In this way, after completing the migration of the main message queues, the load of these MQ nodes is still within a reasonable range, and the performance and availability of these MQ nodes can be maintained, thereby ensuring the service quality provided by the cloud service system.
[0095] Furthermore, in an embodiment of the present application, when a new MQ node (i.e., the fifth MQ node) is added to the first site, the first MQ node in the first site and the remaining nodes except the first MQ node and the new MQ node can appropriately migrate a certain amount of standby message queues to the new MQ node, so that the number of standby message queues of these nodes remains the same or similar, that is, these MQ nodes are load balanced. In this way, when a new MQ node is added to the site, the standby message queue can be migrated within the site for the new MQ node, so that the load of all MQ nodes in the site is still within a reasonable range, so as to maintain the performance and availability of all MQ nodes in the site, thereby ensuring the quality of service provided by the cloud service system.
[0096] The above is a detailed description of the message queue processing method based on the MQ node provided in the embodiment of the present application. The following is an introduction to the MQ node provided in the embodiment of the present application. Figure 8 A structural diagram of an MQ node provided in an embodiment of the present application, such as Figure 8 As shown, the MQ node can be used as a first MQ node, the first MQ node is set in the cloud service system, the cloud service system further includes a first site and a second site located in different geographical locations, the multiple MQ nodes of the first site include the first MQ node, and the first MQ node includes:
[0097] The receiving module 801 is used to receive a queue creation request from a computing node, wherein the multiple MQ nodes of the first site include the first MQ node; for example, the receiving module 801 can be used to implement Figure 3 Step 301 of the illustrated embodiment.
[0098] The first creation module 802 is used to determine the second MQ node with the smallest load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site based on the queue creation request, and create a main message queue of the computing node in the second MQ node; for example, the first creation module 802 can be used to implement Figure 3 Step 302 of the illustrated embodiment.
[0099] The second creation module 803 is used to determine a third MQ node with the smallest load value among the multiple MQ nodes of the second site if the multiple MQ nodes of the first site include the second MQ node, and create a backup message queue of the computing node in the third MQ node; for example, the second creation module 803 can be used to implement Figure 3 Step 303 of the illustrated embodiment.
[0100] The third creation module 804 is used to determine a third MQ node with the smallest load value among the multiple MQ nodes of the first site if the multiple MQ nodes of the second site include the second MQ node, and create a backup message queue of the computing node in the third MQ node. For example, the third creation module 804 can be used to implement Figure 3 Step 304 of the illustrated embodiment.
[0101] In one possible implementation, the first creation module 802 is used to: based on a queue creation request, process the load information of multiple MQ nodes at the first site and the load information of multiple MQ nodes at the second site to obtain the load values of the multiple MQ nodes at the first site and the load values of the multiple MQ nodes at the second site; determine the second MQ node with the smallest load value among the multiple MQ nodes at the first site and the multiple MQ nodes at the second site.
[0102] In one possible implementation, the load information of the multiple MQ nodes of the first site includes at least one of the following: the number of TCPs of the multiple MQ nodes of the first site, the number of main message queues of the multiple MQ nodes of the first site, the number of backup message queues of the multiple MQ nodes of the first site, the number of queue producers connected to the multiple MQ nodes of the first site, and the number of queue consumers connected to the multiple MQ nodes of the first site.
[0103] In one possible implementation, the first MQ node also includes: a first migration module, which is used to migrate multiple main message queues of the first MQ node to the fourth MQ node of the first site and the multiple MQ nodes of the second site if the first MQ node is unavailable, so that the number of main message queues of the fourth MQ node and the number of main message queues of the multiple MQ nodes of the second site are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site; the first MQ node migrates multiple backup message queues of the first MQ node to the fourth MQ node.
[0104] In one possible implementation, the first MQ node also includes: a second migration module, which is used to migrate multiple main message queues of the first MQ node to multiple MQ nodes of the second site if the first site is unavailable, so that the number of main message queues of the multiple MQ nodes of the second site is the same or similar.
[0105] In one possible implementation, the first MQ node also includes: a third migration module, which is used to migrate several backup message queues of the first MQ node to the fifth MQ node if a fifth MQ node is added to the first site, so that the number of backup message queues of the first MQ node, the number of backup message queues of the fourth node of the first site, and the number of backup message queues of the fifth MQ node are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site.
[0106] In one possible implementation, the first site is any one of the following: a region, an availability zone, a data center, and a computer room.
[0107] In one possible implementation, the first MQ node is any one of the following: a physical server, a virtual machine, a micro virtual machine, a container, and a bare metal server.
[0108] It should be noted that the information interaction, implementation process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the embodiment of the present application, and will not be repeated here.
[0109] See also Fig. 9 , Fig. 9 A schematic diagram of a computing device provided in an embodiment of the present application. Fig. 9 As shown, the computing device 900 (which can be used to present the aforementioned first MQ node) includes: a processor 901, a memory 902, a communication interface 903 and a bus 904. The processor 901, the memory 902 and the communication interface 903 are coupled via a bus (not marked in the figure). The memory 902 stores instructions. When the execution instructions in the memory 902 are executed, the computing device 900 executes the method executed by the first MQ node in the above method embodiment.
[0110] The computing device 900 may be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), or a combination of at least two of these integrated circuit forms. For another example, when a unit in the device can be implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0111] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.
[0112] The memory 902 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be 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), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0113] The memory 902 stores executable program codes, and the processor 901 executes the executable program codes to respectively implement the functions of the aforementioned receiving module, the first creation module, the second creation module, and the third creation module, thereby implementing the above-mentioned message queue management method based on the MQ node. That is, the memory 902 stores instructions for executing the above-mentioned message queue management method based on the MQ node.
[0114] The communication interface 903 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network.
[0115] In addition to the data bus, the bus 904 may also include a power bus, a control bus, a status signal bus, etc. The bus may be a peripheral component interconnect express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0116] See also Fig.10 , Fig.10 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. Fig.10 As shown, the computing device cluster 1000 includes at least one computing device 900 .
[0117] like Fig.10 As shown, the computing device cluster 1000 includes at least one computing device 900. The memory 902 in one or more computing devices 900 in the computing device cluster 1000 may store the same instructions for executing the above-mentioned message queue management method based on MQ nodes.
[0118] In some possible implementations, the memory 902 of one or more computing devices 900 in the computing device cluster 1000 may also respectively store some instructions for executing the above-mentioned message queue management method based on MQ nodes. In other words, the combination of one or more computing devices 900 can jointly execute the above-mentioned message queue management method based on MQ nodes.
[0119] It should be noted that the memory 902 in different computing devices 900 in the computing device cluster 1000 may store different instructions, which are respectively used to execute part of the functions of the first MQ node. That is, the instructions stored in the memory 902 in different computing devices 900 may implement the functions of one or more modules of the receiving module, the first creation module, the second creation module, the third creation module, and so on.
[0120] In some possible implementations, one or more computing devices 900 in the computing device cluster 1000 may be connected via a network, which may be a wide area network or a local area network.
[0121] See also Fig.11 , Fig.11 A schematic diagram of computer devices in a computer cluster provided in an embodiment of the present application being connected via a network. Fig.11 As shown, two computing devices 900A and 900B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.
[0122] In a possible implementation, the memory in the computing device 900A stores instructions for executing the functions of the receiving module and the like. Meanwhile, the memory in the computing device 900B stores instructions for executing the functions of the first creation module, the second creation module, the third creation module and the like.
[0123] It should be understood that Fig.11 The functions of the computing device 900A shown in FIG. 1 may also be completed by multiple computing devices. Similarly, the functions of the computing device 900B may also be completed by multiple computing devices.
[0124] The embodiment of the present application also relates to a computer storage medium, in which a program for signal processing is stored. When the program is run on a computer, the computer executes the following steps: Figure 3 The steps performed by the first MQ node in the illustrated embodiment.
[0125] The present application also relates to a computer program product, which stores instructions, which, when executed by a computer, enable the computer to execute the following Figure 3 The steps performed by the first MQ node in the illustrated embodiment.
[0126] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0127] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A message queue management method based on message middleware MQ node, characterized in that: The method is applied to a cloud service system, wherein the cloud service system includes a first site and a second site located in different geographical locations, and the method includes: A first MQ node receives a queue creation request from a computing node, wherein the plurality of MQ nodes of the first site include the first MQ node; The first MQ node determines, based on the queue creation request, a second MQ node with a minimum load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site, and creates a main message queue of the computing node in the second MQ node; If the multiple MQ nodes of the first site include the second MQ node, the first MQ node determines a third MQ node with the smallest load value among the multiple MQ nodes of the second site, and creates a standby message queue of the computing node in the third MQ node; If the multiple MQ nodes of the second site include the second MQ node, the first MQ node determines a third MQ node with the smallest load value among the multiple MQ nodes of the first site, and creates a backup message queue of the computing node in the third MQ node.
2. The method according to claim 1, characterized in that Determining, by the first MQ node based on the queue creation request, a second MQ node having a minimum load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site includes: The first MQ node processes the load information of the multiple MQ nodes of the first site and the load information of the multiple MQ nodes of the second site based on the queue creation request to obtain the load values of the multiple MQ nodes of the first site and the load values of the multiple MQ nodes of the second site; The first MQ node determines a second MQ node with a minimum load value among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site.
3. The method according to claim 2, characterized in that The load information of the multiple MQ nodes of the first site includes at least one of the following: the number of TCPs of the multiple MQ nodes of the first site, the number of main message queues of the multiple MQ nodes of the first site, the number of backup message queues of the multiple MQ nodes of the first site, the number of queue producers connected to the multiple MQ nodes of the first site, and the number of queue consumers connected to the multiple MQ nodes of the first site.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the first MQ node is unavailable, the first MQ node migrates multiple main message queues of the first MQ node to the fourth MQ node of the first site and multiple MQ nodes of the second site, so that the number of main message queues of the fourth MQ node and the number of main message queues of the multiple MQ nodes of the second site are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site; The first MQ node migrates multiple standby message queues of the first MQ node to the fourth MQ node.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the first site is unavailable, the first MQ node migrates multiple main message queues of the first MQ node to multiple MQ nodes of the second site so that the number of main message queues of the multiple MQ nodes of the second site is the same or similar.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If a fifth MQ node is added to the first site, the first MQ node migrates several backup message queues of the first MQ node to the fifth MQ node so that the number of backup message queues of the first MQ node, the number of backup message queues of the fourth node of the first site, and the number of backup message queues of the fifth MQ node are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site.
7. The method according to any one of claims 1 to 6, characterized in that: The first site is any one of the following: region, availability zone, data center, and computer room.
8. The method according to any one of claims 1 to 7, characterized in that: The first MQ node is any one of the following: a physical server, a virtual machine, a micro virtual machine, a container, and a bare metal server.
9. An MQ node, characterized in that: The MQ node serves as a first MQ node, the first MQ node is set in a cloud service system, the cloud service system further includes a first site and a second site located in different geographical locations, the multiple MQ nodes of the first site include the first MQ node, and the first MQ node includes: A receiving module, configured to receive a queue creation request from a computing node, wherein the plurality of MQ nodes of the first site include the first MQ node; A first creation module is used to determine, based on the queue creation request, a second MQ node with a minimum load value among multiple MQ nodes of the first site and multiple MQ nodes of the second site, and create a main message queue of the computing node in the second MQ node; a second creation module, configured to determine a third MQ node with a minimum load value among the multiple MQ nodes of the second site if the multiple MQ nodes of the first site include the second MQ node, and create a standby message queue of the computing node in the third MQ node; The third creation module is used to determine a third MQ node with the smallest load value among the multiple MQ nodes of the first site if the multiple MQ nodes of the second site include the second MQ node, and create a backup message queue of the computing node in the third MQ node.
10. The MQ node according to claim 9, characterized in that: The first creation module is used to: Based on the queue creation request, load information of multiple MQ nodes of the first site and load information of multiple MQ nodes of the second site are processed to obtain load values of multiple MQ nodes of the first site and load values of multiple MQ nodes of the second site; Among the multiple MQ nodes of the first site and the multiple MQ nodes of the second site, determine a second MQ node with a minimum load value.
11. The MQ node according to claim 10, characterized in that: The load information of the multiple MQ nodes of the first site includes at least one of the following: the number of TCPs of the multiple MQ nodes of the first site, the number of main message queues of the multiple MQ nodes of the first site, the number of backup message queues of the multiple MQ nodes of the first site, the number of queue producers connected to the multiple MQ nodes of the first site, and the number of queue consumers connected to the multiple MQ nodes of the first site.
12. The MQ node according to any one of claims 9 to 11, characterized in that: The first MQ node also includes: a first migration module, configured to migrate multiple main message queues of the first MQ node to a fourth MQ node of the first site and multiple MQ nodes of the second site if the first MQ node is unavailable, so that the number of main message queues of the fourth MQ node and the number of main message queues of the multiple MQ nodes of the second site are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site; The first MQ node migrates multiple standby message queues of the first MQ node to the fourth MQ node.
13. The MQ node according to any one of claims 9 to 11, characterized in that: The first MQ node also includes: The second migration module is used to migrate multiple main message queues of the first MQ node to multiple MQ nodes of the second site if the first site is unavailable, so that the number of main message queues of the multiple MQ nodes of the second site is the same or similar.
14. The MQ node according to any one of claims 9 to 13, characterized in that: The first MQ node also includes: The third migration module is used to migrate several backup message queues of the first MQ node to the fifth MQ node if a fifth MQ node is added to the first site, so that the number of backup message queues of the first MQ node, the number of backup message queues of the fourth node of the first site and the number of backup message queues of the fifth MQ node are the same or similar, and the first MQ node and the fourth MQ node are different MQ nodes in the first site.
15. The MQ node according to any one of claims 9 to 14, characterized in that: The first site is any one of the following: region, availability zone, data center, and computer room.
16. The MQ node according to any one of claims 9 to 15, characterized in that: The first MQ node is any one of the following: a physical server, a virtual machine, a micro virtual machine, a container, and a bare metal server.
17. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, each computing device including a processor and a memory: The memory is used to store instructions; The processor is configured to cause the computing device cluster to execute the method according to any one of claims 1 to 8 according to the instructions.
18. A computer storage medium, characterized in that: The computer storage medium stores one or more instructions, which, when executed by one or more computers, enable the one or more computers to implement the method of any one of claims 1 to 8.
19. A computer program product, characterized in that The computer program product stores instructions, which, when executed by a computer, enable the computer to implement the method according to any one of claims 1 to 8.
Citation Information
Cited By
Real-time readable data backup system based on message middleware
CN121433979A