Server cluster election method and device, computer equipment and storage medium

By using arbitration devices to campaign operations in server clusters, the problem of low availability of traditional methods is solved, the reliability and processing capabilities of the system are improved, and fault tolerance and election accuracy and availability are enhanced.

CN119854308APending Publication Date: 2025-04-18DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411824452.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The election methods of traditional server clusters are low in availability, making it difficult to effectively improve the reliability and processing capabilities of the system.

Method used

By introducing an arbitration device into the server cluster, physical connection is made, the arbitration device obtains the campaign information sent by other arbitration devices, and conducts campaign operations based on this information to elect the main server.

Benefits of technology

Improves failure tolerance and election accuracy and availability of the server cluster, avoiding conflicts between other operations in the controller and election operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854308A_ABST
    Figure CN119854308A_ABST
Patent Text Reader

Abstract

The invention relates to a server cluster election method and device, computer equipment and a storage medium. The method comprises the following steps: in the election process of a server cluster, a controller in a slave server sends first election information to an arbitration device in the slave server; the controller is physically connected with the arbitration device; the arbitration device obtains second competitive selection information sent by other arbitration devices, and carries out competitive selection operation according to the second competitive selection information and the first competitive selection information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; and the arbitration device is physically connected with other arbitration devices. The election information is transmitted and the election operation is carried out through each physically connected arbitration device, the arbitration device is used for replacing a network or a disk, the fault tolerance of the server cluster can be greatly improved, the election operation is carried out in the arbitration device, the election operation does not conflict with other operations executed in the controller, and the election accuracy and availability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of server clusters, and in particular to a server cluster election method, apparatus, computer equipment and storage medium. Background Art

[0002] Using multiple controllers in a server cluster in a disk array can improve system reliability and processing power. When each controller is in normal service, multiple controllers work in load balancing mode, which can provide higher IO processing power. It is necessary to determine the master server from multiple servers through election so that the master server can manage multiple controllers in the server cluster.

[0003] In traditional technology, network messages are exchanged between controllers to synchronize the status of each controller and the status of backend storage resources, and comprehensive judgment and decision-making are made to elect the master server.

[0004] However, the traditional server cluster campaign method has low availability. Summary of the invention

[0005] Based on this, it is necessary to provide a server cluster election method, device, computer equipment and storage medium that can improve election availability in response to the above technical problems.

[0006] In a first aspect, the present application provides a server cluster election method, the method is applied to any slave server in the server cluster, the slave server includes a controller and an arbitration device, and the method includes:

[0007] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0008] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0009] In one embodiment, the method further comprises:

[0010] In the case that the master server elected through the election operation is the slave server, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information.

[0011] In one embodiment, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information, including:

[0012] Determine candidate key disks based on topology disk group information;

[0013] Read key information from candidate key disks, and determine a target key disk based on the key information.

[0014] In one embodiment, determining the target key disk according to the key information includes:

[0015] determining whether the key information indicates a candidate key disk, and obtaining a determination result;

[0016] If the determination result indicates that the key information indicates a candidate key disk, the candidate key disk is determined as a target key disk;

[0017] If the determination result indicates that the key information does not indicate a candidate key disk, all disks in the disk array are traversed, and a target key disk is determined based on the key information in each disk.

[0018] In one embodiment, determining the target key disk according to the key information in each disk includes:

[0019] The disk corresponding to the key information that meets the preset information conditions is used as the target key disk; the preset information conditions include that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0020] In one embodiment, after reading the key information from the candidate key disk, the method further includes:

[0021] Determine whether the number of disks that successfully read key information is greater than a preset threshold;

[0022] If the number of disks that successfully read the key information is greater than the preset threshold, the step of determining the target key disk according to the key information is executed;

[0023] If the number of disks that successfully read the key information is not greater than the preset threshold, the step of traversing all disks in the disk array and determining the target key disk according to the key information in each disk is performed.

[0024] In one embodiment, the method further comprises:

[0025] If the new master server is a slave server, the controller updates the key information according to the logical service corresponding to the server cluster.

[0026] In a second aspect, the present application also provides a server cluster election device, including:

[0027] The sending module is used to send the first election information from the controller in the slave server to the arbitration device in the slave server during the election process of the server cluster; the controller and the arbitration device are physically connected;

[0028] The election module is used for the arbitration device to obtain the second election information sent by other arbitration devices, and perform election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0031] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0033] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0034] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0035] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0036] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0037] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0038] The election method, device, computer equipment and storage medium of the server cluster described above, in the election process of the server cluster, the controller in the slave server sends the first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected; the arbitration device obtains the second election information sent by other arbitration devices, and performs election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device and other arbitration devices are physically connected. By transmitting election information and performing election operations through each physically connected arbitration device, and using the arbitration device instead of the network or disk, the fault tolerance of the server cluster can be greatly improved, and the election operation performed in the arbitration device does not conflict with other operations performed in the controller, thereby improving the accuracy and availability of the election. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 An application environment diagram of a server cluster election method in one embodiment;

[0041] Figure 2 A schematic diagram of a flow chart of a server cluster election method in one embodiment;

[0042] Figure 3 A schematic diagram of a flow chart of a server cluster election method in another embodiment;

[0043] Figure 4 A schematic diagram of a process for updating key information in an embodiment;

[0044] Figure 5 A schematic diagram of a flow chart of a server cluster election method in another embodiment;

[0045] Figure 6 A schematic diagram of a flow chart of a server cluster election method in another embodiment;

[0046] Figure 7 A schematic diagram of a flow chart of a server cluster election method in another embodiment;

[0047] Figure 8 A schematic diagram of a flow chart of a server cluster election method in another embodiment;

[0048] Fig. 9is a structural block diagram of a campaign device for a server cluster in one embodiment;

[0049] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] The server cluster election method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the arbitration device of any slave server 102 in the server cluster communicates with the arbitration devices in other servers 104 in the server cluster. The arbitration device obtains the second election information sent by the other arbitration devices, and performs election operations according to the second election information and the first election information.

[0052] In one embodiment, Figure 2 As shown, a server cluster election method is provided, which is applied to any slave server in the server cluster, and the slave server includes a controller and an arbitration device. Figure 1 The following is an example of a server in the example, including:

[0053] S201, during the election process of the server cluster, a controller in a slave server sends first election information to an arbitration device in a slave server; and a physical connection is established between the controller and the arbitration device.

[0054] The arbitration device may be a complex programmable logic device (CPLD), and the arbitration device executes the arbitration method only under the instruction of the controller. The arbitration method includes generating election information and performing election operations according to the election information of all servers.

[0055] In an embodiment of the present application, for each server in the server cluster, during the election process of the server cluster, a controller in the server generates first election information based on its own election attribute information, and sends the first election information to an arbitration device in the server.

[0056] Optionally, the election attribute information may include the number of elections, the number of times the election is made for the master node, and the performance information of the server, etc. The first election information may be generated based on the historical election information of the server cluster and / or the attribute file pre-stored in the server.

[0057] It should be noted that the controller in the server is physically connected to the arbitration device according to a preset line arrangement method.

[0058] S202, the arbitration device obtains second election information sent by other arbitration devices, and performs election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0059] In the embodiment of the present application, the arbitration devices of each server are physically connected through the mainboard frame, and the server physically transmits the first election information to the arbitration devices of other servers through the arbitration device, and receives the second election information sent by other servers through the physical connection. Further, voting is performed based on the first election information and the second election information to determine the main server. Optionally, the arbitration device can obtain the votes sent by other arbitration devices, determine the server with the highest number of votes based on all votes, and determine the server as the main server.

[0060] Optionally, all servers participating in the election in the server cluster are evaluated according to the first election information and the second election information to determine an evaluation value of each server, thereby determining the server with the highest evaluation value as the target server, and generating ballots based on the target server.

[0061] In the above-mentioned server cluster election method, during the server cluster election process, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected; the arbitration device obtains second election information sent by other arbitration devices, and performs election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device and other arbitration devices are physically connected. By transmitting election information and performing election operations through each physically connected arbitration device, and using the arbitration device instead of the network or disk, the fault tolerance of the server cluster can be greatly improved, and the election operation performed in the arbitration device does not conflict with other operations performed in the controller, thereby improving the accuracy and availability of the election.

[0062] In one embodiment, Figure 3 As shown, the election method of the server cluster also includes:

[0063] S203, when the master server elected through the election operation is the slave server, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information.

[0064] In the embodiment of the present application, when the logic service is started on the new master server, it needs to reload and update the key information it needs. The key information is maintained in the key disk by the old master server, and the master server needs to ensure the availability of the key information, that is, to ensure that the acquired data must be the latest updated data. If the elected master server is the above-mentioned slave server, the topology disk of the server itself is read, and the target key disk is determined based on the read topology disk group information. Optionally, the topology disk group information can be determined as key information, so as to determine the target key disk based on the key information.

[0065] S204: If the new master server is a slave server, the controller updates key information according to the logical service corresponding to the server cluster.

[0066] In the embodiment of the present application, if the old master server fails in the election, the old master server will exit the service queue of the server, and the logical services carried by the old master server will be reallocated to other servers in the server cluster by the new master server that is elected. Figure 4 As shown, the HA master is the main server in the server cluster, the system disk is the topology disk in the server, and the key disk group information is the key information in the embodiment of the present application. While providing logical services to users, the main server traverses all key disks, updates the key root information in the key disks, further updates the key disk group information that is written successfully, and updates the key disk group information in the system disk. Optional, such as Figure 4 As shown, when a new key disk is added, the key root information is stored in the new key disk.

[0067] In the above-mentioned application embodiment, when the above-mentioned slave server is the new master server, the target key disk is determined according to the topology disk group information, so that the server cluster can continue to provide logical services to users, reducing the probability of logical service interruptions and improving the accuracy of determining the target key disk; and according to the logical services corresponding to the server cluster, the key information is updated, further reducing the probability of logical service interruptions.

[0068] In one embodiment, an implementation of the above S203 is provided, such as Figure 5 As shown, the above “the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information” includes:

[0069] S301, determining a candidate key disk according to topology disk group information.

[0070] In an embodiment of the present application, the update time of each group of information in the topological disk group information is determined, the most recently updated topological disk group information is parsed, and the candidate key disk recorded in the topological disk is determined. Optionally, the topological disk group information can be encrypted data, and the topological disk group information is decrypted according to a preset decryption algorithm to obtain the decrypted topological disk group information, and further, the decrypted topological disk group information is feature extracted to determine the candidate key disk recorded in the topological disk.

[0071] S302, reading key information from candidate key disks, and determining a target key disk according to the key information.

[0072] In the embodiment of the present application, all candidate key disks are determined in the disk array, and all candidate key disks are accessed to read key information in the candidate key disks, and whether the candidate key disk is the target key disk is determined based on the key information in the candidate key disks.

[0073] As an optional implementation, the update time of each candidate key disk can be determined based on the key information in the candidate key disk, and the number of candidate key disk update times that are the same as the update time of the topology disk group information is determined. If the number is greater than a preset threshold, the candidate key disk is determined to be the target key disk.

[0074] As another optional implementation, the key information in the candidate key disk may be compared with the topology disk group information. If the key information in the candidate key disk is the same as the topology disk group information, the candidate key disk is determined to be the target key disk.

[0075] In the above application embodiment, the topology disk group information is verified by reading the key information in the candidate key disk, thereby improving the accuracy of the key information and the target key disk and avoiding abnormal information writing due to an error in the target key disk.

[0076] In one embodiment, an implementation of the above S302 is provided, such as Figure 6 As shown, the above “determining the target key disk according to key information” includes:

[0077] S401, determining whether the key information indicates a candidate key disk, and obtaining a determination result.

[0078] In an embodiment of the present application, the key information in the candidate key disk is read, and the key information whose update time is closest to the current time among all the key information is determined, the determined key information is parsed, the disk indicated by the key information is determined, and it is determined whether the disk indicated by the key information is consistent with the candidate key disk. If they are consistent, the determination result indicates that the key information indicates the candidate key disk; if they are inconsistent, the determination result indicates that the key information does not indicate the candidate key disk.

[0079] S402: If the determination result indicates that the key information indicates a candidate key disk, S403 is executed; if the determination result indicates that the key information does not indicate a candidate key disk, S404 is executed.

[0080] S403: Determine the candidate key disk as the target key disk.

[0081] S404, traverse all disks in the disk array, and determine the target key disk according to the key information in each disk.

[0082] In the embodiment of the present application, if the determination result indicates that the key information indicates a candidate key disk, indicating that the topology disk group information is correct, the candidate key disk indicated by the topology disk group information is determined as the target key disk; if the determination result indicates that the key information does not indicate a candidate key disk, the topology disk group information is not updated in time, and / or the key information of the candidate key disk is not updated in time, then all disks in the disk array are traversed, the key information in all disks is read, and the target key disk is determined based on all the key information. Optionally, the key information with the largest number of consistent key information can be determined as the target key information, and the key disk indicated in the key information can be determined as the target key disk.

[0083] Optionally, the above-mentioned "determining the target key disk according to the key information in each disk" includes: taking the disk corresponding to the key information that meets the preset information conditions as the target key disk; the preset information conditions include that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0084] In an embodiment of the present application, the key information in each disk whose update time is closest to the current time is determined, and further, the key information with consistent content is divided into a group, the number of key information in each key information group is determined, and the key information corresponding to the key information group whose number is greater than a preset number threshold is determined as the target key information, that is, the key information corresponding to the key information group with the largest number is determined as the target key information, and further, the disk corresponding to the target key information is used as the target key disk.

[0085] In the above application embodiment, when the topology disk group information is verified successfully using the candidate key disk, the candidate key disk recorded in the topology disk group is determined as the target key disk. When the topology disk group information is not verified successfully using the candidate key disk, the target key disk is determined based on the key information of all disks, thereby improving the accuracy of determining the target key disk.

[0086] In one embodiment, Figure 7 As shown, after reading the key information from the candidate key disk, the server cluster election method further includes:

[0087] S303: Determine whether the number of disks that have successfully read key information is greater than a preset threshold.

[0088] In an embodiment of the present application, the preset threshold can be half of the number of candidate key disks, and the successful number of disks that successfully read the key information is determined. It is determined whether the successful number is greater than the preset threshold. If it is greater than the preset threshold, it indicates that the topological disk group information matches the target key disk and the topological disk group information is reliable. If it is not greater than the preset threshold, it indicates that the topological disk group information does not match the target key disk and the topological disk group information is unreliable.

[0089] S304: If the number of disks that successfully read key information is greater than a preset threshold, a step of determining a target key disk according to the key information is executed.

[0090] In an embodiment of the present application, if the number of disks that successfully read key information is greater than a preset threshold, the topology disk group information is reliable, and it is determined whether the key information indicates a candidate key disk, a determination result is obtained, and the target key disk is further determined based on the determination result.

[0091] S305, if the number of disks whose key information is successfully read is not greater than the preset threshold, a step of traversing all disks in the disk array and determining a target key disk according to the key information in each disk is performed.

[0092] In the embodiment of the present application, if the number of disks that successfully read the key information is not greater than the preset threshold and the topology disk group information is unreliable, all disks in the disk array are traversed to read the key information in all disks, and the target key disk is determined based on all the key information. Optionally, the key information with the largest number of consistent key information can be determined as the target key information, and the key disk indicated in the key information can be determined as the target key disk.

[0093] In the above application embodiment, when it is determined that the number of disks that successfully read the key information is not greater than the preset threshold, the step of determining whether the key information indicates a candidate key disk and obtaining a determination result is omitted, and all disks in the disk array are directly traversed, saving server processing resources.

[0094] In one embodiment, a complete server cluster election method is provided, such as Figure 8 As shown, the method includes:

[0095] S1, during the election process of the server cluster, a controller in a slave server sends first election information to an arbitration device in the slave server; a physical connection is established between the controller and the arbitration device.

[0096] S2, the arbitration device obtains the second election information sent by other arbitration devices, and performs election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0097] S3, when the primary server selected through the election operation is the secondary server, read the key information from the candidate key disk.

[0098] S4, determining a candidate key disk according to the topology disk group information.

[0099] S5, read key information from candidate key disks, and determine whether the number of disks that successfully read key information is greater than a preset threshold. If the number of disks that successfully read key information is greater than the preset threshold, execute S6; if the number of disks that successfully read key information is not greater than the preset threshold, execute S8.

[0100] S6, determining whether the key information indicates a candidate key disk, and obtaining a determination result; if the determination result indicates that the key information indicates a candidate key disk, executing S7; if the determination result indicates that the key information does not indicate a candidate key disk, executing S8.

[0101] S7, determining the candidate key disk as the target key disk.

[0102] S8, traverse all disks in the disk array, and use the disk corresponding to the key information that meets the preset information condition as the target key disk; the preset information condition includes that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0103] S9, if the new master server is a slave server, the controller updates the key information according to the logical service corresponding to the server cluster.

[0104] In the above-mentioned server cluster election method, during the server cluster election process, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected; the arbitration device obtains second election information sent by other arbitration devices, and performs election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device and other arbitration devices are physically connected. By transmitting election information and performing election operations through each physically connected arbitration device, and using the arbitration device instead of the network or disk, the fault tolerance of the server cluster can be greatly improved, and the election operation performed in the arbitration device does not conflict with other operations performed in the controller, thereby improving the accuracy and availability of the election.

[0105] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these 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 part of the steps or stages in other steps.

[0106] Based on the same inventive concept, the embodiment of the present application also provides a server cluster election device for implementing the server cluster election method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more server cluster election devices provided below can refer to the limitations of the server cluster election method above, and will not be repeated here.

[0107] In one embodiment, Fig. 9 As shown, a server cluster election device is provided, including: a sending module 10 and an election module 11, wherein:

[0108] The sending module 10 is used to send first election information from the controller in the server to the arbitration device in the slave server during the election process of the server cluster; the controller and the arbitration device are physically connected.

[0109] The election module 11 is used for the arbitration device to obtain the second election information sent by other arbitration devices, and perform election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to other arbitration devices.

[0110] In one embodiment, the server cluster election device further includes: a determination module, which is used for the controller to determine the target key disk from the disk array corresponding to the server cluster according to the topology disk group information when the master server elected through the election operation is the slave server.

[0111] In one embodiment, the above-mentioned determination module includes: a first determination unit and a second determination unit, wherein:

[0112] The first determining unit is configured to determine a candidate key disk according to the topology disk group information.

[0113] The second determining unit is used to read key information from the candidate key disks and determine the target key disk according to the key information.

[0114] In one embodiment, the above-mentioned second determination unit is specifically used to determine whether the key information indicates a candidate key disk and obtain a determination result; if the determination result indicates that the key information indicates a candidate key disk, the candidate key disk is determined as the target key disk; if the determination result indicates that the key information does not indicate a candidate key disk, all disks in the disk array are traversed, and the target key disk is determined according to the key information in each disk.

[0115] In one embodiment, the second determination unit is specifically configured to use a disk corresponding to key information that meets a preset information condition as a target key disk; the preset information condition includes that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0116] In one embodiment, the above-mentioned second determination unit is specifically used to determine whether the number of disks that successfully read key information is greater than a preset threshold; if the number of disks that successfully read key information is greater than the preset threshold, the step of determining the target key disk according to the key information is executed; if the number of disks that successfully read key information is not greater than the preset threshold, the step of traversing all disks in the disk array and determining the target key disk according to the key information in each disk is executed.

[0117] In one embodiment, the server cluster election device further includes: an update module, which is used for, if the new master server is a slave server, the controller updates the key information according to the logical service corresponding to the server cluster.

[0118] Each module in the election device of the server cluster can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0119] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the election data of the server cluster. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for the election of a server cluster is implemented.

[0120] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0121] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0122] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0123] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0124] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0125] In the case that the master server elected through the election operation is the slave server, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information.

[0126] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0127] Determine candidate key disks based on topology disk group information;

[0128] Read key information from candidate key disks, and determine a target key disk based on the key information.

[0129] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0130] determining whether the key information indicates a candidate key disk, and obtaining a determination result;

[0131] If the determination result indicates that the key information indicates a candidate key disk, the candidate key disk is determined as a target key disk;

[0132] If the determination result indicates that the key information does not indicate a candidate key disk, all disks in the disk array are traversed, and a target key disk is determined based on the key information in each disk.

[0133] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0134] The disk corresponding to the key information that meets the preset information conditions is used as the target key disk; the preset information conditions include that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0136] Determine whether the number of disks that successfully read key information is greater than a preset threshold;

[0137] If the number of disks that successfully read the key information is greater than the preset threshold, the step of determining the target key disk according to the key information is executed;

[0138] If the number of disks that successfully read the key information is not greater than the preset threshold, the step of traversing all disks in the disk array and determining the target key disk according to the key information in each disk is performed.

[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0140] If the new master server is a slave server, the controller updates the key information according to the logical service corresponding to the server cluster.

[0141] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0142] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0143] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0144] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0145] In the case that the master server elected through the election operation is the slave server, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information.

[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0147] Determine candidate key disks based on topology disk group information;

[0148] Read key information from candidate key disks, and determine a target key disk based on the key information.

[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0150] determining whether the key information indicates a candidate key disk, and obtaining a determination result;

[0151] If the determination result indicates that the key information indicates a candidate key disk, the candidate key disk is determined as a target key disk;

[0152] If the determination result indicates that the key information does not indicate a candidate key disk, all disks in the disk array are traversed, and a target key disk is determined based on the key information in each disk.

[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0154] The disk corresponding to the key information that meets the preset information conditions is used as the target key disk; the preset information conditions include that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0155] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0156] Determine whether the number of disks that successfully read key information is greater than a preset threshold;

[0157] If the number of disks that successfully read the key information is greater than the preset threshold, the step of determining the target key disk according to the key information is executed;

[0158] If the number of disks that successfully read the key information is not greater than the preset threshold, the step of traversing all disks in the disk array and determining the target key disk according to the key information in each disk is performed.

[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0160] If the new master server is a slave server, the controller updates the key information according to the logical service corresponding to the server cluster.

[0161] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0162] During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller and the arbitration device are physically connected;

[0163] The arbitration device obtains the second election information sent by other arbitration devices, and performs election operation according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

[0164] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0165] In the case that the master server elected through the election operation is the slave server, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information.

[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0167] Determine candidate key disks based on topology disk group information;

[0168] Read key information from candidate key disks, and determine a target key disk based on the key information.

[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0170] determining whether the key information indicates a candidate key disk, and obtaining a determination result;

[0171] If the determination result indicates that the key information indicates a candidate key disk, the candidate key disk is determined as a target key disk;

[0172] If the determination result indicates that the key information does not indicate a candidate key disk, all disks in the disk array are traversed, and a target key disk is determined based on the key information in each disk.

[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0174] The disk corresponding to the key information that meets the preset information conditions is used as the target key disk; the preset information conditions include that the key information is consistent, and the number of consistent key information is greater than a preset number threshold.

[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0176] Determine whether the number of disks that successfully read key information is greater than a preset threshold;

[0177] If the number of disks that successfully read the key information is greater than the preset threshold, the step of determining the target key disk according to the key information is executed;

[0178] If the number of disks that successfully read the key information is not greater than the preset threshold, the step of traversing all disks in the disk array and determining the target key disk according to the key information in each disk is performed.

[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0180] If the new master server is a slave server, the controller updates the key information according to the logical service corresponding to the server cluster.

[0181] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are 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 application.

[0183] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A server cluster election method, characterized in that: The method is applied to any slave server in the server cluster, wherein the slave server includes a controller and an arbitration device, and the method includes: During the election process of the server cluster, the controller in the slave server sends first election information to the arbitration device in the slave server; the controller is physically connected to the arbitration device; The arbitration device obtains second election information sent by other arbitration devices, and performs election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

2. The method according to claim 1, characterized in that The method further comprises: In the case that the master server elected through the election operation is the slave server, the controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information.

3. The method according to claim 2, characterized in that The controller determines the target key disk from the disk array corresponding to the server cluster according to the topology disk group information, including: Determine candidate key disks based on topology disk group information; Key information is read from the candidate key disks, and the target key disk is determined according to the key information.

4. The method according to claim 3, characterized in that The step of determining the target key disk according to the key information includes: Determine whether the key information indicates the candidate key disk, and obtain a determination result; If the determination result indicates that the key information indicates the candidate key disk, determining the candidate key disk as the target key disk; If the determination result indicates that the key information does not indicate the candidate key disk, all disks in the disk array are traversed, and the target key disk is determined according to the key information in each of the disks.

5. The method according to claim 4, characterized in that The step of determining the target key disk according to the key information in each of the disks includes: The disk corresponding to the key information that meets the preset information condition is used as the target key disk; the preset information condition includes that the key information is consistent, and the number of the consistent key information is greater than a preset number threshold.

6. The method according to claim 4, characterized in that After reading the key information from the candidate key disk, the method further includes: Determine whether the number of disks that successfully read the key information is greater than a preset threshold; If the disk whose key information is successfully read is greater than the preset threshold, the step of determining the target key disk according to the key information is performed; If the number of disks whose key information is successfully read is not greater than the preset threshold, the step of traversing all disks in the disk array and determining the target key disk according to the key information in each disk is performed.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: If the new master server is the slave server, the controller updates key information according to the logical service corresponding to the server cluster.

8. A server cluster election device, characterized in that: The device comprises: A sending module, used for sending first election information from a controller in a slave server to an arbitration device in the slave server during the election process of the server cluster; the controller is physically connected to the arbitration device; The election module is used for the arbitration device to obtain second election information sent by other arbitration devices, and perform election operations according to the second election information and the first election information; the other arbitration devices are arbitration devices in other slave servers in the server cluster; the arbitration device is physically connected to the other arbitration devices.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.