Fault cluster switching method and device, computer equipment and storage medium

By automatically selecting a target cluster and replacing the address when an HBase cluster fails, the problem of high manual dependence in existing technologies is solved, achieving seamless cluster switching and improving the user experience.

CN119025324APending Publication Date: 2024-11-26BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411251959.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing HBase cluster failover methods rely heavily on manual intervention and cannot achieve transparency and seamless operation, resulting in a reduced user experience.

Method used

This paper provides a fault cluster switching method. When the HBase primary cluster is abnormal, the target cluster is selected from the backup cluster group, the access path is obtained and the primary cluster address is automatically replaced. The automatic identification layer of the microservice framework is used to achieve seamless cluster switching.

Benefits of technology

It enables automatic and seamless cluster failover when the HBase primary cluster fails, reducing reliance on manual intervention and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025324A_ABST
    Figure CN119025324A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a fault cluster switching method and device, computer equipment and a storage medium. The method comprises the steps that when it is monitored that an hbase main cluster is abnormal, a target cluster is selected from a standby cluster group corresponding to the hbase main cluster; obtaining an access path of an hbase main cluster address and an address of a target cluster; according to the access path, replacing an hbase main cluster address stored in the first zookeeper cluster with an address of a target cluster; according to the embodiment, under the condition that an hbase main cluster is abnormal, firstly, an access path of an hbase main cluster address is set, and the hbase main cluster address is hidden in a first zookeeper cluster; then, replacement of the target cluster address and the hbase main cluster address is achieved in an automatic mode; the two operations are both completed under the condition that the user does not perceive, dependence on manpower in the fault cluster switching process is avoided, and the experience feeling of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, computer equipment, and storage medium for switching a fault cluster. Background Art

[0002] The finance, Internet, and communications industries all use HBase clusters as the basic database components for real-time (second-level or less response requirements) request services to handle a large number of highly concurrent real-time requests. Therefore, the response measures for HBase cluster failures are crucial.

[0003] In the current HBase real-time disaster recovery system, when the HBase cluster fails as a whole or the HBase cluster needs to be operated and maintained as a whole, the application client switches the external access traffic to the cluster to the disaster recovery cluster by restarting or manually switching the cluster configuration.

[0004] Although the above method can deal with the failure of the HBase cluster, it is highly dependent on manual work and cannot be transparent and imperceptible to the client, thus reducing the user experience. Summary of the invention

[0005] In order to solve the above technical problems, the present disclosure provides a method, an apparatus, a computer device and a storage medium for switching a fault cluster.

[0006] In a first aspect, the present invention provides a method for switching a fault cluster, the method is applied to an HBase disaster recovery system integrated with a microservice framework, the HBase disaster recovery system includes a first ZooKeeper cluster corresponding to the microservice, an HBase main cluster, at least one HBase backup cluster, and a second ZooKeeper cluster corresponding to each of the HBase main cluster and the at least one HBase backup cluster, the method includes:

[0007] When an abnormality of the HBase main cluster is monitored, a target cluster is selected from the standby cluster group corresponding to the HBase main cluster, where the standby cluster group consists of at least one HBase standby cluster; the access path of the HBase main cluster address and the address of the target cluster are obtained; and according to the access path, the HBase main cluster address stored in the first Zookeeper cluster is replaced with the address of the target cluster.

[0008] In some optional embodiments, the method further comprises:

[0009] Monitor the online status of the HBase master cluster and the online status of the HBase standby cluster; adjust the correspondence between the master and standby clusters according to the online status of the HBase master cluster and the online status of the HBase standby cluster; update the standby cluster group according to the adjusted correspondence.

[0010] In some optional implementations, selecting a target cluster from a standby cluster group corresponding to an HBase master cluster includes:

[0011] Obtain the synchronization delay status of each HBase standby cluster in the standby cluster group; determine the HBase standby cluster whose synchronization delay status is synchronization as a candidate cluster; when there is one candidate cluster, determine the candidate cluster as the target cluster.

[0012] In some optional implementations, when there are multiple candidate clusters, after determining the HBase standby cluster whose synchronization delay state is synchronization as the candidate cluster, the method further includes:

[0013] The performance level of each candidate cluster is obtained; and the candidate cluster with the highest performance level is determined as the target cluster.

[0014] In some optional implementations, after replacing the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path, the method further includes:

[0015] When receiving a data processing instruction, a connection is established with the target cluster; the data processing instruction is sent to the target cluster; the processing result fed back by the target cluster based on the data processing instruction is received, and the processing result is sent to the client.

[0016] In some optional implementations, after replacing the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path, the method further includes:

[0017] When the hbase main cluster is monitored to be online, the data in the target cluster is synchronized to the hbase main cluster; according to the access path, the address of the target cluster stored in the first zookeeper cluster is replaced with the hbase main cluster address.

[0018] In a second aspect, the present invention provides a switching device for a fault cluster, the device comprising:

[0019] The selection module is used to select a target cluster from the standby cluster group corresponding to the hbase main cluster when an abnormality of the hbase main cluster is monitored. The standby cluster group consists of at least one hbase standby cluster; the acquisition module is used to obtain the access path of the hbase main cluster address and the address of the target cluster; the first replacement module is used to replace the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path.

[0020] In a third aspect, the present invention provides a computer device, comprising:

[0021] The memory and the processor are communicatively connected with each other, the memory stores computer instructions, and the processor executes the fault cluster switching method of the first aspect of the invention and any embodiment thereof by executing the computer instructions.

[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for switching a fault cluster of the first aspect of the invention and any one of its embodiments.

[0023] In a fifth aspect, the present invention provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the computer program implements the steps of the method for switching a fault cluster of the first aspect of the invention and any embodiment thereof.

[0024] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0025] The switching method of the fault cluster provided in this embodiment selects a target cluster from the standby cluster group corresponding to the hbase main cluster when an abnormality of the hbase main cluster is monitored; obtains the access path of the hbase main cluster address and the address of the target cluster; replaces the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path; in the case of an abnormality of the hbase main cluster, this embodiment first hides the hbase main cluster address in the first zookeeper cluster by setting the access path of the hbase main cluster address; then replaces the target cluster address with the hbase main cluster address in an automatic manner; the above two operations are completed without the user's perception, avoiding the reliance on manual labor during the fault cluster switching process and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 A schematic diagram of a flow chart of a method for switching a fault cluster provided in an embodiment of the present invention;

[0029] Figure 2 A schematic diagram of a process for updating a standby cluster group provided in an embodiment of the present invention;

[0030] Figure 3 A schematic diagram of a process for determining a target cluster provided by an embodiment of the present invention;

[0031] Figure 4 A structural connection diagram of a switching device for a fault cluster provided by an embodiment of the present invention;

[0032] Figure 5 A structural connection diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0034] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0035] Currently, the financial, Internet, and communications industries all use the HBase cluster in the HBase disaster recovery system as the basic database component for real-time (response requirements in seconds or less) request services to handle a large number of highly concurrent real-time requests. During the access process, there may be node failures within the HBase cluster and overall failures of the HBase cluster. If the node failures within the HBase cluster, the HBase cluster can heal itself within a certain period of time. If the HBase cluster fails as a whole, the external access traffic to the cluster can only be switched to the HBase backup cluster by restarting or manually switching the cluster configuration. However, the manual switching method is highly dependent on manual labor, and cannot be transparent and imperceptible to the client, which can easily reduce the user experience.

[0036] To overcome the above problems, the present invention provides a method for switching a fault cluster. Before describing the method in detail, an HBase disaster recovery system integrated with a microservice framework to which the method is applied is first described in detail.

[0037] The HBase disaster recovery system integrated with the microservice framework includes the microservice framework and the HBase disaster recovery system. The microservice framework includes a first Zookeeper cluster corresponding to the microservice, and the HBase disaster recovery system includes an HBase main cluster, at least one HBase backup cluster, and a second Zookeeper cluster corresponding to each of the HBase main cluster and the at least one HBase backup cluster. In addition, the microservice framework also includes an automatic identification layer, which has the function of automatically identifying the accessible cluster status, and also has the function of initializing the first Zookeeper cluster address and access path exposed to the outside.

[0038] The first zookeeper cluster corresponding to the microservice can be a zookeeper cluster corresponding to the microservice alone, or a shared zookeeper cluster. The hbase master cluster is the cluster responsible for main business processing and data storage. The hbase backup cluster is the cluster responsible for data backup and disaster recovery of the master cluster. The second zookeeper cluster is the cluster that is responsible for configuration and management services for its corresponding cluster.

[0039] After the microservice framework is deployed and before the microservice is started, an address is configured for each second zookeeper cluster, and the address list of the second zookeeper cluster is stored in the first zookeeper cluster.

[0040] After the microservice is started, the automatic identification layer in the microservice framework is used to initialize the access path of the address of the first zookeeper cluster and the address of the hbase main cluster. The address of the hbase main cluster is stored in a node in the first zookeeper cluster that is used for service discovery or specifically used to store the address of the hbase main cluster, and the access path is the path corresponding to the node.

[0041] It should also be noted that the HBase disaster recovery system integrated with the microservice framework only exposes the address of the first Zookeeper cluster and the access path of the HBase main cluster address. Users can access the address list of the second Zookeeper cluster stored in the first Zookeeper cluster through the address of the first Zookeeper cluster, and establish a connection with each second Zookeeper cluster through the address in the address list. Users can also find the HBase main cluster address through the access path of the HBase main cluster address, and establish a connection with the HBase main cluster according to the HBase main cluster address.

[0042] Figure 1 is a flow chart of a method for switching a fault cluster according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0043] S101, when an abnormality of the HBase primary cluster is detected, a target cluster is selected from the backup cluster group corresponding to the HBase primary cluster.

[0044] Among them, the standby cluster group is composed of at least one hbase standby cluster. The standby cluster group is obtained according to the corresponding relationship between the main and standby clusters and stored in the first zookeeper cluster corresponding to the microservice. The standby cluster group is generated in the following way: after the microservice is started, it enters the hbase main cluster through the access path configuration, and uses the automatic identification function of the automatic identification layer to automatically scan all hbase standby clusters related to it starting from the hbase main cluster. If the hbase standby cluster also has a standby cluster, recursive scanning is performed until all hbase standby cluster information related to the hbase main cluster is obtained. According to the results of the automatic scanning, the corresponding relationship between the main and standby clusters is constructed, and the standby cluster group is composed of all hbase standby clusters corresponding to the hbase main cluster in the corresponding relationship.

[0045] Specifically, when the second zookeeper cluster corresponding to the hbase main cluster monitors that the hbase main cluster is abnormal, a standby cluster is selected from the standby cluster group corresponding to the hbase main cluster as the cluster that takes over the hbase main cluster business, that is, the target cluster. The second zookeeper cluster monitors whether the hbase main cluster is abnormal in a manner including but not limited to monitoring through monitoring tools and heartbeat monitoring. The method of selecting the target cluster from the standby cluster group includes but is not limited to random selection and selection based on the performance indicators of the standby cluster. The hbase main cluster abnormality can be understood as the hbase main cluster being offline. It should also be noted that S101 is an operation performed after the microservice is started, and this embodiment defaults to the fact that the disaster recovery switching capability is turned on after the microservice is started.

[0046] S102, obtaining the access path of the HBase main cluster address and the address of the target cluster.

[0047] Specifically, the access path exposed to the client and the address of the target cluster are obtained. The address of the target cluster can be obtained from the second zookeeper cluster corresponding to the target cluster, and the address of the target cluster can be the host name and port number of the Master node in the target cluster.

[0048] S103: According to the access path, the hbase main cluster address stored in the first zookeeper cluster is replaced with the address of the target cluster.

[0049] Specifically, according to the access path, the storage location of the hbase main cluster address is found, and the hbase main cluster address stored in the location is replaced with the address of the target cluster, so that the user can directly access the target cluster.

[0050] In one example, after S103, the method further includes: when monitoring that the hbase main cluster is online, synchronizing the data in the target cluster to the hbase main cluster; and replacing the address of the target cluster stored in the first zookeeper cluster with the hbase main cluster address according to the access path.

[0051] The switching method of the fault cluster provided in this embodiment selects a target cluster from the standby cluster group corresponding to the hbase main cluster when an abnormality of the hbase main cluster is monitored; obtains the access path of the hbase main cluster address and the address of the target cluster; replaces the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path; in the case of an abnormality of the hbase main cluster, this embodiment first hides the hbase main cluster address in the first zookeeper cluster by setting the access path of the hbase main cluster address; then replaces the target cluster address with the hbase main cluster address in an automatic manner; the above two operations are completed without the user's perception, avoiding the reliance on manual labor during the fault cluster switching process and improving the user experience.

[0052] In some optional embodiments, the standby cluster group is optimized, such as Figure 2 As shown, the following steps are included:

[0053] S201, monitor the online status of the HBase active cluster and the online status of the HBase standby cluster.

[0054] The online status of the HBase master cluster and the HBase standby cluster may be monitored in real time or periodically.

[0055] Specifically, after the microservice is started, the corresponding relationship between the master and standby clusters is established using the microservice automatic identification function. After the corresponding relationship is established, the online status of the hbase master cluster and all hbase standby clusters in the above corresponding relationship is monitored in real time or periodically. The online status includes online and offline. It should also be noted that the corresponding relationship is not static, but is constantly changing according to the online status of the master and standby clusters and the creation or cancellation of the master and standby clusters.

[0056] S202, adjusting the correspondence between the active and standby clusters according to the online status of the active hbase cluster and the online status of the standby hbase cluster.

[0057] Specifically, since the online status of the active and standby clusters is in dynamic change, it is necessary to adjust the correspondence between the active and standby clusters according to the online status of the hbase active cluster and the hbase standby cluster. For example, if the hbase active cluster is offline, then the target cluster determined by S101 is directly changed to the new hbase active cluster, and the target cluster and the correspondence between the target cluster and the original hbase active cluster are deleted from the correspondence between the active and standby clusters. For example, if a hbase standby cluster is offline, then the hbase standby cluster and the correspondence between the hbase standby cluster and the hbase active cluster are directly deleted from the correspondence between the active and standby clusters.

[0058] S203: Update the standby cluster group according to the adjusted corresponding relationship.

[0059] For example, before the corresponding relationship is adjusted, the HBase main cluster corresponds to 5 HBase standby clusters, so the standby cluster group consists of 5 HBase standby clusters. After the steps S201 to S202, the corresponding relationship is adjusted, and the adjusted corresponding relationship is that the HBase main cluster corresponds to 4 HBase standby clusters, so it is necessary to update the "standby cluster group consisting of 5 HBase standby clusters", and the updated standby cluster group consists of 4 HBase standby clusters in the adjusted corresponding relationship.

[0060] This embodiment updates the correspondence between the primary and secondary clusters and the secondary cluster group according to the online status of the HBase primary cluster and the HBase secondary cluster, so that the online status of each HBase secondary cluster in the secondary cluster group is consistent with the actual situation, thereby ensuring the accuracy and effectiveness of user access operations and improving access efficiency.

[0061] In some optional embodiments, the method of selecting the target cluster is optimized, such as Figure 3 As shown, including:

[0062] S301, obtaining the synchronization delay status of each HBase standby cluster in the standby cluster group.

[0063] The synchronization delay status of the HBase standby cluster can be obtained by monitoring tools or log files. The method for obtaining the synchronization delay status is not limited here. The synchronization delay status includes synchronization and delay. Synchronization means that the data stored in the HBase standby cluster is consistent with that in the HBase main cluster, and delay means that the data stored in the HBase standby cluster is inconsistent with that in the HBase main cluster.

[0064] S302: Determine the HBase standby cluster whose synchronization delay status is synchronization as a candidate cluster.

[0065] Specifically, an HBase standby cluster whose synchronization delay status is synchronization is determined as a candidate cluster from the standby cluster group, and there may be one or more candidate clusters.

[0066] S303: When there is one candidate cluster, determine the candidate cluster as the target cluster.

[0067] The target cluster is the cluster that takes over the services of the HBase main cluster.

[0068] S304: When there are multiple candidate clusters, obtain the performance level of each candidate cluster, and determine the candidate cluster with the highest performance level as the target cluster.

[0069] Specifically, when there are multiple candidate clusters and the performance access function is enabled, the performance level of each candidate cluster is obtained, and the performance levels are sorted, and the candidate cluster with the highest performance level is determined as the target cluster. In this embodiment, the performance level of the candidate cluster can be determined based on one or more cluster performance measurement indicators such as the overall resource utilization of the cluster, fault tolerance, and access volume. The higher the performance level, the better the cluster performance, and vice versa, the lower the performance level, the worse the cluster performance.

[0070] This embodiment gives priority to selecting an HBase standby cluster that is consistent with the data of the HBase main cluster as the target cluster, ensuring the accuracy of the access results obtained by the user. On this basis, the HBase standby cluster with higher performance is given priority to ensure the stability of the target cluster, avoiding the situation where the frequent replacement of the HBase main cluster causes the user's request to be unable to respond for a long time, thereby improving the user experience.

[0071] In an optional embodiment, the performance level is determined by: obtaining actual indicator data corresponding to each performance indicator; matching the actual indicator data of the performance indicator with the pre-built "mapping relationship between indicator data and indicator level" corresponding to the performance indicator, and the indicator level to which the actual indicator data belongs; performing a weighted sum operation based on the preset weight of each performance indicator and the indicator level of the corresponding performance indicator to obtain the performance level of the cluster.

[0072] In an optional example, when there are multiple candidate clusters and the performance access function is not enabled, one of the multiple candidate clusters is directly selected as the target cluster.

[0073] In an optional embodiment, after S103, the method further includes: when receiving a data processing instruction, establishing a connection with a target cluster; sending the data processing instruction to the target cluster; receiving a processing result fed back by the target cluster based on the data processing instruction, and sending the processing result to the client.

[0074] Specifically, after completing the replacement operation of the hbase main cluster address and the address of the target cluster, when receiving a data processing instruction, the new hbase main cluster address (i.e., the address of the target cluster) is obtained through the access path, and a connection is established with the target cluster according to the address of the target cluster. After the connection is established, the data processing instruction is sent to the target cluster so that the target cluster performs the corresponding processing operation based on the data processing instruction. After receiving the processing result fed back by the target cluster, the processing result is sent to the client. It should be noted that the data processing instruction carries operation instructions and data to be processed, and the operation instructions include but are not limited to instructions for adding, deleting, modifying and searching for data. When the operation instruction is an instruction for adding, deleting and modifying data, the processing result may be a successful operation or a failed operation; when the operation instruction is an instruction for searching data, the processing result may be data found based on index information.

[0075] In this embodiment, a switching device for a fault cluster is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0076] This embodiment provides a switching device for a fault cluster, such as Figure 4 As shown, including:

[0077] The selection module 401 is used to select a target cluster from a standby cluster group corresponding to the HBase main cluster when an abnormality of the HBase main cluster is monitored, and the standby cluster group consists of at least one HBase standby cluster.

[0078] The acquisition module 402 is used to acquire the access path of the HBase main cluster address and the address of the target cluster.

[0079] The first replacement module 403 is used to replace the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path.

[0080] In some optional embodiments, the device further comprises:

[0081] The monitoring module is used to monitor the online status of the HBase master cluster and the online status of the HBase standby cluster; the adjustment module is used to adjust the corresponding relationship between the master and standby clusters according to the online status of the HBase master cluster and the online status of the HBase standby cluster; the update module is used to update the standby cluster group according to the adjusted corresponding relationship.

[0082] In some optional implementations, the selection module 401 includes:

[0083] The first acquisition submodule is used to obtain the synchronization delay status of each HBase standby cluster in the standby cluster group; the first determination submodule is used to determine the HBase standby cluster whose synchronization delay status is synchronization as the candidate cluster; the second determination submodule is used to determine the candidate cluster as the target cluster when there is one candidate cluster.

[0084] In some optional implementations, when there are multiple candidate clusters, the selection module 401 further includes:

[0085] The second acquisition submodule is used to acquire the performance level of each candidate cluster; the third determination submodule is used to determine the candidate cluster with the highest performance level as the target cluster.

[0086] In some optional implementations, according to the access path, the device further includes:

[0087] The connection module is used to establish a connection with the target cluster when receiving a data processing instruction; the sending module is used to send the data processing instruction to the target cluster; the receiving module is used to receive the processing result fed back by the target cluster based on the data processing instruction, and send the processing result to the client.

[0088] In some optional embodiments, the device further comprises:

[0089] The synchronization module is used to synchronize the data in the target cluster to the hbase main cluster when the hbase main cluster is monitored to be online; the second replacement module is used to replace the address of the target cluster stored in the first zookeeper cluster with the hbase main cluster address according to the access path.

[0090] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0091] The switching device of the fault cluster in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0092] The embodiment of the present invention also provides a computer device having the above Figure 4 The switching device of the fault cluster is shown.

[0093] See also Figure 5 , Figure 5is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0094] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0095] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0096] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0097] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0098] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0099] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0100] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0101] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for switching a fault cluster, characterized in that: The method is applied to an HBase disaster recovery system integrated with a microservice framework, wherein the HBase disaster recovery system includes a first ZooKeeper cluster corresponding to the microservice, an HBase main cluster, at least one HBase backup cluster, and a second ZooKeeper cluster corresponding to each of the HBase main cluster and the at least one HBase backup cluster, and the method includes: When the hbase main cluster is monitored to be abnormal, a target cluster is selected from a standby cluster group corresponding to the hbase main cluster, where the standby cluster group is composed of the at least one hbase standby cluster; Get the access path of the HBase main cluster address and the address of the target cluster; According to the access path, the hbase main cluster address stored in the first zookeeper cluster is replaced with the address of the target cluster.

2. The method according to claim 1, characterized in that The method further comprises: Monitor the online status of the hbase master cluster and the online status of the hbase standby cluster; According to the online status of the HBase master cluster and the online status of the HBase standby cluster, the corresponding relationship between the master and standby clusters is adjusted; The standby cluster group is updated according to the adjusted corresponding relationship.

3. The method according to claim 1, characterized in that The selecting a target cluster from the standby cluster group corresponding to the HBase master cluster includes: Obtain the synchronization delay status of each of the HBase standby clusters in the standby cluster group; Determine the HBase standby cluster whose synchronization delay status is synchronization as a candidate cluster; When there is one candidate cluster, the candidate cluster is determined as the target cluster.

4. The method according to claim 3, characterized in that When there are multiple candidate clusters, after determining the HBase standby cluster whose synchronization delay state is synchronization as the candidate cluster, the method further includes: Obtaining a performance level of each of the candidate clusters; The candidate cluster with the highest performance level is determined as the target cluster.

5. The method according to claim 1, characterized in that After replacing the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path, the method further includes: When receiving the data processing instruction, establishing a connection with the target cluster; Sending the data processing instruction to the target cluster; The processing result fed back by the target cluster based on the data processing instruction is received, and the processing result is sent to the client.

6. The method according to claim 1, characterized in that After replacing the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path, the method further includes: When the HBase main cluster is monitored to be online, the data in the target cluster is synchronized to the HBase main cluster; According to the access path, the address of the target cluster stored in the first zookeeper cluster is replaced with the address of the hbase main cluster.

7. A switching device for a fault cluster, characterized in that: The device includes: A selection module, configured to select a target cluster from a standby cluster group corresponding to the hbase main cluster when an abnormality of the hbase main cluster is detected, wherein the standby cluster group is composed of the at least one hbase standby cluster; An acquisition module is used to obtain the access path of the HBase main cluster address and the address of the target cluster; The first replacement module is used to replace the hbase main cluster address stored in the first zookeeper cluster with the address of the target cluster according to the access path.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the fault cluster switching method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for switching a fault cluster according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for switching a fault cluster according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Cluster fault tolerance control method for port intelligent operation equipment

    CN121028572A

  • A Cluster Fault-Tolerant Control Method for Intelligent Port Operation Equipment

    CN121028572B