Storage gateway high availability method, system and electronic device
By introducing a dual arbitration mechanism in the cloud storage system and using the storage engine cluster for authoritative cluster arbitration and node arbitration, the data conflict and unavailability problems caused by cloud hard disk gateway service failures are solved, and a highly available storage gateway service is achieved.
Patent Information
- Application Number
- CN202210908661.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-07-29
AI Technical Summary
When the cloud hard disk gateway service fails, the existing high-availability management components have problems such as dual-master coexistence and arbitration failure, resulting in data conflicts and service unavailability, making it difficult to meet user needs.
A dual arbitration mechanism is adopted to perform authoritative cluster arbitration through the storage engine cluster, and node arbitration is performed when cluster arbitration is unavailable, selecting new working nodes from the backup nodes to ensure service reliability.
Even if more than half of the gateway nodes fail, services can still continue to be provided, avoiding data conflicts and service failures, and ensuring the high availability of the storage gateway.
Smart Images

Figure CN115766753B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed storage technology, and in particular to a storage gateway high availability method, system and electronic device. Background Art
[0002] Distributed storage systems are the foundation of cloud computing products. They must be able to store and access massive amounts of files and perform large-scale concurrent access, while also meeting requirements for stability, reliability, and hardware fault tolerance. Block storage within distributed storage systems is a storage product specifically designed to provide cloud hard drives for cloud hosts. While providing massive storage space, it also ensures scalability, portability, and backup and rollback capabilities. However, external services provided by cloud hard drive gateways are often impacted by power outages, network disconnections, disk failures, and service failures, which directly impact user data security. Therefore, providing high-availability services at a low cost and reliably has become a crucial core issue for storage product lines.
[0003] Some related technologies use high-availability management components to manage gateway software, enabling either active-standby or clustered modes to provide high-availability services. Active-standby mode uses heartbeats between active and standby nodes to monitor each other. However, this can lead to dual active nodes coexisting during network outages, resulting in data conflicts. Clustered mode uses an arbitration mechanism among individual nodes to elect a leader, requiring a majority vote to determine the leader. If a majority of gateways fail, arbitration fails, rendering all nodes unable to provide services. Therefore, the reliability of existing high-availability management components is insufficient to meet user needs. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a storage gateway high availability method, system, and electronic device, which can ensure the reliability of storage gateway services.
[0005] In a first aspect, the present disclosure provides a method for high availability of a storage gateway, the method being applied to a cloud storage system, the cloud storage system comprising a plurality of gateway nodes and a storage engine cluster, the storage engine cluster recording gateway information of the plurality of gateway nodes; the method comprising:
[0006] The candidate nodes among the plurality of gateway nodes monitor the service status of the working nodes;
[0007] In response to a service failure occurring on the working node, the standby node is converted into a candidate node;
[0008] The candidate node initiates a cluster arbitration request to the storage engine cluster;
[0009] The storage engine cluster performs cluster arbitration on the candidate node according to the gateway information;
[0010] In response to cluster arbitration being passed, the candidate node is converted to a new working node and the service is restarted;
[0011] In response to cluster arbitration failing, the candidate node initiates node arbitration with other gateway nodes;
[0012] In response to the node arbitration being passed, the candidate node is converted to a new working node and the service is restarted.
[0013] Optionally, the plurality of gateway nodes in the cloud storage system monitor each other's status by sending heartbeat information, wherein the heartbeat information includes a status identifier and version information of the gateway node, wherein the version information of the working node is continuously updated;
[0014] The candidate nodes among the plurality of gateway nodes monitor the service status of the working node, including:
[0015] The candidate node continuously receives the heartbeat information of the working node, and determines the service status of the working node according to the heartbeat information;
[0016] In response to the state identifier being changed from a master identifier to a slave identifier, determining that a service abnormality occurs in the working node;
[0017] In response to the version information being outdated, it is determined that a network abnormality occurs on the working node.
[0018] Optionally, the gateway information includes the heartbeat information of the gateway node;
[0019] The storage engine cluster performs cluster arbitration on the candidate node according to the gateway information, including:
[0020] State transfer control is performed according to the heartbeat information of the plurality of gateway nodes.
[0021] Optionally, when the cloud storage system includes two gateway nodes, performing state transfer control according to the heartbeat information of the plurality of gateway nodes includes:
[0022]
[0023] Wherein, S1 and S2 represent the status identifiers of the first gateway node and the second gateway node respectively, master represents the master identifier, slave represents the slave identifier, ΔEP1 and ΔEP2 represent the version update time of the first gateway node and the second gateway node respectively, and timeout represents the version update time limit. Indicates that a service failure occurs on the first gateway node.
[0024] Optionally, when the cloud storage system includes more than two gateway nodes, performing state transfer control according to the heartbeat information of the plurality of gateway nodes includes:
[0025]
[0026] Among them, S i ,S j Respectively represent the state identifiers of gateway node i and gateway node j, S0...S n Indicates the state identifiers of multiple gateway nodes other than gateway node i and gateway node j, ΔEP i ,ΔEP i Respectively represent the version update time of gateway node i and gateway node j, Indicates that a service failure occurs on the gateway node i.
[0027] Optionally, after cluster arbitration is passed, the method further includes:
[0028] The storage engine cluster sets a data lock for the candidate node that passes cluster arbitration;
[0029] When the candidate node that has passed cluster arbitration is converted into a new working node, the corresponding status identifier and the version information are updated to the storage engine cluster.
[0030] Optionally, the candidate node initiating node arbitration to other gateway nodes includes:
[0031] The candidate node obtains the heartbeat information of other gateway nodes;
[0032] In response to the state identifiers of the other gateway nodes being slave identifiers, the node arbitration is successful, and the state identifier of the candidate node is converted to a master identifier;
[0033] In response to the presence of the gateway node, the state identifier is set as the primary identifier, node arbitration fails, and the candidate node is converted to a standby node.
[0034] Optionally, the multiple gateway nodes communicate directly with each other through a high-availability management component, the gateway nodes communicate with the storage engine cluster based on the key-value database of the storage engine cluster, and the multiple gateway nodes communicate indirectly with each other through the storage engine cluster.
[0035] In a second aspect, an embodiment of this specification further provides a storage gateway high-availability system, the system comprising a plurality of gateway nodes and a storage engine cluster, the storage engine cluster being configured to record gateway information of the plurality of gateway nodes;
[0036] A candidate node among the plurality of gateway nodes, used to monitor the service status of the working node;
[0037] When a service failure occurs on the working node, the standby node is converted into a candidate node;
[0038] The candidate node is used to initiate a cluster arbitration request to the storage engine cluster;
[0039] The storage engine cluster is configured to perform cluster arbitration on the candidate nodes according to the gateway information;
[0040] When cluster arbitration is passed, the candidate node is converted into a new working node and used to restart the service;
[0041] When cluster arbitration fails, the candidate node is used to initiate node arbitration with other gateway nodes;
[0042] When the node arbitration is passed, the candidate node is converted into a new working node and used to restart the service.
[0043] In a third aspect, an embodiment of this specification further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0044] As can be seen from the above, the storage gateway high availability method, system, and electronic device provided in the embodiments of this specification have the following beneficial technical effects:
[0045] The storage gateway high-availability method, system, and electronic device adopt a dual arbitration mechanism when a working node fails. First, cluster arbitration is performed based on the authoritative cluster. The reliability of the service after the authoritative cluster arbitration is equivalent to the reliability of the authoritative cluster. If cluster arbitration is unavailable, node arbitration can continue to be performed to select a new working node from the alternative nodes to continue providing services. This method can continue to provide external services even if more than half of the gateway nodes in the system fail, avoiding data conflicts and service failures, and ensuring the reliability of storage gateway services. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0047] Figure 1 A schematic diagram of a storage gateway high availability method provided by one or more optional embodiments of this specification is shown;
[0048] Figure 2 A schematic diagram of a system structure of a storage gateway provided by one or more optional embodiments of this specification is shown;
[0049] Figure 3 A schematic diagram of a method for monitoring the service status of a working node in a storage gateway high availability method provided by one or more optional embodiments of this specification is shown;
[0050] Figure 4 A schematic diagram of a method for initiating node arbitration in a storage gateway high availability method provided by one or more optional embodiments of this specification is shown;
[0051] Figure 5 A schematic diagram of the structure of a high-availability electronic device for a storage gateway provided by one or more optional embodiments of this specification is shown. DETAILED DESCRIPTION
[0052] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0053] For example, after entering a search keyword in an instant messaging app, users hope to quickly retrieve the messages they need. However, as the number of conversations in instant messaging apps continues to increase, the app will retrieve a considerable number of messages after a user enters a search keyword. Users need to further filter the retrieved messages to obtain the messages they need.
[0054] Distributed storage systems are the foundation of cloud computing products. They must be able to store and access massive amounts of files and perform large-scale concurrent access, while also meeting requirements for stability, reliability, and hardware fault tolerance. Block storage within distributed storage systems is a storage product specifically designed to provide cloud hard drives for cloud hosts. While providing massive storage space, it also ensures scalability, portability, and backup and rollback capabilities. However, external services provided by cloud hard drive gateways are often impacted by power outages, network disconnections, disk failures, and service failures, which directly impact user data security. Therefore, providing high-availability services at a low cost and reliably has become a crucial core issue for storage product lines.
[0055] Some related technologies use high-availability management components to manage gateway software, enabling it to operate in a master-slave or clustered mode to provide high-availability services. The traditional master-slave mode uses heartbeats between the master and slave nodes to monitor each other. However, this mode can lead to catastrophic failures in the event of a network outage. Both the master and slave machines believe they are the master, creating a dual-master coexistence scenario. This can cause double writes in storage. During a double write, two nodes access the same storage space simultaneously, causing one to be overwritten. The order of the two operations cannot be guaranteed, leading to data inconsistencies.
[0056] Compared to the 50% utilization rate in active-standby mode, cluster mode uses an arbitration mechanism among nodes to elect a leader. During leader election, candidate nodes initiate arbitration within the entire cluster, and the leader is elected when more than half of the nodes vote. This can lead to arbitration failure in the event of a majority gateway failure, rendering all nodes unable to provide external services.
[0057] As can be seen from the above, the management mode of the existing high-availability management components still has the risk of unavailability when the gateway service fails, and the reliability is difficult to meet user needs.
[0058] In response to the above problems, the purpose of the technical solution of the embodiments of this specification is to propose a high-availability management method for storage gateways with a dual arbitration mechanism. An authoritative cluster is set up based on multiple storage gateways. High-availability management can achieve cluster arbitration based on the authoritative cluster and node arbitration based on multiple storage gateways themselves. The dual arbitration mechanism can avoid data conflicts and service effectiveness, and ensure the reliability of storage gateway services.
[0059] Based on the above objectives, on one hand, an embodiment of this specification provides a storage gateway high availability method.
[0060] like Figure 1 One or more optional embodiments of this specification provide a method for high-availability storage gateways, which is applied to a cloud storage system. The cloud storage system includes multiple gateway nodes and a storage engine cluster, which records gateway information of the multiple gateway nodes. Figure 2 The diagram shows the architecture of the cloud storage system. In the cloud storage system, the bottom layer is the storage engine cluster, which can provide the most basic storage objects. The multiple storage gateways in the upper layer act as gateway nodes to manage the storage objects on the storage engine and provide cloud hard disk product services to users.
[0061] The method comprises:
[0062] S1: The candidate nodes among the plurality of gateway nodes monitor the service status of the working nodes.
[0063] The candidate node maintains communication with the working node to obtain the service status information of the working node, thereby monitoring the service status of the working node.
[0064] In some optional embodiments, the plurality of gateway nodes monitor each other's status by sending heartbeat information. The candidate nodes among the plurality of gateway nodes can monitor and determine the service status of the working nodes based on the heartbeat information obtained from the working nodes.
[0065] S2: In response to a service failure occurring on the working node, the standby node is converted to a candidate node.
[0066] When a service failure occurs on the working node, it is necessary to select one of multiple candidate nodes outside the working node as a new working node to provide services. At this time, the candidate node is converted into a candidate node.
[0067] S3: The candidate node initiates a cluster arbitration request to the storage engine cluster.
[0068] S4: The storage engine cluster performs cluster arbitration on the candidate node according to the gateway information.
[0069] In the cloud storage system, the storage engine cluster can be selected as the authoritative cluster. The gateway information of multiple gateway nodes is stored in the storage engine cluster. The storage engine cluster can be used to perform cluster arbitration based on the gateway information and select one from the multiple candidate nodes as a new working node.
[0070] S5: In response to the cluster arbitration failing, the candidate node initiates node arbitration to other gateway nodes.
[0071] Considering that the storage engine cluster may perform troubleshooting, service interruptions may occur in some cases. To ensure solution reliability, in some optional embodiments, when cluster arbitration fails, the candidate node continues to perform node arbitration, arbitrating among multiple gateway nodes to determine a new working node.
[0072] S6: When cluster arbitration or node arbitration is passed, the candidate node is converted to a new working node and the service is restarted.
[0073] The storage gateway high-availability method employs a dual arbitration mechanism when a working node fails. Cluster arbitration is first performed based on the authoritative cluster. Service reliability after authoritative cluster arbitration is equivalent to that of the authoritative cluster. If cluster arbitration fails, node arbitration can continue, selecting a new working node from among the candidate nodes to continue providing services. This approach allows services to continue even if more than half of the gateway nodes in the system fail, avoiding data conflicts and service failures and ensuring storage gateway service reliability.
[0074] like Figure 3 As shown, in a storage gateway high availability method provided in one or more optional embodiments of the present specification, status monitoring is performed between multiple gateway nodes in the cloud storage system by sending heartbeat information, and the heartbeat information includes the state identifier (state) and version information (epoch) of the gateway node, wherein the version information of the working node is continuously updated.
[0075] The candidate nodes among the plurality of gateway nodes monitor the service status of the working node, including:
[0076] S301: The candidate node continuously receives the heartbeat information of the working node, and determines the service status of the working node according to the heartbeat information.
[0077] When the service of the working node is in normal state, the state identifier state is a master identifier Master, and the state identifier state responded by other standby nodes is a slave identifier Slave.
[0078] S302: In response to the status identifier being changed from a master identifier to a slave identifier, it is determined that a service abnormality occurs in the working node.
[0079] When a service anomaly occurs, the working node will change its state identifier to a slave identifier. Therefore, when the candidate node detects that the state identifier of the working node changes from a master identifier to a slave identifier, it indicates that a service anomaly has occurred on the working node.
[0080] S303: In response to the version information being outdated, determining that a network abnormality occurs on the working node.
[0081] The version information is outdated, indicating that the version information cannot be continuously updated normally, and a network anomaly occurs on the working node.
[0082] The service failure of the working node includes the above-mentioned service anomaly and network anomaly.
[0083] In a storage gateway high availability method provided in one or more optional embodiments of this specification, the gateway information includes the heartbeat information of the gateway node. The storage engine cluster performs cluster arbitration on the candidate nodes based on the gateway information, including performing state transition control based on the heartbeat information of the multiple gateway nodes.
[0084] In some optional embodiments, the cloud storage system includes two storage gateways, a master and a slave. The storage engine cluster performs cluster arbitration on the master and the slave gateway nodes according to the gateway information and controls the state transfer between the two.
[0085]
[0086] Wherein, S1 and S2 represent the status identifiers of the first gateway node and the second gateway node respectively, master represents the master identifier, slave represents the slave identifier, ΔEP1 and ΔEP2 represent the version update time of the first gateway node and the second gateway node respectively, and timeout represents the version update time limit. Indicates that a service failure occurs on the first gateway node.
[0087] The meaning of the above state transfer formula includes: for the second gateway node, when the second gateway node S2 is the slave identifier and S2 is the master identifier but the version information update times out, the control is to change the state identifier of the first gateway node to the master identifier master; for the first gateway node, when a service failure occurs in the first gateway node or the version information update of the first gateway node times out, the control is to change the state identifier of the first gateway node to the slave identifier slave.
[0088] In some optional embodiments, the cloud storage system includes multiple master and slave storage gateways, and the storage engine cluster performs state transfer control on the multiple gateway nodes according to the heartbeat information of the multiple gateway nodes.
[0089]
[0090] Among them, S i ,S j Respectively represent the state identifiers of gateway node i and gateway node j, S0...S n Indicates the state identifiers of multiple gateway nodes other than gateway node i and gateway node j, ΔEP i ,ΔEP i Respectively represent the version update time of gateway node i and gateway node j, Indicates that a service failure occurs on the gateway node i.
[0091] Wherein, gateway node i and gateway node j can be any node among multiple gateway nodes. The meaning of the above state transfer formula includes: for gateway node j and other multiple gateway nodes, in S0…S n All are slave identifiers. When gateway node j is the master identifier but the version information update times out, gateway node i can be selected as the new working node, and the status identifier of gateway node i is controlled to be changed to the master identifier master; for gateway node i, when a service failure occurs in gateway node i, or the version information update of gateway node i times out, the status identifier of gateway node i is controlled to be changed to the slave identifier slave.
[0092] The storage engine cluster records the heartbeat information of multiple gateway nodes. The storage engine cluster can be used as an authoritative cluster. Cluster arbitration is performed on multiple gateway nodes based on the authoritative cluster, and one of the multiple candidate nodes is selected as a new working node.
[0093] In a storage gateway high-availability method provided in one or more optional embodiments of this specification, when the storage engine cluster performs cluster arbitration for multiple candidate nodes, the multiple candidate nodes arbitrate by grabbing a database lock in the storage engine cluster. The storage engine cluster sets a data lock for the candidate node that passes cluster arbitration. When the candidate node that passes cluster arbitration is converted to a new working node, the candidate node updates the corresponding status identifier and version information to the storage engine cluster.
[0094] Based on the data lock mechanism, when the candidate node that passes cluster arbitration is converted into a new working node, the updated status identifier and version information will no longer be overwritten by information of other candidate nodes.
[0095] like Figure 4 As shown, in a storage gateway high availability method provided in one or more optional embodiments of this specification, the candidate node initiates node arbitration to other gateway nodes, including:
[0096] S401: The candidate node inquires about the status identifiers of other gateway nodes;
[0097] The candidate node may determine the status of other gateway nodes by querying status identifiers.
[0098] S402: Determine whether the status identifier of another gateway node is the primary identifier;
[0099] S403: In response to the fact that the status identifiers of the other gateway nodes are all slave identifiers, the node arbitration is successful, and the status identifier of the candidate node is converted to a master identifier.
[0100] The state identifiers of the other gateway nodes are all slave identifiers, indicating that there is no working node in the cloud storage system at the current time. The candidate node can convert the state identifier to the master identifier, thereby converting the candidate node to a new working node and restarting the service.
[0101] S404: In response to the presence of the gateway node, the state identifier is set as the primary identifier, node arbitration fails, and the candidate node is converted to a standby node.
[0102] When the state identifier of the gateway node is the primary identifier, it indicates that a working node already exists in the cloud storage system to provide services. The candidate node fails in arbitration and returns to the standby node.
[0103] The node arbitration adopts a one-vote veto mechanism, which does not require all nodes to reply. Even if more than half of the gateway nodes are faulty, arbitration can still be achieved, and a new working node will be determined from the remaining gateway nodes to continue providing services. This approach can further ensure service reliability.
[0104] In a storage gateway high availability method provided in one or more optional embodiments of this specification, multiple gateway nodes in the cloud storage system communicate directly with each other through a high availability management component, the gateway node communicates with the storage engine cluster based on the key-value database of the storage engine cluster, and multiple gateway nodes communicate indirectly with each other through the storage engine cluster. With this communication architecture, when a gateway node fails, normal data communication can still be maintained between other normally functioning gateway nodes, and between other normally functioning gateway nodes and the storage engine cluster, thereby avoiding the impact of the failure of some gateway nodes on the continued provision of services and further ensuring the reliability of storage gateway services.
[0105] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.
[0106] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0107] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a storage gateway high-availability system.
[0108] refer to Figure 2 , the storage gateway high availability system includes multiple gateway nodes and a storage engine cluster, and the storage engine cluster is used to record gateway information of the multiple gateway nodes;
[0109] A candidate node among the plurality of gateway nodes, used to monitor the service status of the working node;
[0110] When a service failure occurs on the working node, the standby node is converted into a candidate node;
[0111] The candidate node is used to initiate a cluster arbitration request to the storage engine cluster;
[0112] The storage engine cluster is configured to perform cluster arbitration on the candidate nodes according to the gateway information;
[0113] When cluster arbitration is passed, the candidate node is converted into a new working node and used to restart the service;
[0114] When cluster arbitration fails, the candidate node is used to initiate node arbitration with other gateway nodes;
[0115] When the node arbitration is passed, the candidate node is converted into a new working node and used to restart the service.
[0116] In a storage gateway high-availability system provided by one or more optional embodiments of the present specification, multiple gateway nodes monitor their status by sending heartbeat information, and the heartbeat information includes the status identifier and version information of the gateway node, wherein the version information of the working node is continuously updated; the alternative node is also used to continuously receive the heartbeat information of the working node, and judge the service status of the working node based on the heartbeat information; in response to the status identifier changing from the master identifier to the slave identifier, it is determined that a service anomaly occurs in the working node; in response to the version information being outdated, it is determined that a network anomaly occurs in the working node.
[0117] In one or more optional embodiments of the present specification, a storage gateway high-availability system is provided, wherein the gateway information includes the heartbeat information of the gateway node. The storage engine cluster is further configured to perform state transfer control based on the heartbeat information of the plurality of gateway nodes.
[0118] In a storage gateway high availability system provided by one or more optional embodiments of this specification, the storage engine cluster is further configured to control state transition based on the heartbeat information of the multiple gateway nodes when the cloud storage system includes two gateway nodes. The state transition formula is:
[0119]
[0120] Wherein, S1 and S2 represent the status identifiers of the first gateway node and the second gateway node respectively, master represents the master identifier, and ΔEP1 and ΔEP2 represent the version update time of the first gateway node and the second gateway node respectively, and timeout represents the version update time limit. Indicates that a service failure occurs on the first gateway node.
[0121] In a storage gateway high availability system provided by one or more optional embodiments of this specification, the storage engine cluster is further configured to perform state transition control based on the heartbeat information of the multiple gateway nodes when the cloud storage system includes more than two gateway nodes. The state transition formula is:
[0122]
[0123] Among them, S i ,S j Respectively represent the state identifiers of gateway node i and gateway node j, S0...S n Indicates the state identifiers of multiple gateway nodes other than gateway node i and gateway node j, ΔEP i ,ΔEP i Respectively represent the version update time of gateway node i and gateway node j, Indicates that a service failure occurs on the gateway node i.
[0124] In a storage gateway high availability system provided in one or more optional embodiments of this specification, the storage cluster engine is further configured to set a data lock for the candidate node that passes cluster arbitration;
[0125] When the candidate node that passes cluster arbitration is converted into a new working node, it is also used to update the corresponding status identifier and the version information to the storage engine cluster.
[0126] In a storage gateway high-availability system provided by one or more optional embodiments of the present specification, when cluster arbitration fails, the candidate node is further used to query the status identifiers of other gateway nodes; in response to the status identifiers of other gateway nodes being slave identifiers, the node arbitration is successful, and the candidate node is further used to convert the status identifier to a master identifier; in response to the status identifier of the existing gateway node being a master identifier, the node arbitration fails, and the candidate node is converted to a backup node.
[0127] In a storage gateway high-availability system provided in one or more optional embodiments of the present specification, multiple gateway nodes communicate directly with each other through a high-availability management component, the gateway nodes communicate with the storage engine cluster based on the key-value database of the storage engine cluster, and the multiple gateway nodes communicate indirectly with each other through the storage engine cluster.
[0128] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0129] The apparatus of the above embodiment is used to implement the corresponding storage gateway high availability method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0130] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the storage gateway high availability method described in any of the above embodiments is implemented.
[0131] Figure 5 A more specific hardware structure diagram of an electronic device provided in this embodiment is shown. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.
[0132] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0133] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0134] The input / output interface 1030 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components within the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0135] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0136] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0137] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figures.
[0138] The electronic device of the above embodiment is used to implement the corresponding storage gateway high availability method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0139] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the storage gateway high availability method described in any of the above embodiments.
[0140] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0141] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the storage gateway high availability method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0142] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Within the scope of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0143] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the following fact, that is, the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0144] Although the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may utilize the embodiments discussed.
[0145] The embodiments of the present disclosure are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A storage gateway high availability method, characterized in that: The method is applied to a cloud storage system, the cloud storage system including multiple gateway nodes and a storage engine cluster, the storage engine cluster recording gateway information of the multiple gateway nodes; the method includes: The candidate nodes among the plurality of the gateway nodes monitor the service status of the working nodes. The plurality of the gateway nodes in the cloud storage system monitor the status by sending heartbeat information between each other, wherein the heartbeat information includes the status identifier and version information of the gateway node, wherein the version information of the working node is continuously updated; In response to a service failure occurring on the working node, the standby node is converted into a candidate node; The candidate node initiates a cluster arbitration request to the storage engine cluster; The storage engine cluster performs cluster arbitration on the candidate node according to the gateway information; In response to cluster arbitration being passed, the candidate node is converted to a new working node and the service is restarted; In response to cluster arbitration failing, the candidate node initiates node arbitration with other gateway nodes; In response to the node arbitration being passed, the candidate node is converted into a new working node and the service is restarted; The candidate nodes among the plurality of gateway nodes monitor the service status of the working node, including: The candidate node continuously receives the heartbeat information of the working node, and determines the service status of the working node according to the heartbeat information; In response to the state identifier being changed from a master identifier to a slave identifier, determining that a service abnormality occurs in the working node; In response to the version information being outdated, determining that a network abnormality occurs on the working node; The candidate node initiates node arbitration to the other gateway nodes, including: The candidate node inquires the status identifiers of other gateway nodes; In response to the state identifiers of the other gateway nodes being slave identifiers, the node arbitration is successful, and the corresponding state identifier of the candidate node is converted to a master identifier; In response to the presence of the gateway node, the state identifier is set as the primary identifier, node arbitration fails, and the candidate node is converted to a standby node.
2. The method according to claim 1, characterized in that The gateway information includes the heartbeat information of the gateway node; The storage engine cluster performs cluster arbitration on the candidate node according to the gateway information, including: State transfer control is performed according to the heartbeat information of the plurality of gateway nodes.
3. The method according to claim 2, characterized in that In a case where the cloud storage system includes two gateway nodes, performing state transfer control according to the heartbeat information of the plurality of gateway nodes includes: in, respectively represent the status identifiers of the first gateway node and the second gateway node, represents the primary identifier, represents the slave identifier, Respectively represent the version update time of the first gateway node and the second gateway node, Indicates the version update time limit. Indicates that a service failure occurs on the first gateway node.
4. The method according to claim 2, characterized in that In a case where the cloud storage system includes more than two gateway nodes, performing state transfer control according to the heartbeat information of the plurality of gateway nodes includes: in, Represents gateway nodes , gateway node The state identifier, Indicates the gateway node , gateway node The status identifiers of multiple other gateway nodes, Represents gateway nodes , gateway node Version update time, Represents the gateway node A service failure occurred.
5. The method according to claim 2, characterized in that After cluster arbitration is passed, the following also applies: The storage engine cluster sets a data lock for the candidate node that passes cluster arbitration; When the candidate node that has passed cluster arbitration is converted into a new working node, the corresponding status identifier and the version information are updated to the storage engine cluster.
6. The method according to claim 1, characterized in that The multiple gateway nodes communicate directly with each other through a high-availability management component, the gateway nodes communicate with the storage engine cluster based on the key-value database of the storage engine cluster, and the multiple gateway nodes communicate indirectly with each other through the storage engine cluster.
7. A storage gateway high availability system, characterized in that: The system includes multiple gateway nodes and a storage engine cluster, wherein the storage engine cluster is used to record gateway information of the multiple gateway nodes; The candidate nodes among the plurality of the gateway nodes are used to monitor the service status of the working nodes. The plurality of the gateway nodes in the cloud storage system monitor the status by sending heartbeat information, wherein the heartbeat information includes the status identifier and version information of the gateway node, wherein the version information of the working node is continuously updated; When a service failure occurs on the working node, the standby node is converted into a candidate node; The candidate node is used to initiate a cluster arbitration request to the storage engine cluster; The storage engine cluster is configured to perform cluster arbitration on the candidate nodes according to the gateway information; When cluster arbitration is passed, the candidate node is converted into a new working node and used to restart the service; When cluster arbitration fails, the candidate node is used to initiate node arbitration with other gateway nodes; When the node arbitration is passed, the candidate node is converted into a new working node and used to restart the service; The candidate nodes among the multiple gateway nodes are specifically used for: The candidate node continuously receives the heartbeat information of the working node, and determines the service status of the working node according to the heartbeat information; In response to the state identifier being changed from a master identifier to a slave identifier, determining that a service abnormality occurs in the working node; In response to the version information being outdated, determining that a network abnormality occurs on the working node; The candidate node is specifically used for: The candidate node inquires the status identifiers of other gateway nodes; In response to the state identifiers of the other gateway nodes being slave identifiers, the node arbitration is successful, and the corresponding state identifier of the candidate node is converted to a master identifier; In response to the presence of the gateway node, the state identifier is set as the primary identifier, node arbitration fails, and the candidate node is converted to a standby node.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Access authority control system of shared cloud hard disk
CN114285865A
Database arbitration service scheduling method and system
CN114490231A