Dual-machine distributed arbitration system and arbitration method thereof
By deploying independent distributed arbitration nodes and hardware arbitration equipment in dual-airport scenarios, using virtual IP and dual-machine reliability mechanisms, distributed arbitration is realized, solving the problems of high costs and poor universality, and improving the reliability of dual-machine arbitration Sex and universality.
Patent Information
- Application Number
- CN202210049916.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-01-17
AI Technical Summary
The existing distributed arbitration mechanism is costly and has poor versatility in dual-airport scenarios, and cannot effectively solve the split brain problem in dual-machine arbitration.
Using a dual-machine distributed arbitration system, the distributed arbitration nodes are deployed on two hosts and dynamically migrate between hosts using virtual IP, combining dual-machine reliable mechanisms and hardware arbitration equipment to achieve distributed arbitration and avoid additional deployment. The third host reduces costs and improves reliability.
The application of distributed arbitration in dual-airport scenarios has been realized, which reduces costs, improves reliability and versatility, solves the split brain problem, and does not require additional deployment of a third host.
Smart Images

Figure CN114579338B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a dual-machine distributed arbitration system and an arbitration method thereof. Background Art
[0002] At present, the industry's dual-machine arbitration includes keep alive, LVS, etc., which support the reliability of two machines, but the disadvantage is that brain split will occur. Therefore, the current application of distributed arbitration mechanism is more extensive than the dual-machine arbitration mechanism. For example, the industry's distributed arbitration mechanism includes Paxos and Raft algorithms, and the software implementation includes open source implementations such as zookeeper and Nacos. However, distributed arbitration must set up arbitration nodes on at least three or more hosts, and at least three arbitration nodes on at least three or more hosts participate in voting. The cost is too high, and it is not suitable for dual-host application scenarios, and the versatility is poor.
[0003] Therefore, how to solve the high cost and poor versatility of the application of distributed arbitration mechanisms is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a dual-machine distributed arbitration system and an arbitration method thereof, which solve the problems of high cost and poor versatility in the application of a distributed arbitration mechanism.
[0005] A dual-machine distributed arbitration system, comprising:
[0006] A first host and a second host in communication connection;
[0007] an independent first distributed arbitration node and an independent second distributed arbitration node respectively deployed on the first host and the second host;
[0008] A third distributed arbitration node is deployed on the first host and the second host, and the third distributed arbitration node uses a virtual IP to dynamically migrate on the first host and the second host, including: based on the first distributed arbitration node and the second distributed arbitration node, a dual-machine reliable mechanism is used to arbitrate one of the third distributed arbitration nodes on the first host and the second host as a primary distributed arbitration node, and the other as a backup distributed arbitration node, and the primary distributed arbitration node preempts the virtual IP to provide external services.
[0009] In the embodiment of the present invention, an independent first distributed arbitration node and an independent second distributed arbitration node are respectively arranged on the first host and the second host, and a third distributed arbitration node is arranged on both the first host and the second host. The third distributed arbitration node can use a virtual IP to dynamically migrate on the first host and the second host. Specifically, based on the first distributed arbitration node on the first host and the second distributed arbitration node on the second host, a dual-machine reliable mechanism is adopted to arbitrate that one of the third distributed arbitration nodes on the first host and the second host is used as the main distributed arbitration node to seize the virtual IP for external services, and the other is used as the standby distributed arbitration node, thereby realizing the application of the distributed arbitration mechanism on the first host and the second host, and there is no need to deploy a third host separately. Therefore, the cost can be reduced by at least one third, and it can be applied to dual-host scenarios with better versatility.
[0010] In some embodiments, the dual-machine reliability mechanism includes:
[0011] When the first distributed arbitration node on the first host is a leader distributed arbitration node, the third distributed arbitration node on the first host is a standby distributed arbitration node, and the third distributed arbitration node on the second host is a master distributed arbitration node;
[0012] When the second distributed arbitration node on the second host is a leader distributed arbitration node, the third distributed arbitration node on the second host is a standby distributed arbitration node, and the first distributed arbitration node on the first host is a master distributed arbitration node.
[0013] In this embodiment, the above dual-machine reliability mechanism is used to ensure that the main distributed arbitration node is as exclusive as possible with the leader distributed arbitration node, that is, not on the same host, thereby minimizing the impact of a single machine failure on distributed arbitration and improving reliability.
[0014] In some embodiments, the dual-machine distributed arbitration system further includes a hardware arbitration device, and the hardware arbitration device is respectively connected to the first host and the second host for communication;
[0015] The hardware arbitration device is used to respectively receive a first arbitration result sent by the first host and an arbitration result sent by the second host.
[0016] In some embodiments, the hardware arbitration device is further used to arbitrate one of the third distributed arbitration nodes on the first host and the second host as the primary distributed arbitration node and the other as the backup distributed arbitration node as a standard arbitration result, and send the standard arbitration results to the first host and the second host, respectively.
[0017] In this embodiment, when the third distributed arbitration nodes on the first host and the second host are both master distributed arbitration nodes, the hardware arbitration device arbitrates one of the third distributed arbitration nodes on the first host and the second host as the master distributed arbitration node and the other as the standby distributed arbitration node as the standard arbitration result, and sends the standard arbitration result to the first host and the second host respectively, thereby solving the brain split problem existing in the dual-machine arbitration.
[0018] In some embodiments, the first host periodically sends a master node application request to the hardware arbitration device when the third distributed arbitration node deployed by the first host itself is arbitrated as a standby distributed arbitration node;
[0019] The second host is further configured to periodically send a master node application request to the hardware arbitration device when the third distributed arbitration node deployed by itself is arbitrated as a standby distributed arbitration node;
[0020] The hardware arbitration device is further configured to receive the master node application request, and send a master node application request response message to the first host or the second host that sent the master node application request.
[0021] In this embodiment, the host of the third distributed arbitration node arbitrating as a standby distributed arbitration node periodically sends a master node application request to the hardware arbitration device, so as to directly switch to the master distributed arbitration node as much as possible when the conditions are met.
[0022] In some embodiments, the hardware arbitration device includes an arbitration microcontroller or an arbitration circuit, which is simple to implement, low in cost, and has good versatility.
[0023] In some embodiments, the hardware arbitration device is connected to the first host and the second host through a serial port, a network cable, a communication bus or an Ethernet. The communication connection is simple and reliable.
[0024] Based on the same inventive concept, an embodiment of the present invention further provides an arbitration method for a dual-machine distributed arbitration system, the dual-machine distributed arbitration system comprising a first host and a second host that are communicatively connected, an independent first distributed arbitration node and an independent second distributed arbitration node respectively deployed on the first host and the second host, and a third distributed arbitration node respectively deployed on the first host and the second host; the arbitration method comprises the third distributed arbitration node dynamically migrating on the first host and the second host using a virtual IP;
[0025] The third distributed arbitration node dynamically migrates on the first host and the second host using the virtual IP, including:
[0026] Based on the first distributed arbitration node and the independent second distributed arbitration node, a dual-machine reliable mechanism is used to arbitrate one of the third distributed arbitration nodes on the first host and the second host as the main distributed arbitration node, and the other as the standby distributed arbitration node, and the main distributed arbitration node preempts the virtual IP for external services. Thus, the application of the distributed arbitration mechanism is realized on the first host and the second host, and there is no need to deploy a third host separately, so the cost can be reduced by at least one third, and it can be applied to dual-host scenarios with better versatility.
[0027] In some embodiments, the dual-machine reliability mechanism includes:
[0028] When the first distributed arbitration node on the first host is a leader distributed arbitration node, the third distributed arbitration node on the first host is a standby distributed arbitration node, and the third distributed arbitration node on the second host is a master distributed arbitration node;
[0029] When the second distributed arbitration node on the second host is the leader distributed arbitration node, the third distributed arbitration node on the second host is the standby distributed arbitration node, and the first distributed arbitration node on the first host is the master distributed arbitration node. The above dual-machine reliable mechanism ensures that the master distributed arbitration node is as exclusive as possible with the leader distributed arbitration node, that is, not on the same host, thereby minimizing the impact of a single machine failure on distributed arbitration and improving reliability.
[0030] In some embodiments, the dual-machine distributed arbitration system further includes a hardware arbitration device that is communicatively connected to the first host and the second host respectively;
[0031] The arbitration method further comprises:
[0032] The hardware arbitration device receives a first arbitration result sent by the first host and an arbitration result sent by the second host respectively;
[0033] When the first arbitration result is that the third distributed arbitration node on the first host is the primary distributed arbitration node, and the second arbitration result is that the third distributed arbitration node on the second host is the primary distributed arbitration node; or when the first arbitration result is that the third distributed arbitration node on the first host is the backup distributed arbitration node, and the second arbitration result is that the third distributed arbitration node on the second host is the backup distributed arbitration node, the hardware arbitration device arbitrates one of the third distributed arbitration nodes on the first host and the second host as the primary distributed arbitration node and the other as the backup distributed arbitration node as the standard arbitration result, and sends the standard arbitration result to the first host and the second host respectively. Thus, the brain split problem existing in dual-machine arbitration can be solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the structure of a dual-machine distributed arbitration system provided by an embodiment of the present invention;
[0035] Figure 2 for Figure 1 A schematic diagram showing that the third distributed arbitration node on the first host is a primary distributed arbitration node;
[0036] Figure 3 for Figure 1 A schematic diagram showing that the third distributed arbitration node on the second host is a primary distributed arbitration node;
[0037] Figure 4 A schematic diagram of the structure of another dual-machine distributed arbitration system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the following is a further detailed description of the embodiments of the present invention through specific implementation methods combined with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0039] In view of the problem of brain split in dual-machine arbitration in the current industry, the distributed arbitration mechanism requires setting arbitration nodes on at least three hosts, and at least three arbitration nodes on at least three hosts participate in voting, which is too costly and not suitable for dual-host application scenarios, and has poor versatility. This embodiment provides a dual-machine distributed arbitration system with low cost and better versatility. Figure 1As shown, it includes but is not limited to the first host IP1 and the second host IP2 that are communicatively connected; it should be understood that in this embodiment, the communication connection method between the first host IP1 and the second host IP2 can be flexibly set, for example, wireless communication connection methods such as WIFI, 4G, 5G, etc. can be used but are not limited to, and various wired connection methods can also be used, which is not limited to this embodiment.
[0040] In this embodiment, an independent first distributed arbitration node 11 is deployed on the first host IP1, and an independent second distributed arbitration node 12 is deployed on the second host IP2; and a third distributed arbitration node 13 (see Figure 1 As shown, the first distributed arbitration node 11, the second distributed arbitration node 12 and the third distributed arbitration node 13 form a dynamic three-node cluster. The third distributed arbitration node 13 in this embodiment can use a virtual IP (VIP, for example Figure 1 VIP3 in the example is dynamically migrated on the first host IP1 and the second host IP2. For example, based on the first distributed arbitration node 11 on the first host IP1 and the second distributed arbitration node 12 on the second host IP2, a dual-machine reliability mechanism is used to arbitrate one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 as the main distributed arbitration node, and the other as the backup distributed arbitration node, and the main distributed arbitration node preempts VIP3 for external services. That is, the dual-machine reliability mechanism ensures that only one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 is the main one, and the other is the backup one, thereby realizing the application of the distributed arbitration mechanism on the first host IP1 and the second host IP2, and there is no need to deploy a third host separately. Therefore, the cost can be reduced by at least one third, and it can be applied to dual-host scenarios, with a simpler overall network architecture and better versatility.
[0041] The dual-machine reliability mechanism in this embodiment can be flexibly set as long as the above-mentioned purpose can be achieved. For example, in one example, the dual-machine reliability mechanism may include that when the first distributed arbitration node 11 on the first host IP1 is the leader distributed arbitration node, the third distributed arbitration node 13 on the first arbitration host IP1 is the backup distributed arbitration node, and the third distributed arbitration node 13 on the second host IP2 is the main distributed arbitration node. For example, see Figure 2 shown.
[0042] When the second distributed arbitration node 12 on the second host IP2 is the leader distributed arbitration node, the third distributed arbitration node 13 on the second host IP2 is the standby distributed arbitration node, and the first distributed arbitration node 11 on the first host IP1 is the main distributed arbitration node. For example, see Figure 3 In this example, the above dual-machine reliability mechanism is used to ensure that the main distributed arbitration node is as exclusive as possible with the leader distributed arbitration node, that is, not on the same host, thereby minimizing the impact of single-machine failure on distributed arbitration and improving reliability.
[0043] In another example, the dual-machine reliability mechanism may include that when the first distributed arbitration node 11 on the first host IP1 is the leader distributed arbitration node, the third distributed arbitration node 13 on the first host IP1 is the main distributed arbitration node, and the third distributed arbitration node 13 on the second host IP2 is the standby distributed arbitration node; when the second distributed arbitration node 12 on the second host IP2 is the leader distributed arbitration node, the third distributed arbitration node 13 on the second host IP2 is the main distributed arbitration node, and the first distributed arbitration node 11 on the first host IP1 is the standby distributed arbitration node. This mechanism does not guarantee that the main distributed arbitration node is as exclusive as possible with the leader distributed arbitration node, that is, on the same host. Although it cannot reduce the impact of a single machine failure on distributed arbitration, it is theoretically feasible, so it can be flexibly selected according to specific application requirements.
[0044] In some examples of this embodiment, in order to solve the problem of brain split in dual-machine arbitration, a hardware arbitration device 2 can be set for the dual-machine distributed arbitration system, see Figure 4As shown. When the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 of the hardware arbitration device 2 are both main distributed arbitration nodes, the hardware arbitration device 2 can arbitrate one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 as the main distributed arbitration node, and the other as the standby distributed arbitration node as the standard arbitration result, and send the standard arbitration result to the first host IP1 and the second host IP2 respectively, thereby solving the brain split problem existing in the dual-machine arbitration. In this example, the hardware arbitration device 2 is respectively connected to the first host IP1 and the second host IP2 for communication. In this embodiment, the hardware arbitration device 2 can be respectively connected to the first host IP1 and the second host IP2 for communication using, but not limited to, a serial port, a network cable, a communication bus or an Ethernet. The communication connection is simple and reliable, and has good versatility and low cost. The hardware arbitration device 2 in this embodiment is used to receive the first arbitration result sent by the first host IP1 and the arbitration result sent by the second host IP2 respectively. When the first arbitration result is that the third distributed arbitration node 13 on the first host IP1 is the main distributed arbitration node, and the second arbitration result is that the third distributed arbitration node 13 on the second host IP2 is also the main distributed arbitration node, the hardware arbitration device 2 arbitrates one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 as the main distributed arbitration node and the other as the standby distributed arbitration node as the standard arbitration result, and sends the standard arbitration result to the first host IP1 and the second host IP2 respectively. For example, the hardware arbitration device 2 arbitrates the third distributed arbitration node 13 on the first host IP1 as the main distributed arbitration node and the third distributed arbitration node 13 on the second host IP2 as the standby distributed arbitration node, and notifies the first host IP1 and the second host IP2 respectively, and the second host IP2 switches the third distributed arbitration node 13 on it from the main distributed arbitration node to the standby distributed arbitration node, thereby solving the brain split problem existing in the dual-machine arbitration.
[0045] In some application scenarios, when there is a communication anomaly between the first host IP1 and the second host IP2, which may cause the first arbitration result sent by the first host IP1 to be that the third distributed arbitration node 13 on the first host IP1 is a standby distributed arbitration node, and the second arbitration result on the second host IP2 is that the third distributed arbitration node 13 on the second host IP2 is a standby distributed arbitration node, the hardware arbitration device 2 may also arbitrate one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 as a main distributed arbitration node and the other as a standby distributed arbitration node as a standard arbitration result, and send the standard arbitration result to the first host IP1 and the second host IP2 respectively. For example, the hardware arbitration device 2 arbitrates the third distributed arbitration node 13 on the first host IP1 as a standby distributed arbitration node, and the third distributed arbitration node 13 on the second host IP2 as a main distributed arbitration node, and notifies the first host IP1 and the second host IP2 respectively, and the second host IP2 switches the third distributed arbitration node 13 on it from a standby distributed arbitration node to a main distributed arbitration node. Of course, in some application scenarios, if the above situation does not occur, this function of the hardware arbitration device 2 can be omitted.
[0046] In some application scenarios, the hardware arbitration device 2 includes an arbitration microcontroller or an arbitration circuit, that is, the hardware arbitration device 2 can adopt but is not limited to various microcontrollers or circuits that are simple to implement, low-cost and can realize the arbitration function, and has good versatility. Of course, the arbitration microcontroller or arbitration circuit in this embodiment can also be replaced with other chips or devices that can realize the arbitration function, which will not be repeated here. In this application scenario, the dual-machine arbitration mechanism adopted by the first host IP1 and the second host IP2 can be keepalive (it should be understood that keepalive can also be equivalently replaced with other dual-machine arbitration mechanisms, which will not be repeated here), for example, see Figures 1 to 4As shown. In this application scenario, when the first host IP1 and the second host IP2 communicate normally, they can choose to arbitrate by themselves, and send the arbitration result (that is, the first arbitration result and the second arbitration result) to the hardware arbitration device 2. For example, if the first arbitration result is that the third distributed arbitration node 13 in the first host IP1 is a master-distributed arbitration node, then keepalive1 and the hardware arbitration device 2 exchange arbitration applications for the master, and if the second arbitration result is that the third distributed arbitration node 13 in the second host IP2 is a backup-distributed arbitration node, then keepalive2 and the hardware arbitration device 2 exchange arbitration applications for the backup. In the case of abnormal communication between the first host IP1 and the second host IP2, the first host IP1 and the second host IP2 shall be based on the arbitration result of the hardware arbitration device 2 (that is, the standard arbitration result). For example, the third distributed arbitration node 13 in the first host IP1 and the second host IP2 both consider themselves to be the primary distributed arbitration node, but the hardware arbitration device 2 arbitrates the third distributed arbitration node 13 in the first host IP1 as the primary distributed arbitration node and the third distributed arbitration node 13 in the second host IP2 as the backup distributed arbitration node. Then, the third distributed arbitration node 13 of the second host IP2 needs to be switched to the backup distributed arbitration node (that is, keepalive2 is downgraded to backup).
[0047] In some examples of this embodiment, the first host IP1 periodically sends a master node application request to the hardware arbitration device 2 when the third distributed arbitration node 13 deployed by itself is arbitrated as a standby distributed arbitration node; the second host IP2 is also used to periodically send a master node application request to the hardware arbitration device 2 when the third distributed arbitration node 13 deployed by itself is arbitrated as a standby distributed arbitration node; the hardware arbitration device 2 is also used to receive the master node application request and send a master node application request response message to the first host IP1 or the second host IP2 that sent the master node application request. In this way, the standby distributed arbitration node periodically finds the hardware arbitration device 2 for arbitration application as the master, and if the application is successful, it is promoted to the master distributed arbitration node.
[0048] This embodiment also provides an arbitration method for a dual-machine distributed arbitration system as shown in the above examples, wherein the third distributed arbitration node 13 uses a virtual IP to dynamically migrate on the first host IP1 and the second host IP2, including: based on the first distributed arbitration node 11 and the independent second distributed arbitration node 12, a dual-machine reliable mechanism is used to arbitrate one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 as the main distributed arbitration node, and the other as the standby distributed arbitration node, and the main distributed arbitration node seizes the virtual IP for external services. Thus, the application of the distributed arbitration mechanism is realized on the first host IP1 and the second host IP2, and there is no need to deploy a third host separately, so the cost can be reduced by at least one third, and it can be applied to dual-host scenarios, with better versatility. For example, a dual-machine reliability mechanism used in an application scenario includes: when the first distributed arbitration node 11 on the first host IP1 is the leader distributed arbitration node, the third distributed arbitration node 13 on the first host IP1 is the main distributed arbitration node, and the third distributed arbitration node 13 on the second host IP2 is the standby distributed arbitration node; when the second distributed arbitration node 12 on the second host IP2 is the leader distributed arbitration node, the third distributed arbitration node 13 on the second host IP2 is the main distributed arbitration node, and the first distributed arbitration node 11 on the first host IP1 is the standby distributed arbitration node. Through the above dual-machine reliability mechanism, it is ensured that the main distributed arbitration node is as exclusive as possible with the leader distributed arbitration node, that is, not on the same host, so as to minimize the impact of single-machine failure on distributed arbitration and improve reliability. It should be understood that the determination / arbitration of the leader distributed arbitration node in this embodiment can adopt but is not limited to the existing various leader distributed arbitration node determination / arbitration mechanisms, which will not be repeated here.
[0049] In some examples of this embodiment, the arbitration method of the dual-machine distributed arbitration system further includes: the hardware arbitration device 2 receives the first arbitration result sent by the first host IP1 and the arbitration result sent by the second host IP2 respectively; the hardware arbitration device 2 is the third distributed arbitration node 13 on the first host IP1 as the main distributed arbitration node, and the second arbitration result is the third distributed arbitration node 13 on the second host IP2 as the main distributed arbitration node; or when the first arbitration result is the third distributed arbitration node 13 on the first host IP1 as the standby distributed arbitration node, and the second arbitration result is the third distributed arbitration node 13 on the second host IP2 as the standby distributed arbitration node, one of the third distributed arbitration nodes 13 on the first host IP1 and the second host IP2 is the main distributed arbitration node and the other is the standby distributed arbitration node as the standard arbitration result, and the standard arbitration result is sent to the first host IP1 and the second host IP2 respectively. Thus, the brain split problem existing in dual-machine arbitration can be solved.
[0050] This embodiment also provides a communication device, which can be a first host or a second host. The communication device in this embodiment can be, but is not limited to, an edge computing device, or can be other types of servers or computers, which include a processor, a memory, and a communication bus, wherein: the communication bus is used to realize the connection and communication between the processor and the memory; the processor is used to execute one or more computer programs stored in the memory to execute at least one step in the arbitration method of the above-mentioned dual-machine distributed arbitration system.
[0051] The present embodiment also provides a computer-readable storage medium, which includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.
[0052] The computer-readable storage medium in this embodiment can be used to store one or more computer programs, and the one or more computer programs stored therein can be executed by a processor to perform at least one step in the arbitration method of the dual-machine distributed arbitration system described above.
[0053] It can be seen that those skilled in the art should understand that all or some of the steps, systems, and functional modules / units in the above disclosed methods can be implemented as software (which can be implemented with computer program code executable by a computing device), firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component can have multiple functions, or a function or step can be performed by several physical components in cooperation. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit.
[0054] In addition, it is well known to those skilled in the art that communication media generally contain computer readable instructions, data structures, computer program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery media. Therefore, the present invention is not limited to any specific hardware and software combination.
[0055] The above contents are further detailed descriptions of the embodiments of the present invention in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A dual-machine distributed arbitration system, characterized in that: include: A first host and a second host in communication connection; an independent first distributed arbitration node and an independent second distributed arbitration node respectively deployed on the first host and the second host; A third distributed arbitration node is deployed on the first host and the second host, and the third distributed arbitration node uses a virtual IP to dynamically migrate on the first host and the second host, including: based on the first distributed arbitration node and the second distributed arbitration node, a dual-machine reliable mechanism is used to arbitrate one of the third distributed arbitration nodes on the first host and the second host as a primary distributed arbitration node, and the other as a backup distributed arbitration node, and the primary distributed arbitration node preempts the virtual IP to provide external services; The dual-machine reliability mechanism includes: when the first distributed arbitration node on the first host is a leader distributed arbitration node, the third distributed arbitration node on the first host is a standby distributed arbitration node, and the third distributed arbitration node on the second host is a master distributed arbitration node; when the second distributed arbitration node on the second host is a leader distributed arbitration node, the third distributed arbitration node on the second host is a standby distributed arbitration node, and the first distributed arbitration node on the first host is a master distributed arbitration node; The dual-machine distributed arbitration system further includes a hardware arbitration device, which is respectively connected to the first host and the second host for communication; the hardware arbitration device is used to respectively receive a first arbitration result sent by the first host and a second arbitration result sent by the second host; The hardware arbitration device is further configured to, when the first arbitration result is that the third distributed arbitration node on the first host is the primary distributed arbitration node and the second arbitration result is that the third distributed arbitration node on the second host is the primary distributed arbitration node; or when the first arbitration result is that the third distributed arbitration node on the first host is the backup distributed arbitration node and the second arbitration result is that the third distributed arbitration node on the second host is the backup distributed arbitration node, arbitrate one of the third distributed arbitration nodes on the first host and the second host as the primary distributed arbitration node and the other as the backup distributed arbitration node as a standard arbitration result, and send the standard arbitration results to the first host and the second host respectively.
2. The dual-machine distributed arbitration system according to claim 1, characterized in that: When the first host is also used for the third distributed arbitration node deployed by itself to arbitrate as a standby distributed arbitration node, periodically sending a master node application request to the hardware arbitration device; The second host is further configured to periodically send a master node application request to the hardware arbitration device when the third distributed arbitration node deployed by itself is arbitrated as a standby distributed arbitration node; The hardware arbitration device is further configured to receive the master node application request, and send a master node application request response message to the first host or the second host that sent the master node application request.
3. The dual-machine distributed arbitration system according to claim 1, characterized in that: The hardware arbitration device includes an arbitration single chip microcomputer or an arbitration circuit.
4. The dual-machine distributed arbitration system according to claim 1, characterized in that: The hardware arbitration device is respectively connected to the first host and the second host through a serial port, a network cable, a communication bus or an Ethernet.
5. An arbitration method for a dual-machine distributed arbitration system, characterized in that: The dual-machine distributed arbitration system includes a first host and a second host that are communicatively connected, an independent first distributed arbitration node and an independent second distributed arbitration node respectively deployed on the first host and the second host, and a third distributed arbitration node respectively deployed on the first host and the second host; The arbitration method includes dynamically migrating the third distributed arbitration node on the first host and the second host using a virtual IP; The third distributed arbitration node dynamically migrates on the first host and the second host using the virtual IP, including: Based on the first distributed arbitration node and the independent second distributed arbitration node, a dual-machine reliable mechanism is used to arbitrate that one of the third distributed arbitration nodes on the first host and the second host is a primary distributed arbitration node, and the other is a backup distributed arbitration node, and the primary distributed arbitration node preempts the virtual IP to provide external services; The dual-machine reliability mechanism includes: when the first distributed arbitration node on the first host is a leader distributed arbitration node, the third distributed arbitration node on the first host is a standby distributed arbitration node, and the third distributed arbitration node on the second host is a master distributed arbitration node; when the second distributed arbitration node on the second host is a leader distributed arbitration node, the third distributed arbitration node on the second host is a standby distributed arbitration node, and the first distributed arbitration node on the first host is a master distributed arbitration node; The dual-machine distributed arbitration system further includes a hardware arbitration device that is communicatively connected to the first host and the second host respectively; The arbitration method further comprises: The hardware arbitration device receives a first arbitration result sent by the first host and a second arbitration result sent by the second host respectively; when the first arbitration result is that the third distributed arbitration node on the first host is a primary distributed arbitration node and the second arbitration result is that the third distributed arbitration node on the second host is a primary distributed arbitration node; or when the first arbitration result is that the third distributed arbitration node on the first host is a backup distributed arbitration node and the second arbitration result is that the third distributed arbitration node on the second host is a backup distributed arbitration node, the hardware arbitration device arbitrates one of the third distributed arbitration nodes on the first host and the second host as a primary distributed arbitration node and the other as a backup distributed arbitration node as a standard arbitration result, and sends the standard arbitration results to the first host and the second host respectively.
Citation Information
Patent Citations
Method and equipment for arbitrating main node of distributed system
CN108111337A
Distributed system arbitration method and device
CN110442094A
