A Server Cluster Monitoring Method, Computing Device and Storage Medium

By monitoring the changes in cluster information of the server cluster, a new service interface is automatically built, which solves the data loss and business suspension caused by master node failure, and realizes rapid service recovery, improving system reliability and data backup efficiency.

CN114490258BActive Publication Date: 2025-07-25HAINAN CHEZHIYITONG INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210039311.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-13
Publication Date
2025-07-25
Estimated Expiration
2042-01-13

AI Technical Summary

Technical Problem

When the existing server cluster fails in the master node, data is not backed up to the slave node in time, resulting in data loss, and manual configuration is required after the master node changes, resulting in business suspension.

Method used

By monitoring the server to monitor the cluster information of the server cluster, compare the cluster information of different time nodes, determine whether the master node is faulty, and automatically build a new service interface in the event of a fault to ensure that the new master node can provide services quickly.

Benefits of technology

It shortens the time when the server cluster stops providing services, reduces the impact of primary node failure on business, and improves the reliability of the system and the timeliness of data backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490258B_ABST
    Figure CN114490258B_ABST
Patent Text Reader

Abstract

The present invention discloses a server cluster monitoring method, a computing device and a storage medium, and includes the steps of: obtaining and storing first cluster information of a server cluster, where the first cluster information includes first master node information; after a predetermined time, obtaining second cluster information of the server cluster, where the second cluster information includes second master node information, and comparing the second cluster information with the first cluster to determine whether the second master node information in the second cluster information is the same as the first master node information in the first cluster information; if the second master node information is different from the first master node information, then constructing a second service interface according to the second master node information, so that the second master node of the server cluster provides services to users according to the second service interface. The present invention can shorten the time when the server cluster stops providing services, quickly construct a service interface for the new master node to provide services, and reduce the impact of master node failures on the business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of server clusters, and particularly to a server cluster monitoring method, a computing device, and a storage medium. Background Art

[0002] With the development of cloud computing technology, container technology is used more and more widely. Many enterprises have started to use container technology to deploy applications to improve resource utilization and deployment efficiency. In order to better use container technology to provide services, more and more enterprises provide services externally by deploying server clusters. Existing server clusters usually include a master-slave architecture mode and multiple data nodes. When the master node in the server cluster fails to provide services, a slave node is selected from other slave nodes in the server cluster as the master node so that the server cluster can provide services normally.

[0003] However, in the prior art, when the old master node in the server cluster fails and the data generated during service provision is not backed up to the slave node in time, and the slave node becomes the master node, this part of the data will be lost. Moreover, when the master node changes, the new master node cannot automatically start providing services and requires manual reconfiguration; during the process of manual fault handling, the server cluster pauses to provide services, resulting in business suspension.

[0004] Therefore, a new server cluster monitoring method is needed. Summary of the Invention

[0005] Therefore, the present invention provides a server cluster monitoring method in an attempt to solve or at least alleviate the problems mentioned above.

[0006] According to one aspect of the present invention, there is provided a server cluster monitoring method suitable for execution in a monitoring server. The monitoring server monitors a server cluster, and the server cluster includes a master node and multiple slave nodes. The method includes the steps of: obtaining and storing first cluster information of the server cluster, where the first cluster information includes first master node information; after a predetermined time, obtaining second cluster information of the server cluster, where the second cluster information includes second master node information, and comparing the second cluster information with the first cluster to determine whether the second master node information in the second cluster information is the same as the first master node information in the first cluster information; if the second master node information is different from the first master node information, constructing a second service interface according to the second master node information so that the second master node of the server cluster provides services to users according to the second service interface.

[0007] Optionally, in the method according to the present invention, it further includes the step of: determining whether the first master node of the server cluster fails; if the first master node fails, canceling the first service interface constructed according to the first master node information.

[0008] Optionally, in the method according to the present invention, the server cluster provides services to users according to domain name information. Constructing a second service interface according to the second master node information includes the steps of: constructing a second service interface according to the IP address of the second master node, so that when a user sends a service request to the server cluster through domain name information, the server cluster calls the second service interface to determine the IP address of the second master node, and sends the service request to the second master node according to the IP address of the second master node.

[0009] Optionally, in the method according to the present invention, it further includes the step of storing the second cluster information to determine whether the server cluster has changed.

[0010] Optionally, in the method according to the present invention, the first cluster information further includes first slave node information, and the second cluster information further includes second slave node information. The method further includes the steps of: if the second master node information is the same as the first master node information, determining whether the second slave node information in the second cluster information is the same as the first slave node information in the first cluster information; if the second slave node information is different from the first slave node information, storing the second cluster information to determine whether the server cluster has changed.

[0011] Optionally, in the method according to the present invention, if the second slave node information is different from the first slave node information, storing the second cluster information includes the steps of: determining whether there are offline slave nodes according to the second slave node information and the first slave node information; if there are offline slave nodes, determining whether the offline slave nodes have failed; if the offline slave nodes have failed, storing the second cluster information.

[0012] Optionally, in the method according to the present invention, after receiving a service request, the master node in the server cluster is adapted to send the data in the service request to the slave nodes, so that the slave nodes send confirmation information and store the data. The master node is further adapted to store the data after receiving confirmation information from more than a predetermined number of slave nodes.

[0013] Optionally, in the method according to the present invention, the predetermined number is half of the number of slave nodes in the server cluster.

[0014] Optionally, in the method according to the present invention, when the first master node fails, one of the slave nodes in the server cluster serves as the master node.

[0015] According to another aspect of the present invention, there is provided a computing device, including: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include those for executing the server cluster monitoring method according to the present invention.

[0016] According to another aspect of the present invention, there is provided a computer-readable storage medium storing one or more programs, the one or more programs including instructions which, when executed by a computing device, cause the computing device to execute the server cluster monitoring method according to the present invention.

[0017] In the server cluster monitoring method of the present invention, the monitoring server monitors the cluster information of the server cluster, and determines whether the master node in the server cluster fails by comparing whether the cluster information at two different time nodes is the same. If the master node fails, a service interface is constructed for the new master node, so that the server cluster can provide services according to the service interface. The present invention can shorten the time when the server cluster stops providing services, quickly construct a service interface for the new master node to provide services, and reduce the impact of the failure of the master node on the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] To achieve the above and related purposes, certain illustrative aspects are described herein in connection with the following description and the accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalent aspects are intended to fall within the scope of the claimed subject matter. The above and other objects, features, and advantages of the present invention disclosed will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, like reference numerals generally refer to like parts or elements.

[0019] Figure 1 FIG. shows a schematic diagram of a monitoring server monitoring a server cluster according to an exemplary embodiment of the present invention;

[0020] Figure 2 FIG. shows a block diagram of the structure of a computing device 200 according to an exemplary embodiment of the present invention;

[0021] Figure 3 FIG. shows a schematic flowchart of a server cluster monitoring method 300 according to an exemplary embodiment of the present invention;

[0022] Figure 4 FIG. shows a schematic diagram of a monitoring server obtaining second cluster information according to an exemplary embodiment of the present invention;

[0023] Figure 5 FIG. shows a schematic diagram of a recovery time objective according to an exemplary embodiment of the present invention; and

[0024] Figure 6 FIG. shows a schematic diagram of a recovery point objective according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0025] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art. The same reference numerals generally refer to the same components or elements.

[0026] Figure 1 FIG. shows a schematic diagram of a monitoring server monitoring a server cluster according to an exemplary embodiment of the present invention. As Figure 1 shown, the monitoring server 120 monitors the server cluster 110. The server cluster 110 includes a master node 111 and slave nodes 112-117. In the server cluster 110, the master node 111 provides services to users through a service interface. The present invention does not limit the service type of the services provided by the server cluster.

[0027] Figure 1 Each node in the monitoring server 120 and the server cluster 110 can be implemented as a computing device. Figure 2 FIG. shows a block diagram of a computing device 200 according to an exemplary embodiment of the present invention. As Figure 2 shown, in a basic configuration 202, the computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 can be used for communication between the processor 204 and the system memory 206.

[0028] Depending on the desired configuration, the processor 204 can be any type of processing, including but not limited to: microprocessor (μP), microcontroller (μC), digital signal processor (DSP), or any combination thereof. The processor 204 can include one or more levels of cache such as a level 1 cache 210 and a level 2 cache 212, a processor core 214, and registers 216. An exemplary processor core 214 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An exemplary memory controller 218 can be used with the processor 204, or in some implementations, the memory controller 218 can be an internal part of the processor 204.

[0029] Depending on the desired configuration, system memory 206 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 can include an operating system 220, one or more programs 222, and program data 228. In some embodiments, program 222 can be arranged to execute instructions 223 of method 300 according to the present invention by one or more processors 204 on the operating system using program data 228.

[0030] Computing device 200 may also include a storage interface bus 234. Storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) via bus / interface controller 230 to basic configuration 202. At least a portion of operating system 220, program 222, and data 224 can be stored on removable storage 236 and / or non-removable storage 238, and when computing device 200 is powered on or program 222 is to be executed, it is loaded into system memory 206 via storage interface bus 234 and executed by one or more processors 204.

[0031] Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output device 242, peripheral interface 244, and communication device 246) to basic configuration 202 via bus / interface controller 230. Example output device 242 includes a graphics processing unit 248 and an audio processing unit 250. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 252. Example peripheral interface 244 can include a serial interface controller 254 and a parallel interface controller 256, which can be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I / O ports 258. Example communication device 246 can include a network controller 260, which can be arranged to communicate with one or more other computing devices 200 via one or more communication ports 264 through a network communication link.

[0032] A network communication link can be an example of a communication medium. A communication medium can generally embody computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can encode information in the signal. As a non-limiting example, a communication medium can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.

[0033] In the computing device 200 according to the present invention, the program 222 includes multiple program instructions of the server cluster monitoring method 300, and these program instructions can instruct the processor 204 to execute some steps in the server cluster monitoring method 300 running in the computing device 200 of the present invention, so that each part in the computing device 200 monitors the server cluster by executing the server cluster monitoring method 300 of the present invention.

[0034] The computing device 200 can be implemented as a server, such as a file server 240, a database 250, a server, an application server, etc. These electronic devices can be such as a personal digital assistant (PDA), a wireless network browsing device, an application-specific device, or a hybrid device that can include any of the above functions. It can be implemented as a personal computer including a desktop computer and a laptop computer configuration. Also, in some embodiments, the computing device 200 is configured to execute the server cluster monitoring method 300.

[0035] Figure 3 A flowchart of the server cluster monitoring method 300 according to an exemplary embodiment of the present invention is shown. The server cluster monitoring method 300 in the present invention is adapted to be executed in the monitoring server 120. First, step S310 is executed to obtain and store the first cluster information of the server cluster, and the first cluster information includes the first master node information and the first slave node information.

[0036] According to as Figure 1The schematic diagram of the current monitoring server monitoring the server cluster is shown. The monitoring server 120 monitors the server cluster 110, and the server cluster 110 includes a master node 111 and slave nodes 112 to 117. The first cluster information is the cluster information of the server cluster when the monitoring server obtains the first cluster information. The monitoring server can obtain the cluster information of the server cluster at any time. At this time, the cluster information of the server cluster is the first cluster information, its master node is the first master node, and the information of the first master node is the first master node information, including the IP address of the master node. The other nodes in the server node are slave nodes, and the information of these slave nodes is the first slave node information. The first slave node information includes the slave node information of multiple slave nodes in the server node. The slave node information of each slave node includes the IP address of the slave node.

[0037] According to an embodiment of the present invention, as Figure 1 shown, the cluster information of the server cluster 110 is the first cluster information, where the first master node is the master node 111. The first cluster information includes the first master node information and the first slave node information. The first master node information includes the IP address of the master node 111. The first slave node information includes the IP addresses of the slave nodes 112 to 117.

[0038] Subsequently, step S320 is executed. After a predetermined time, the second cluster information of the server cluster is obtained. The second cluster information includes the second master node information, and the second cluster information is compared with the first cluster to determine whether the second master node information of the second cluster information is the same as the first master node information of the first cluster information.

[0039] According to an embodiment of the present invention, after the monitoring server obtains the first node information, after a predetermined time, the second cluster information is obtained. The second cluster information is the cluster information of the server cluster when the monitoring server obtains the second cluster information. At this time, the cluster information of the server cluster is the second cluster information, its master node is the second master node, and the information of the second master node is the second master node information, including the IP address of the master node. The other nodes in the server node are slave nodes, and the information of these slave nodes is the second slave node information. The second slave node information includes the slave node information of multiple slave nodes in the server node. The slave node information of each slave node includes the IP address of the slave node. The present invention does not display the predetermined time, and the predetermined time can be set according to specific business needs, such as being set to 5 seconds.

[0040] If within the predetermined time, neither the master node nor the slave nodes in the server cluster have failed and the first cluster information is the same as the second cluster information, then the second cluster information is stored, and the training information of the server cluster is obtained again after the predetermined time, continuously monitoring the server cluster to determine whether there are any failed nodes in the server cluster.

[0041] According to one embodiment of the present invention, when the first master node fails, a slave node in the server cluster provides services as the master node. At this time, the new master node and other slave nodes constitute a new server cluster. The cluster information of this new server cluster is the second cluster information, wherein the new master node is the second master node, its node information is the second master node information, and the information of the remaining slave nodes is the second slave node information. The monitoring server obtains the second cluster information of the server cluster, and determines whether the second cluster information is the same as the first cluster information, so as to determine whether there is a node failure in the server cluster and exit the server cluster.

[0042] When the monitoring server determines whether the second cluster information is the same as the first cluster information, it first determines whether the second master node information in the second cluster information is the same as the first master node information in the first cluster information. If not, it determines that the first master node has a fault.

[0043] If the second master node information is the same as the first master node information, then determine whether the second slave node information in the second node information is the same as the first cluster node information in the first cluster information. If they are not the same, it can be determined that a new slave node has joined the server cluster, or the original slave node has failed and exited the server cluster.

[0044] Figure 4 A schematic diagram of a monitoring server acquiring second cluster information according to an exemplary embodiment of the present invention is shown. Within a predetermined time, a master node 111 in a server cluster 110 fails, and a slave node 112 becomes a master node 412, and forms a new server cluster 410 with other slave nodes 113 to 117. The cluster information of the server cluster 410 is the second cluster information, wherein the second master node is the master node 412. The second cluster information includes the second master node information and the second slave node information. The second master node information includes the IP address of the master node 412. The second slave node information includes the IP addresses of the slave nodes 113 to 117.

[0045] The monitoring server compares the second cluster information with the first cluster information, and first determines whether the second master node information is the same as the first master node information.

[0046] Figure 5 The figure shows a schematic diagram of the recovery time objective according to an exemplary embodiment of the present invention. The recovery time objective (RTO) refers to the time required for an information system to recover from a disaster state to an operational state, and is used to measure the business recovery capability of the disaster recovery system. Figure 5As shown, before time T0, the server cluster is running normally. A failure occurs at time T1, and the server cluster doesn't resume normal operation until time T2. The time period from T1 to T2 is the system interruption time, i.e., RTO. To minimize RTO, in the present invention, the server cluster is continuously monitored to obtain the cluster information of the server cluster, and the cluster information of two adjacent times is fully compared. When it is determined that the primary node fails, a service interface is constructed for the new primary node according to its primary node information so that it can quickly go online to provide services.

[0047] Subsequently, step S330 is executed. If the second primary node information is different from the first primary node information, a second service interface is constructed according to the second primary node information so that the second primary node of the server cluster can provide services to users according to the second service interface.

[0048] According to an embodiment of the present invention, when the IP address of the primary node 111 is changed to the IP address of the primary node 412, the monitoring server determines that the second primary node information is different from the first primary node information.

[0049] Before the monitoring server constructs a second server interface according to the second primary node information, it also determines whether the first primary node 111 of the server cluster fails. If the first primary node 111 fails, the first service interface constructed according to the first primary node information is deactivated.

[0050] The purpose of the monitoring server to determine whether the first primary node 111 fails is to check the first primary node 111 again to ensure that it is not a misoperation caused by network jitter and improve system reliability. According to an embodiment of the present invention, the probability of misoperation of the server cluster is 1%, and the probability of misjudgment of the monitoring server is 1%. Then the reliability of the system is 99.99%.

[0051] The server cluster provides services to users according to the domain name information. When a user needs the server cluster to provide services, the user needs to access the server cluster through the domain name information, and the domain name information includes the domain name of the server cluster. When constructing a second service interface according to the second primary node information, the second service interface is constructed according to the IP address of the second primary node so that when the user sends a service request to the server cluster through the domain name information, the server cluster calls the second service interface to determine the IP address of the second primary node and sends the service request to the second primary node according to the IP address of the second primary node.

[0052] According to an embodiment of the present invention, in the server cluster 110, the first master node is the master node 111, and a first service interface is constructed according to the first master node information, where the first master node information includes the IP address of the master node 111. When a user accesses the server cluster through domain name information, a service request is sent to the server cluster. The server cluster determines, according to the first service interface, that the master node for receiving and processing the service request is the first master node, and the first master node, that is, the master node 111, receives the service request through the first server interface and processes it. When the first master node fails and goes offline, the first service interface constructed according to the first master node information cannot be used continuously. Therefore, it is necessary to construct a second service interface.

[0053] In the server cluster 410, the second master node is the master node 412, and a second service interface is constructed according to the second master node information. When a user accesses the server cluster through domain name information, a service request is sent to the server cluster. The server cluster determines, according to the second service interface, that the master node for receiving and processing the service request is the second master node, and the second master node, that is, the master node 412, receives the service request through the second server interface and processes it.

[0054] According to an embodiment of the present invention, after the server cluster constructs the second service interface, the second cluster information is stored to facilitate subsequent determination of whether the server cluster has changed.

[0055] According to an embodiment of the present invention, if the second master node information is the same as the first master node information, it is determined whether the second slave node information of the second cluster information is the same as the first slave node information of the first cluster information. If the second slave node information is different from the first slave node information, the second cluster information is stored to facilitate determination of whether the server cluster has changed.

[0056] When it is determined that the second slave node information is different from the first slave node information, it is determined whether there is a slave node that has gone offline according to the second slave node information and the first slave node information. Specifically, it is determined whether there is an IP address that only appears in the first slave node information. If so, it is determined that the slave node to which the IP address belongs is the offline slave node.

[0057] Next, if there is an offline slave node, it is determined whether the offline slave node has failed, and the offline of the slave node is determined again to prevent misoperations caused by network jitter and improve system reliability. Finally, if the offline slave node has failed, the second cluster information is stored.

[0058] Figure 6A schematic diagram of a recovery point objective according to an exemplary embodiment of the present invention is shown. The recovery point objective (RPO) refers to the maximum amount of data loss allowed in a business system during a disaster and is used to measure the data redundancy backup ability of a disaster recovery system. As Figure 6 shown, before time T0, the data is valid. Time T0 is the last time when the data is valid, and the data has been backed up before time T0. A failure occurs at time T1 after time T0, resulting in data loss during the time period from T0 to T1 when the data was not backed up.

[0059] To minimize the RPO, in the present invention, the server cluster adopts a method of data backup confirmation. Specifically: the master node in the server cluster is adapted to send the data in the service request to the slave nodes after receiving the service request, so that the slave nodes send confirmation information and store the data. The master node is also adapted to store the data after receiving confirmation information from more than a predetermined number of slave nodes. Wherein, the predetermined number is half of the number of slave nodes in the server cluster.

[0060] To enable the slave nodes of the server to fully back up the data of the master node, the master node first allows the slave nodes to back up the data before storing and processing the data. After receiving the data and storing it, the slave nodes send confirmation information to the master node. After more than half of the slave nodes in the server cluster have backed up the data, the master node then stores and processes the data, thus ensuring that no data is lost when the master node fails.

[0061] In the server cluster monitoring method of the present invention, the monitoring server monitors the cluster information of the server cluster, and determines whether the master node in the server cluster fails by comparing whether the cluster information at two different time nodes is the same. If the master node fails, a service interface is constructed for the new master node, so that the server cluster provides services according to the service interface. The present invention can shorten the time when the server cluster stops providing services, quickly construct a service interface for the new master node to provide services, and reduce the impact of the failure of the master node on the business.

[0062] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies are not shown in detail so as not to obscure the understanding of this specification.

[0063] A9. The method according to A8, wherein when the first master node fails, one of the slave nodes in the server cluster serves as the master node to provide services.

[0064] Similarly, it should be understood that, for the purpose of streamlining the present disclosure and facilitating the understanding of one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0065] Those skilled in the art should understand that the modules or units or groups of devices in the examples disclosed herein may be arranged in the devices as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.

[0066] Those skilled in the art can understand that the modules in the devices of the embodiments can be adaptively changed and arranged in one or more devices different from this embodiment. The modules or units or groups in the embodiments can be combined into one module or unit or group, and in addition, they can be divided into multiple sub-modules or sub-units or sub-groups. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.

[0067] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments.

[0068] In addition, some of the embodiments are herein described as a combination of methods or method elements that can be implemented by a processor of a computer system or by other devices performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. In addition, the elements described herein in the device embodiments are examples of such devices: the device is used to implement the functions performed by the elements for the purpose of implementing the present invention.

[0069] The various techniques described herein can be implemented in hardware or software, or a combination thereof. Thus, the methods and apparatuses of the present invention, or certain aspects or portions of the methods and apparatuses of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a floppy disk, CD-ROM, hard disk drive, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.

[0070] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. Among them, the memory is configured to store the program code; the processor is configured to execute the multi-system operation method of the present invention according to the instructions in the program code stored in the memory.

[0071] By way of example and not limitation, computer-readable media include computer storage media and communication media. Computer-readable media include computer storage media and communication media. Computer storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and includes any information delivery medium. A combination of any of the above is also included within the scope of computer-readable media.

[0072] As used herein, unless otherwise specified, the use of ordinal numbers "first", "second", "third", etc. to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects so described must have a given order in time, space, ranking, or in any other manner.

[0073] Although the present invention has been described in terms of a limited number of embodiments, those skilled in the art of the present technology will appreciate that other embodiments can be envisioned within the scope of the present invention as thus described. In addition, it should be noted that the language used in this specification has been principally selected for readability and instructional purposes and not for the purpose of explaining or limiting the subject matter of the present invention. Thus, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. For the scope of the present invention, the disclosure of the present invention is illustrative, not restrictive, and the scope of the present invention is defined by the appended claims.

Claims

1. A server cluster monitoring method, which is suitable for execution in a monitoring server. The monitoring server monitors a server cluster, and the server cluster includes a master node and multiple slave nodes. The method includes the steps of: Obtaining and storing first cluster information of the server cluster, where the first cluster information includes first master node information; After a predetermined time, obtaining second cluster information of the server cluster, where the second cluster information includes second master node information, and comparing the second cluster information with the first cluster information to determine whether the second master node information in the second cluster information is the same as the first master node information in the first cluster information; If the second master node information is different from the first master node information, determining whether the first master node of the server cluster has failed to rule out misoperations caused by network jitter; If the first master node fails, canceling the first service interface constructed according to the first master node information; Constructing a second service interface according to the second master node information, so that the second master node of the server cluster provides services to users according to the second service interface; Wherein, the first cluster information further includes first slave node information, and the second cluster information further includes second slave node information. The method further includes the steps of: If the second master node information is the same as the first master node information, determining whether the second slave node information in the second cluster information is the same as the first slave node information in the first cluster information; If the second slave node information is different from the first slave node information, storing the second cluster information to determine whether the server cluster has changed; The step of storing the second cluster information if the second slave node information is different from the first slave node information includes the steps of: Determining whether there are any offline slave nodes according to the second slave node information and the first slave node information; If there are offline slave nodes, determining whether the offline slave nodes have failed to prevent misoperations caused by network jitter; If the offline slave nodes have failed, storing the second cluster information; In the server cluster, the master node is suitable for sending the data in the service request to the slave nodes after receiving the service request, so that the slave nodes send confirmation information and store the data. The master node is also suitable for storing the data after receiving confirmation information from more than a predetermined number of slave nodes to determine the effective last time of the data when the master node fails.

2. The method according to claim 1, wherein, The server cluster provides services according to domain name information. The step of constructing the second service interface according to the second master node information includes: Constructing a second service interface according to the IP address of the second master node, so that when a user sends a service request to the server cluster through the domain name information, the server cluster calls the second service interface to determine the IP address of the second master node, and sends the service request to the second master node according to the IP address of the second master node.

3. The method according to claim 1 or 2, wherein The method further includes the steps of: Store the second cluster information to determine whether the server cluster has changed.

4. The method according to claim 1, wherein The predetermined number is half of the number of slave nodes in the server cluster.

5. The method according to claim 4, wherein, When the first master node fails, a slave node in the server cluster serves as the master node.

6. A computing device, comprising: One or more processors; A memory; And One or more means, the one or more means including instructions for performing the method according to any one of claims 1-5.

7. A computer-readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Data storage method and a server applied to distributed server cluster

    CN107295080A

  • Master-slave switching method and device for database cluster nodes, equipment and medium

    CN111200532A