Load balancing method, system and device and storage medium
By deploying business network cards and management network cards on the server of the RabbitMQ cluster, which are bound to the load balancer respectively, the problem of low processing efficiency of the load balancer is solved and efficient load balancing of the RabbitMQ cluster is achieved.
Patent Information
- Application Number
- CN202311107946.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-08-30
Smart Images

Figure CN119544723A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a load balancing method, system, device and storage medium. Background Art
[0002] Load balancing refers to balancing and distributing business requests to multiple servers, such as FTP servers, Web servers, enterprise core application servers, and other major task servers, so as to complete work tasks in a coordinated manner. Load balancing is built on the original network structure, and it provides a transparent, inexpensive and effective method to expand the bandwidth of servers and network devices, enhance network data processing capabilities, increase throughput, and improve network availability and flexibility.
[0003] During load balancing, the server in the prior art carries a single network card, which is bound to a single load balancer. In addition to distributing traffic, the single load balancer also has to handle the plug-in management function of the message middleware RabbitMQ, and there is an antagonistic relationship between the two.
[0004] Therefore, the prior art has a technical problem of low load balancing efficiency because a single load balancer needs to process the plug-in management function of the message middleware RabbitMQ. Summary of the invention
[0005] The present application provides a load balancing method, system, device and storage medium to solve the technical problem of low load balancing efficiency in the prior art.
[0006] In a first aspect, the present application provides a load balancing system, comprising: a message middleware, a business network card and a management network card deployed on any server in a RabbitMQ cluster, a first load balancer corresponding to the business network card, and a second load balancer corresponding to the management network card;
[0007] The business network card and the management network card respectively receive and forward business traffic and non-business traffic in the business request; wherein the business request is a request sent by a client, the client is a producer module or a consumer module in the RabbitMQ cluster, the business traffic is the traffic of the user business, and the non-business traffic is a function request for the message middleware;
[0008] The first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their respective corresponding servers, so that the respective corresponding servers can process the business traffic and the non-business traffic accordingly.
[0009] Optionally, the first load balancer is deployed with a first listener and a first load balancing instance, and the second load balancer is deployed with a second listener and a second load balancing instance;
[0010] Then the first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their respective corresponding servers, including:
[0011] The first listener and the second listener respectively listen to their corresponding ports, and forward the business traffic and the non-business traffic to the first load balancing instance and the second load balancing instance respectively;
[0012] The first load balancing instance and the second load balancing instance respectively determine the first server corresponding to the business traffic and the second server corresponding to the non-business traffic according to a preset load balancing algorithm, and distribute the business traffic and the non-business traffic to the first server and the second server through the business network card and the management network card respectively; wherein the first server and the second server are any servers in the RabbitMQ cluster.
[0013] Optionally, the service network card and the management network card respectively receive and forward service traffic and non-service traffic in the service request, including:
[0014] The service network card receives the first sub-service traffic sent by the client through the server where the service network card is located, and sends the first sub-service traffic to the first load balancer;
[0015] The service network card receives the second sub-service traffic sent by the client through the RabbitMQ dashboard carried by the message middleware, and sends the second sub-service traffic to the first load balancer;
[0016] The management network card receives non-business traffic sent by the client through the target tool, and sends the non-business traffic to the second load balancer.
[0017] Optionally, the first sub-service traffic includes at least one of the following: a connection request between the producer module and the consumer module, a message production request, a message consumption request, and a message confirmation request;
[0018] The second sub-service traffic includes at least one of the following: information viewing request, monitoring request, and management request of the RabbitMQ cluster;
[0019] The non-business traffic includes at least one of the following: a message middleware management request, a resource creation request, a resource modification request, a resource query request, a resource deletion request, and a password reset request.
[0020] Optionally, the first listener and the second listener respectively monitor their corresponding ports, including:
[0021] The first listener is used to listen to the port of the AMQP protocol; wherein the port of the AMQP protocol is the port between the client and the server;
[0022] The second listener is used to listen to the port of the management tool of the message middleware.
[0023] Optionally, the message middleware is in mirror mode.
[0024] Optionally, the target tool is a console, a target browser or a cloud computing service.
[0025] In a second aspect, the present application provides a load balancing method, which is applied to a load balancing system, wherein the load balancing system comprises: a message middleware, a business network card, and a management network card deployed on any server in a RabbitMQ cluster, a first load balancer corresponding to the business network card, and a second load balancer corresponding to the management network card; the method comprises:
[0026] The business network card and the management network card respectively receive and forward business traffic and non-business traffic in the business request; wherein the business request is a request sent by a client, the client is a producer module or a consumer module in the RabbitMQ cluster, the business traffic is the traffic of the user business, and the non-business traffic is a function request for the message middleware;
[0027] The first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their respective corresponding servers, so that the respective corresponding servers can process the business traffic and the non-business traffic accordingly.
[0028] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0029] The memory stores computer-executable instructions;
[0030] The processor executes the computer-executable instructions stored in the memory to implement the method described in the second aspect.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the second aspect.
[0032] The load balancing system provided by the present application includes: a message middleware, a business network card and a management network card deployed on any server in a RabbitMQ cluster, a first load balancer corresponding to the business network card, and a second load balancer corresponding to the management network card; the business network card and the management network card respectively receive and forward business traffic and non-business traffic in business requests; wherein the business request is a request sent by a client, the client is a producer module or a consumer module in a RabbitMQ cluster, the business traffic is the traffic of the user's business, and the non-business traffic is a functional request for the message middleware; the first load balancer and the second load balancer respectively distribute the business traffic and non-business traffic to their respective corresponding servers, so that their respective corresponding servers can respectively process the business traffic and non-business traffic.
[0033] The present application is provided with dual network cards, namely a business network card and a management network card, and separates the business traffic and non-business traffic in the business request by binding load balancers to different network cards respectively, thereby increasing the number of requests per second and the number of concurrent connections of the RabbitMQ cluster. Compared with the prior art, the present application can improve the load balancing efficiency through the load balancing system with the above structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] Figure 1 A schematic diagram of the structure of a load balancing system provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of the structure of a load balancing system provided in an embodiment of the present application;
[0037] Figure 3 A flow chart of a load balancing method provided in an embodiment of the present application;
[0038] Figure 4 A flow chart of another load balancing method provided in an embodiment of the present application;
[0039] Figure 5 A flow chart of another load balancing method provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0041] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0042] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of systems and methods consistent with some aspects of the present application as detailed in the appended claims.
[0043] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0044] In the prior art, message middleware is an important component of a distributed system. It is a queue that receives, stores, and distributes messages. Applications communicate by reading and writing queue messages of the message middleware.
[0045] Among them, RabbitMQ is an open source message middleware written in Erlang language that implements the Advanced Message Queuing Protocol (AMQP). Currently, RabbitMQ provides the following three modes: stand-alone, ordinary cluster and mirror cluster. Among them, the mirror cluster can synchronize data with other nodes, so that when a single node goes down, it can still provide services to the outside world through a unique access address to ensure that data is not lost. RabbitMQ has features such as ordinary messages, broadcast messages, private messages, and delayed messages. The producer sends the message to the RabbitMQ switch, and the switch routes the message to the queue. The switch supports four routing methods: Direct, Topic, Headers and Fanout, and also supports switch combination and customization.
[0046] Load balancing refers to balancing and distributing the load (including user services, function requests and other tasks) to multiple servers for operation, such as FTP servers, Web servers, enterprise core application servers and other main task servers, so as to complete the work tasks in a collaborative manner. Load balancing is built on the original network structure. It provides a transparent, cheap and effective method to expand the bandwidth of servers and network devices, enhance network data processing capabilities, increase throughput, and improve network availability and flexibility. For load balancing, the prior art proposes a cluster load balancing method based on aspect oriented programming (AOP) of the message middleware. In the scenario where the traffic of the business system is concentrated on one or more virtual hosts, this method can disassemble / map the virtual host (Vhost) into multiple virtual hosts, and disperse them on different Broker nodes, and store all switches under the same virtual host on different Broker nodes.
[0047] Load balancing in RabbitMQ has the following drawbacks:
[0048] (1) In stand-alone mode, RabbitMQ cannot meet the user's high availability requirements and has a relatively low performance bottleneck. Although the ordinary cluster mode can improve RabbitMQ's message throughput, once a node goes down, the message will be inaccessible. At the same time, the messages in the queue that are not persisted will be lost, and persistence cannot be guaranteed. The mirror cluster mode solves the problem of high availability, but there is still room for optimization.
[0049] (2) RabbitMQ's port 5672 provides external communication services, while RabbitMQ's port 15672 provides a management interface (Unit Interval, UI) on the one hand, and internal API (Application Programming Interface) functions such as "virtual host Vhost management" and "user management" on the other hand. These API functions can be used by users to perform related operations in the cloud vendor's console. A single network card or network must simultaneously bear the user's business and cloud vendor console functions, which invisibly reduces the network's transmission capacity.
[0050] (3) The server in the prior art carries a single network card, which is bound to a single load balancer. In addition to distributing traffic, the single load balancer also has to handle the plug-in management function of the message middleware RabbitMQ. The two are in an antagonistic relationship. Specifically, although a single load balancer can monitor ports 5672 and 15672 at the same time, it still cannot achieve optimal performance. In addition, the plug-in management function of RabbitMQ may create new port monitoring on this load balancer, such as ports 61613 / 61614 of Rabbitmq_Stomp, port 15674 of Rabbitmq_Web_Stomp, port 1883 / 8883 of Rabbitmq_Mqtt, port 15675 of Rabbitmq_Web_Mqtt, etc. These monitoring ports will further reduce the efficiency of load balancing, thereby affecting port 5672 corresponding to user services and reducing some performance.
[0051] The load balancing system provided in this application is intended to solve the above technical problems in the prior art.
[0052] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0053] Embodiment 1:
[0054] Figure 1 A schematic diagram of the structure of a load balancing system provided in an embodiment of the present application. Figure 1 As shown, the system includes: a message middleware 10, a business network card 11 and a management network card 12 deployed on any server in the RabbitMQ cluster, a first load balancer 21 corresponding to the business network card 11, and a second load balancer 22 corresponding to the management network card 12.
[0055] It should be understood that the server can refer to a device such as a computer, and the message middleware 10 deployed on any server in the RabbitMQ cluster can refer to RabbitMQ. The Rabbit MQ contains elements such as queues, switches, and routes. The first load balancer 21 and the second load balancer 22 can be deployed on other servers in the RabbitMQ cluster except the server where the business network card 11 is located. All servers are used to form a backbone pool, which may also be called a cloud pool, a resource pool, etc. In addition, the servers in this application communicate in the intranet. The business network card 11 corresponds to a layer of business network, and the management network card 12 corresponds to a layer of management network.
[0056] The service network card 11 and the management network card 12 receive and forward the service traffic and non-service traffic in the service request respectively; wherein the service request is a request sent by the client, the client is a producer module or a consumer module in the RabbitMQ cluster, the service traffic is the traffic of the user service, and the non-service traffic is a function request to the message middleware 10. It should be understood that the service traffic refers to the user service traffic, and the non-service traffic refers to the cloud business console function traffic.
[0057] The first load balancer 21 and the second load balancer 22 respectively distribute the business traffic and the non-business traffic to their corresponding servers, so that the corresponding servers can process the business traffic and the non-business traffic accordingly.
[0058] The embodiment of the present application is provided with a dual network card of a business network card and a management network card, and separates the business traffic and non-business traffic in the business request by binding different network cards to load balancers respectively, thereby increasing the number of requests per second (QPS) and concurrent number TPS of the RabbitMQ cluster. Compared with the prior art, the embodiment of the present application can improve the load balancing efficiency through the load balancing system of the above structure.
[0059] In one possible implementation, Figure 2 As shown, the first load balancer 21 is deployed with a first listener 211 and a first load balancing instance 212 , and the second load balancer 22 is deployed with a second listener 221 and a second load balancing instance 222 .
[0060] The first load balancer 21 and the second load balancer 22 respectively distribute the business traffic and non-business traffic to their respective corresponding servers, including:
[0061] The first listener 211 and the second listener 221 respectively listen to their corresponding ports, and forward the business traffic and non-business traffic to the first load balancing instance 212 and the second load balancing instance 222 respectively.
[0062] Specifically, the first listener and the second listener respectively monitor their corresponding ports, including:
[0063] The first listener is used to listen to the port of the AMQP protocol; wherein the port of the AMQP protocol is the port between the client and the server.
[0064] The second listener is used to listen to the port of the management tool of the message middleware.
[0065] The first load balancing instance and the second load balancing instance respectively determine the first server corresponding to the business traffic and the second server corresponding to the non-business traffic according to a preset load balancing algorithm, and respectively distribute the business traffic and the non-business traffic to the first server and the second server through the business network card and the management network card; wherein the first server and the second server are any servers in the RabbitMQ cluster.
[0066] In a possible implementation, the message middleware is in mirror mode.
[0067] The load balancing system proposed in this embodiment can realize a load balancing method for dual network cards under a message middleware cluster. This method is based on the mirror mode of the message middleware RabbitMQ. By binding the business network card and the management network card to the load balancer respectively, the user business traffic and the functional traffic of the cloud business console are separated, and corresponding listeners and backend server groups are created for each, thereby optimizing the network performance to the greatest extent and improving the request rate per second / concurrency of RabbitMQ.
[0068] In a possible implementation, the service network card and the management network card respectively receive and forward service traffic and non-service traffic in the service request, including:
[0069] The service network card receives the first sub-service traffic sent by the client through the server where the service network card is located, and sends the first sub-service traffic to the first load balancer.
[0070] The service network card receives the second sub-service traffic sent by the client through the RabbitMQ dashboard carried by the message middleware, and sends the second sub-service traffic to the first load balancer. It should be understood that the RabbitMQ dashboard is also called RabbitMQ Dashboard. RabbitMQ Dashboard is a front-end Web UI. After obtaining the use permission of the RabbitMQ, the user has the operation permission of the dashboard.
[0071] The management network card receives non-business traffic sent by the client through the target tool, and sends the non-business traffic to the second load balancer. It should be understood that the target tool is a console, a target browser or a cloud computing service.
[0072] Specifically, users create components through the console, that is, users click to create Vhost, queue, etc. through the console / browser / China Unicom Cloud page, so that the client can send these functional requests to Rabbit MQ through the browser.
[0073] It should be noted that the above non-business traffic can be used as the second sub-business traffic and created through the RabbitMQ dashboard. Compared with the creation method through the RabbitMQ dashboard, the creation through the target tool has the advantages of being simple, intuitive and concise.
[0074] In a possible implementation, the first sub-service traffic includes at least one of the following: a connection request between a producer module and a consumer module, a message production request, a message consumption request, and a message confirmation request.
[0075] The first sub-service flow is the main service request of RabbitMQ, so that producers and consumers can connect to the RabbitMQ server and send and receive messages through the servers in the RabbitMQ cluster. After the user obtains the RabbitMQ product, the service request can be sent.
[0076] In the embodiment of the present application, the producer module and the consumer module are connected through Rabbit MQ. The producer module publishes the message production request to Rabbit MQ, and the consumer module consumes the message through Rabbit MQ. Compared with non-business traffic, the first sub-business traffic is different from the non-business traffic type and is obtained through different devices.
[0077] The second sub-service traffic includes at least one of the following: RabbitMQ cluster information viewing request, monitoring request and management request. It should be understood that the second sub-service traffic is a request sent through the RabbitMQ Dashboard. Users can view, monitor, manage, etc. the RabbitMQ cluster through the RabbitMQ Dashboard.
[0078] Non-business traffic includes at least one of the following: message middleware management request, resource creation request, resource modification request, resource query request, resource deletion request, and password reset request. In other words, non-business traffic includes functional requests of the cloud business front-end console. Functional requests are used to implement functions such as Vhost management, user management, queue management, and switch management. Users can create, modify, query, delete, reset passwords, and other operations on resources through the console.
[0079] In general, the first sub-business traffic, the second sub-business traffic and the non-business traffic are requests from different sources. The first sub-business traffic and the second sub-business traffic are both requests initiated by users, while the non-business traffic requests functions provided by the operator and is created by users of the message middleware RabbitMQ through the console.
[0080] The embodiment of the present application can avoid the impact of non-business traffic on load balancing and improve load balancing efficiency by sending business requests from different sources to the corresponding network card.
[0081] In summary, the load balancing system in the embodiment of the present application enables the functional traffic of the cloud business console to flow into the management network card, and the business traffic of the user to flow into the business network card. The two types of traffic are isolated from each other and do not interfere with each other. The functional traffic of the cloud business console has its own corresponding second management network card and second load balancer, which will not occupy the network resources of the user's business, and improves the network performance and throughput of RabbitMQ to a certain extent. On this basis, the two network cards are each bound to a load balancer and a corresponding listener, etc., and through a unique entry address (for example: load balancing Vip) or a higher-level elastic public network address IP, RabbitMQ realizes multi-node load balancing in the mirror cluster mode, further reducing the pressure on a single node in the RabbitMQ cluster and improving service performance.
[0082] Embodiment 2:
[0083] Figure 3 A flow chart of a load balancing method provided in an embodiment of the present application. The load balancing method is applied to a load balancing system, which includes: a message middleware, a business network card and a management network card deployed on any server in a RabbitMQ cluster, a first load balancer corresponding to the business network card, and a second load balancer corresponding to the management network card. Figure 3 As shown, the load balancing method includes:
[0084] S1, the business network card and the management network card, respectively receive and forward the business traffic and non-business traffic in the business request; wherein, the business request is a request sent by the client, the client is the producer module or consumer module in the RabbitMQ cluster, the business traffic is the traffic of the user business, and the non-business traffic is the function request for the message middleware.
[0085] S2, the first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their corresponding servers, so that the corresponding servers can process the business traffic and the non-business traffic accordingly.
[0086] Optionally, the first load balancer is deployed with a first listener and a first load balancing instance, and the second load balancer is deployed with a second listener and a second load balancing instance.
[0087] The first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their corresponding servers, including:
[0088] The first listener and the second listener respectively listen to their corresponding ports, and forward the business traffic and non-business traffic to the first load balancing instance and the second load balancing instance respectively.
[0089] The first load balancing instance and the second load balancing instance respectively determine the first server corresponding to the business traffic and the second server corresponding to the non-business traffic according to a preset load balancing algorithm, and respectively distribute the business traffic and the non-business traffic to the first server and the second server through the business network card and the management network card; wherein the first server and the second server are any servers in the RabbitMQ cluster.
[0090] Optionally, the service network card and the management network card respectively receive and forward service traffic and non-service traffic in the service request, including:
[0091] A service network card receives a first sub-service flow sent by a client through a server where the service network card is located, and sends the first sub-service flow to a first load balancer;
[0092] The service network card receives the second sub-service traffic sent by the client through the RabbitMQ dashboard carried by the message middleware, and sends the second sub-service traffic to the first load balancer;
[0093] The management network card receives non-business traffic sent by the client through the target tool, and sends the non-business traffic to the second load balancer.
[0094] like Figure 4 As shown, different types of requests, such as non-business traffic, first sub-business traffic, and second sub-business traffic, can interact with the RabbitMQ cluster in different ways.
[0095] like Figure 5 As shown, the first load balancer can be abstracted as the first load balancer corresponding to the user network card, and the first load balancer creates the corresponding first listener. On the one hand, the first load balancer takes over the user's own business, including the connection between producers and consumers, the production and consumption of messages, message confirmation, etc.; on the other hand, the user can view, monitor, and manage the RabbitMQ cluster through the front-end UI of RabbitMQ Dashboard. The above two aspects expose the two ports 5672 and 15672 to the outside, so the first load balancer corresponding to the user network card listens to the two ports 5672 and 15672 at the same time.
[0096] The second load balancer can be abstracted as a second load balancer corresponding to the management network card, and the second load balancer creates a corresponding second listener. The second load balancer takes over the basic functions of the cloud business console message middleware, including vhost management, user management, queue management, switch management, etc. Since the above functions are completed by indirectly calling the internal API of RabbitMQ Dashboard, and the service port of RabbitMQ Dashboard is 15672, the second load balancer only listens to port 15672.
[0097] Optionally, the first sub-service traffic includes at least one of the following: a connection request between a producer module and a consumer module, a message production request, a message consumption request, and a message confirmation request;
[0098] The second sub-business traffic includes at least one of the following: information viewing request, monitoring request, and management request of the RabbitMQ cluster;
[0099] The non-business traffic includes at least one of the following: a message middleware management request, a resource creation request, a resource modification request, a resource query request, a resource deletion request, and a password reset request.
[0100] Optionally, the first listener and the second listener respectively monitor their corresponding ports, including:
[0101] A first listener is used to listen to the port of the AMQP protocol; wherein the port of the AMQP protocol is the port between the client and the server;
[0102] The second listener is used to listen to the port of the management tool of the message middleware.
[0103] Optionally, the message middleware is in mirror mode.
[0104] Optionally, the target tool is a console, a target browser or a cloud computing service. The implementation principle and technical effect of the load balancing method provided in this embodiment are similar to those of the above-mentioned load balancing system, and will not be described in detail here.
[0105] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0106] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device includes a receiver 60, a transmitter 61, at least one processor 62 and a memory 63. The electronic device composed of the above components can be used to implement the above-mentioned several specific embodiments of the present application, which will not be described in detail here.
[0107] The embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, each step of the method in the above embodiment is implemented.
[0108] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0109] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0110] It should be understood that the above system embodiments are only illustrative, and the system of the present application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0111] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0112] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0113] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, 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, which is stored in a memory and includes several instructions for 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 various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0114] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0115] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0116] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A load balancing system, characterized in that: include: A message middleware, a business network card, and a management network card deployed on any server in the RabbitMQ cluster, a first load balancer corresponding to the business network card, and a second load balancer corresponding to the management network card; The business network card and the management network card respectively receive and forward business traffic and non-business traffic in the business request; wherein the business request is a request sent by a client, the client is a producer module or a consumer module in the RabbitMQ cluster, the business traffic is the traffic of the user business, and the non-business traffic is a function request for the message middleware; The first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their respective corresponding servers, so that the respective corresponding servers can process the business traffic and the non-business traffic accordingly.
2. The system according to claim 1, characterized in that The first load balancer is deployed with a first listener and a first load balancing instance, and the second load balancer is deployed with a second listener and a second load balancing instance; Then the first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their respective corresponding servers, including: The first listener and the second listener respectively listen to their corresponding ports, and forward the business traffic and the non-business traffic to the first load balancing instance and the second load balancing instance respectively; The first load balancing instance and the second load balancing instance respectively determine the first server corresponding to the business traffic and the second server corresponding to the non-business traffic according to a preset load balancing algorithm, and distribute the business traffic and the non-business traffic to the first server and the second server through the business network card and the management network card respectively; wherein the first server and the second server are any servers in the RabbitMQ cluster.
3. The system according to claim 1, characterized in that The service network card and the management network card respectively receive and forward service traffic and non-service traffic in the service request, including: The service network card receives the first sub-service traffic sent by the client through the server where the service network card is located, and sends the first sub-service traffic to the first load balancer; The service network card receives the second sub-service traffic sent by the client through the RabbitMQ dashboard carried by the message middleware, and sends the second sub-service traffic to the first load balancer; The management network card receives non-business traffic sent by the client through the target tool, and sends the non-business traffic to the second load balancer.
4. The system according to claim 3, characterized in that The first sub-service traffic includes at least one of the following: a connection request between the producer module and the consumer module, a message production request, a message consumption request, and a message confirmation request; The second sub-service traffic includes at least one of the following: information viewing request, monitoring request and management request of RabbitMQ cluster; The non-business traffic includes at least one of the following: a message middleware management request, a resource creation request, a resource modification request, a resource query request, a resource deletion request, and a password reset request.
5. The system according to claim 2, characterized in that The first listener and the second listener respectively monitor their corresponding ports, including: The first listener is used to listen to the port of the AMQP protocol; wherein the port of the AMQP protocol is the port between the client and the server; The second listener is used to listen to the port of the management tool of the message middleware.
6. The system according to any one of claims 1 to 5, characterized in that: The message middleware is in mirror mode.
7. The system according to claim 3, characterized in that The target tool is a console, a target browser or a cloud computing service.
8. A load balancing method, applied to a load balancing system, characterized in that: The load balancing system comprises: a message middleware, a service network card and a management network card deployed on any server in a RabbitMQ cluster, a first load balancer corresponding to the service network card, and a second load balancer corresponding to the management network card; the method comprises: The business network card and the management network card respectively receive and forward business traffic and non-business traffic in the business request; wherein the business request is a request sent by a client, the client is a producer module or a consumer module in the RabbitMQ cluster, the business traffic is the traffic of the user business, and the non-business traffic is a function request for the message middleware; The first load balancer and the second load balancer respectively distribute the business traffic and the non-business traffic to their respective corresponding servers, so that the respective corresponding servers can process the business traffic and the non-business traffic accordingly.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to claim 8 when executed by a processor.
Citation Information
Patent Citations
Cloud platform resource balance control method and server
CN108376103A
Internet of things service management system
CN111294383A
Method for realizing cluster sharing type public cloud load balancing
CN111638957A
Service data processing method, Kubernetes cluster and medium
CN114024971A
Cloud native software-defined network architecture for multiple clusters
EP4160409A1