Resource sharing method and system for distributed block storage gateway
By using the Raft algorithm to divide the master and slave nodes in the distributed block storage gateway and unify the PR lock management, the coordination problem between different gateways is solved, the system reliability and load balancing capability are improved, the fault switching time is reduced, and the security and consistency of storage resources are ensured.
Patent Information
- Application Number
- CN202211515113.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-11-30
AI Technical Summary
When building shared block storage, existing technologies lack a persistent reservation mechanism to coordinate between different block gateways, resulting in multiple clients having to select only the same gateway server. This may cause the PR lock mechanism to fail, reduce system availability and reliability, and extend fault recovery time.
The Raft algorithm is used for election, and the gateway access layer is divided into master nodes and slave nodes. The master node controls the slave nodes to obtain and release storage resource PR locks. A data collaboration process is designed, and the persistent reservation mechanism information table is used to apply for and release PR locks. This unifies the block gateway access layer logic in the shared disk scenario.
It achieves load balancing and high reliability under multi-path technology, reduces failover time, ensures that clients can access any distributed gateway without affecting the effectiveness of the SCSI persistent reservation mechanism, and avoids shared disk data damage.
Smart Images

Figure CN116055494B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of building shared block storage resources, and in particular to a resource sharing method and system for a distributed block storage gateway. Background Art
[0002] The SCSI Persistent Reserve mechanism, introduced by the SCSI standard, supports scenarios where multiple initiating nodes access a device, preventing other nodes from accessing specific storage resources. Furthermore, this mechanism supports multiple paths from the initiating node to the server. iSCSI-based shared cloud hard drives, implemented based on this mechanism, are block-level storage devices that support concurrent read and write operations by multiple cloud hosts. This mechanism effectively prevents data corruption caused by simultaneous disk operations by multiple cloud hosts. With the advancement of network storage technology, the Internet Small Computer System Interface (iSCSI) has become a universal standard for block network storage resources. Its cost-effectiveness and versatility have driven the rapid development of storage area networks (SANs). For example, IP-SAN is an IP-based SAN storage solution that is easily applicable on local and wide area networks (LANs) and has strong technical support, enabling long-distance block-level storage systems over IP networks.
[0003] However, the concept of cloud storage has gradually expanded to refer to systems that utilize distributed clusters, grid technology, or distributed file systems to aggregate and coordinate various types of storage devices in the network to provide external data storage and access portals. When accessing various cloud storage services, customers seek features such as disaster recovery, high reliability, and high availability. This means adopting a distributed and scalable system structure and utilizing multiple storage servers to balance business traffic to improve system reliability and availability. Shared block storage requires the use of SCSI's persistent reservation mechanism. Therefore, when existing block gateways implement shared storage resources, they often need to plan resources such as access nodes and underlying storage devices in advance for specific block gateways. However, the current way of building shared block storage results in differences between different block gateways, resulting in customized gateway configurations for different servers.
[0004] Therefore, the typical approach to building shared block storage relies on top-level storage resource planning. Different block gateway servers lack a coordinated persistent reservation mechanism, resulting in multiple clients being forced to choose the same gateway server when connecting to shared disk resources. Otherwise, the PR lock mechanism fails, leading to disk data corruption. Furthermore, because storage resources maintained on storage gateways are inconsistent, when a failure occurs, storage resources must be restored on another gateway, preventing the use of multipathing technology for rapid failover. This reduces system availability and reliability and prolongs recovery time. Summary of the Invention
[0005] Based on this, it is necessary to propose a resource sharing method and system for distributed block storage gateways, which can design a data collaboration process between distributed block storage gateways based on the persistent reservation mechanism of the SCSI standard, so that shared disks can be combined with conventional multi-path technology to achieve load balancing and higher reliability.
[0006] In a first aspect, the present application provides a resource sharing method for a distributed block storage gateway, which is applied to a server, and the method includes:
[0007] The Raft algorithm is used to elect nodes so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0008] Receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain PR lock usage of the corresponding storage resource;
[0009] By retrieving the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the usage of the PR lock, updating the persistent reservation mechanism information table according to the application result;
[0010] According to the application result, a PR lock acquisition request is sent through the slave node, where the PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
[0011] In one embodiment, the step of retrieving the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the usage of the PR lock includes:
[0012] If there is no client in use, a successful PR lock application result is sent to the slave node;
[0013] If there is a client that has been used and the information is the same as the PR lock acquisition information, a result indicating that the PR lock application is successful is sent to the slave node;
[0014] If there is a client that has been used and the information is different from the PR lock acquisition information, a result indicating that the PR lock application failed is sent to the slave node.
[0015] In one embodiment, the receiving of the PR lock release request and sending the PR lock acquisition information to the master node through the slave node may then include:
[0016] When the duration of the slave node sending the PR lock acquisition information to the master node exceeds a first threshold, the slave node sends PR lock release information to the master node.
[0017] In one embodiment, the step of sending a PR lock acquisition request through the slave node according to the application result further includes:
[0018] When the storage resource reservation is successful, the first connection request is received, and an I / O uplink and downlink channel of the storage resource layer is established with the client.
[0019] In a second aspect, the present application provides a resource sharing method for a distributed block storage gateway, which is applied to a client, and the method includes:
[0020] Send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource;
[0021] Receiving a PR lock acquisition request and obtaining PR lock acquisition information, and determining a reservation status of storage resources according to the PR lock acquisition information;
[0022] The master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to acquire and release the storage resource PR lock. When the sending time of the PR lock acquisition information sent by the slave node in the server to the master node exceeds a first threshold, the master node sends PR lock release information to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0023] In one embodiment, the receiving a PR lock acquisition request and acquiring PR lock acquisition information further includes:
[0024] When the storage resource reservation is successful, the first connection request is sent, and the I / O uplink and downlink channels of the storage resource layer are established with the server.
[0025] In a third aspect, the present application provides a resource sharing system for a distributed block storage gateway, which is applied to a server, and the system includes:
[0026] A first election module is configured to perform elections using a Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is configured to control the slave nodes to acquire and release storage resource PR locks.
[0027] A first processing module is configured to receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain PR lock usage of corresponding storage resources;
[0028] a second processing module, configured to retrieve a persistent reservation mechanism information table and send a PR lock application result to the slave node according to usage of the PR lock, and update the persistent reservation mechanism information table according to the application result;
[0029] The first sending module is configured to send a PR lock acquisition request through the slave node according to the application result, wherein the PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
[0030] In a fourth aspect, the present application provides a resource sharing system for a distributed block storage gateway, which is applied to a client, and the system includes:
[0031] A second sending module is configured to send a PR lock release request, wherein the PR lock release request is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource;
[0032] a first determination module, configured to receive a PR lock acquisition request and obtain PR lock acquisition information, and determine a reservation status of storage resources according to the PR lock acquisition information;
[0033] The master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to acquire and release the storage resource PR lock. When the sending time of the PR lock acquisition information sent by the slave node in the server to the master node exceeds a first threshold, the master node sends PR lock release information to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0034] In a fifth aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] The Raft algorithm is used to elect nodes so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0036] Receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain PR lock usage of the corresponding storage resource;
[0037] By retrieving the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the usage of the PR lock, updating the persistent reservation mechanism information table according to the application result;
[0038] Sending a PR lock acquisition request through the slave node according to the application result, wherein the PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information; or
[0039] Send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource;
[0040] Receiving a PR lock acquisition request and obtaining PR lock acquisition information, and determining a reservation status of storage resources according to the PR lock acquisition information;
[0041] The master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to acquire and release the storage resource PR lock. When the sending time of the PR lock acquisition information sent by the slave node in the server to the master node exceeds a first threshold, the master node sends PR lock release information to the master node. The master node retrieves the pre-persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0042] In a sixth aspect, the present application provides a computer storage medium storing a computer program, which, when executed by a processor, implements the following steps:
[0043] The Raft algorithm is used to elect nodes so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0044] Receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain PR lock usage of the corresponding storage resource;
[0045] By retrieving the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the usage of the PR lock, updating the persistent reservation mechanism information table according to the application result;
[0046] Sending a PR lock acquisition request through the slave node according to the application result, wherein the PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information; or
[0047] Send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource;
[0048] Receiving a PR lock acquisition request and obtaining PR lock acquisition information, and determining a reservation status of storage resources according to the PR lock acquisition information;
[0049] The master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to acquire and release the storage resource PR lock. When the sending time of the PR lock acquisition information sent by the slave node in the server to the master node exceeds a first threshold, the master node sends PR lock release information to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0050] In the resource sharing method and system for the distributed block storage gateway described above, during the initialization phase, the server elects through the Raft algorithm, dividing the gateway access layer into a master node and multiple slave nodes. The master node then controls the slave nodes to acquire and release the PR locks for storage resources. Due to Raft's consistency algorithm, any control node can become the control gateway. After initialization, the server receives a PR lock release request and sends PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the slave node through the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage status, and updates the persistent reservation mechanism information table based on the application result. Finally, the slave node sends a PR lock acquisition request to the client based on the success or failure of the PR lock application. After receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the reservation status of the storage resource based on the PR lock acquisition information. This method designs a collaborative approach based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is a flow chart of a resource sharing method for a distributed block storage gateway in one embodiment of the present application;
[0052] Figure 2 This is a flow chart of a resource sharing method for a distributed block storage gateway in one embodiment of the present application;
[0053] Figure 3This is a flow chart of a resource sharing method for a distributed block storage gateway in one embodiment of the present application;
[0054] Figure 4 This is a flow chart of a resource sharing method for a distributed block storage gateway in one embodiment of the present application;
[0055] Figure 5 A schematic diagram of the system architecture of a resource sharing solution for a distributed block storage gateway according to an embodiment of the present application;
[0056] Figure 6 Flowchart of the persistent reservation mechanism implemented by the gateway access layer of this embodiment;
[0057] Figure 7 This is a schematic diagram of the resource sharing system structure of a distributed block storage gateway in one embodiment of the present application;
[0058] Figure 8 This is a schematic diagram of the resource sharing system structure of a distributed block storage gateway in one embodiment of the present application;
[0059] Figure 9 This is a schematic diagram of the resource sharing system structure of a distributed block storage gateway in one embodiment of the present application;
[0060] Figure 10 This is a schematic diagram of the resource sharing system structure of a distributed block storage gateway in one embodiment of the present application;
[0061] Figure 11 This is a diagram of the internal structure of a computer device according to one embodiment of the present application. DETAILED DESCRIPTION
[0062] To make the objectives, 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 ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0063] like Figure 1 As shown, in one embodiment, a resource sharing method of a distributed block storage gateway is applied to a server, comprising the following steps:
[0064] Step S110 : Election is performed through the Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0065] Specifically, during the initialization process, the server uses the Raft algorithm to elect and divide the gateway access layer into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0066] Step S120: Receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain the PR lock usage of the corresponding storage resource.
[0067] Specifically, after the initialization is completed, the slave node in the server receives the PR lock release request from the client and sends the PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the master node.
[0068] Step S130 : searching the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the PR lock usage, and updating the persistent reservation mechanism information table according to the application result.
[0069] Specifically, the master node in the server retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the PR lock usage, and updates the persistent reservation mechanism information table according to the PR lock application result.
[0070] Step S140 : Sending a PR lock acquisition request through the slave node according to the application result. The PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
[0071] Specifically, the server sends a PR lock acquisition request to the client through the slave node according to the PR lock application result obtained in step S130. After receiving the PR lock acquisition request, the client obtains PR lock acquisition information and determines the reservation status of storage resources according to the PR lock acquisition information.
[0072] In the resource sharing method for the distributed block storage gateway described above, during the initialization phase, the server elects using the Raft algorithm, dividing the gateway access layer into a master node and multiple slave nodes. The master node then controls the slave nodes to acquire and release PR locks for storage resources. Due to Raft's consistency algorithm, any control node can become the control gateway. After initialization, the server receives a PR lock release request and sends PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the slave node via the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage status, and updates the persistent reservation mechanism information table based on the application result. Finally, based on the success or failure of the PR lock application, the slave node sends a PR lock acquisition request to the client. After receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. This method designs a collaborative approach based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0073] like Figure 2 As shown, in one embodiment, a resource sharing method of a distributed block storage gateway is applied to a server, comprising the following steps:
[0074] Step S210 : Elections are performed through the Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0075] Specifically, during the initialization process, the server uses the Raft algorithm to elect and divide the gateway access layer into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0076] Step S220: Receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain the PR lock usage of the corresponding storage resource.
[0077] Specifically, after the initialization is completed, the slave node in the server receives the PR lock release request from the client and sends the PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the master node.
[0078] Step S230: When the duration of sending the PR lock acquisition information from the slave node to the master node exceeds a first threshold, the slave node sends a PR lock release message to the master node.
[0079] Specifically, when the duration of sending the PR lock acquisition information from the slave node in the server to the master node exceeds a set first threshold, it is timed out, and after the timeout, the slave node sends the PR lock release information to the master node.
[0080] Step S240 : searching the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the PR lock usage, and updating the persistent reservation mechanism information table according to the application result.
[0081] Specifically, the master node on the server side retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage. The master node also updates the persistent reservation mechanism information table based on the PR lock application result. If there is no used client, the master node sends a successful PR lock application result to the slave node. If there is a used client and the PR lock acquisition information is the same, the master node sends a successful PR lock application result to the slave node. If there is a used client and the PR lock acquisition information is different, the master node sends a failed PR lock application result to the slave node.
[0082] Step S250: Send a PR lock acquisition request through the slave node according to the application result. The PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
[0083] Specifically, the server sends a PR lock acquisition request to the client through the slave node according to the PR lock application result obtained in step S130. After receiving the PR lock acquisition request, the client obtains PR lock acquisition information and determines the reservation status of storage resources according to the PR lock acquisition information.
[0084] Step S260: After the storage resource reservation is successful, a first connection request is received, and an I / O uplink and downlink channel of the storage resource layer is established with the client.
[0085] Specifically, when the result of determining the storage resource reservation status in step S250 indicates that the storage resource reservation is successful, the server receives the first connection request from the client and establishes an I / O uplink and downlink channel of the storage resource layer with the client.
[0086] In the resource sharing method for the distributed block storage gateway described above, during the initialization phase, the server elects using the Raft algorithm, dividing the gateway access layer into a master node and multiple slave nodes. The master node then controls the slave nodes to acquire and release PR locks for storage resources. Due to the Raft consensus algorithm, any control node can become the control gateway. After initialization, the server receives a PR lock release request and sends PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the slave node via the master node. When the duration of the PR lock acquisition information sent by the slave node to the master node exceeds a first threshold, it sends a PR lock release message to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage status, and updates the persistent reservation mechanism information table based on the application result. Finally, based on the success or failure of the PR lock application, the slave node sends a PR lock acquisition request to the client. Upon receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. Finally, if the storage resource reservation is successful, it sends a first connection request to the server and establishes an I / O uplink and downlink channel for the storage resource layer with the server. This method designs a collaborative approach based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0087] like Figure 3 As shown, in one embodiment, a resource sharing method of a distributed block storage gateway, applied to a client, includes the following steps:
[0088] Step S310: Send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource.
[0089] Specifically, the client sends a PR lock release request to the server. After receiving the PR lock release request, the server sends PR lock acquisition information and PR lock usage status of the corresponding storage resource to the master node through the slave node.
[0090] It should be noted that the master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to obtain and release the storage resource PR lock. When the sending time of the PR lock acquisition information from the slave node in the server to the master node exceeds the first threshold, the PR lock release information is sent to the master node. The master node of the server retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0091] Step S320: Receive a PR lock acquisition request and obtain PR lock acquisition information, and determine the reservation status of storage resources according to the PR lock acquisition information.
[0092] Specifically, the client receives a PR lock acquisition request from the server and obtains PR lock acquisition information, and determines the reservation status of the storage resource according to the obtained PR lock acquisition information.
[0093] In the resource sharing method for the distributed block storage gateway described above, during the initialization phase, the server elects using the Raft algorithm, dividing the gateway access layer into a master node and multiple slave nodes. The master node then controls the slave nodes to acquire and release PR locks for storage resources. Due to Raft's consistency algorithm, any control node can become the control gateway. After initialization, the server receives a PR lock release request and sends PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the slave node via the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage status, and updates the persistent reservation mechanism information table based on the application result. Finally, based on the success or failure of the PR lock application, the slave node sends a PR lock acquisition request to the client. After receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. This method designs a collaborative approach based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0094] like Figure 4 As shown, in one embodiment, a resource sharing method of a distributed block storage gateway, applied to a client, includes the following steps:
[0095] Step S410: Send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource.
[0096] Specifically, the client sends a PR lock release request to the server. After receiving the PR lock release request, the server sends PR lock acquisition information and PR lock usage status of the corresponding storage resource to the master node through the slave node.
[0097] It should be noted that the master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to obtain and release the storage resource PR lock. When the sending time of the PR lock acquisition information from the slave node in the server to the master node exceeds the first threshold, the PR lock release information is sent to the master node. The master node of the server retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0098] Step S420: Receive a PR lock acquisition request and obtain PR lock acquisition information, and determine the reservation status of storage resources according to the PR lock acquisition information.
[0099] Specifically, the client receives a PR lock acquisition request from the server and obtains PR lock acquisition information, and determines the reservation status of the storage resource according to the obtained PR lock acquisition information.
[0100] Step S430: When the storage resource reservation is successful, a first connection request is sent, and an I / O uplink and downlink channel of the storage resource layer is established with the server.
[0101] Specifically, when the client determines in step S420 that the storage resource reservation is successful, the client sends a first connection request to the server and establishes an I / O uplink and downlink channel of the storage resource layer with the server.
[0102] In the resource sharing method of the above-mentioned distributed block storage gateway, during the initialization phase, the server elects through the Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes, and the master node controls the slave nodes to acquire and release the storage resource PR lock. Due to the consistency algorithm of Raft, any control node can become the control gateway. After initialization, the server receives the PR lock release request and sends the PR lock acquisition information and the PR lock usage of the corresponding storage resource to the slave node through the master node. When the transmission time of the PR lock acquisition information from the slave node in the server to the master node exceeds the first threshold, the PR lock release information is sent to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage, and updates the persistent reservation mechanism information table based on the application result. Finally, the slave node sends a PR lock acquisition request to the client based on the result of the PR lock application. After receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. Finally, after the storage resource reservation is successful, it sends the first connection request to the server and builds the I / O uplink and downlink channels of the storage resource layer with the server. This method designs a collaborative method based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0103] like Figure 5 and Figure 6 As shown, in one embodiment, a resource sharing solution for a distributed block storage gateway requires classifying the block storage gateway at the gateway access layer into master and slave nodes. Therefore, an etcd component is installed on the gateway to implement the Leader election function of the Raft algorithm.
[0104] The server first needs to collect and summarize the storage resource relationships of all block storage gateways in the gateway access layer and build the same resource access logic on each gateway. The storage resource relationships include the iSCSI network port group, client qualified name (IQN), target qualified name, authentication information, and block resource association logic. Then, the etcd component is deployed on all block storage gateways. After the node is started, an election is performed using the Raft algorithm, so that the access layer is divided into a master node (Master node) and multiple slave nodes (Slave nodes). The master node (Master node) is used to control the slave nodes (Slave nodes) to obtain and release storage resource PR locks. The master node (Master node) will proactively reserve a section of memory space for maintaining the persistent reservation mechanism of the underlying storage resources.
[0105] Clients connect to the gateway access layer on demand and send connection requests to the server to establish I / O uplink and downlink channels with the storage resource layer. Before sending an I / O request, the shared disk client first sends a PR lock (Persistent Reserve) release request (PR OUT request) to the server to the corresponding block storage gateway connected to the gateway access layer. After receiving the PR lock release request (PR OUT request), the corresponding block storage gateway sends a message to the master node to obtain the PR lock.
[0106] After receiving a message from a slave node requesting a PR lock, the master node queries the maintained persistent reservation mechanism information table and sends a PR lock application success or failure message to the slave node based on the usage of the corresponding storage resource PR lock. If the client IQN (client qualified name) is not in use, the master node returns a success message. If the client IQN exists and is the same as the one in the acquisition message, the multi-path high reliability and load balancing scenario is determined, and the application is returned a success message. If the client IQN exists and is different from the one in the acquisition message, the master node returns a failure message. Simultaneously, the master node updates the current gateway and candidate gateway list, namely the persistent reservation mechanism information table. As shown in Table 1, the persistent reservation mechanism information includes the block resource number, PR lock acquisition time, timeout period, client IQN, current gateway, and candidate gateway list. For PR lock release messages, the master node removes the current gateway from the information table until the current gateway is empty and a candidate gateway is selected from the candidate gateway list to send a PR lock acquisition success message.
[0107] Table 1 Persistent reservation mechanism information table
[0108] Block resource number Get time Timeout Client IQN Current Gateway Candidate gateway list 1 t1 t2 IQN1 3,4 1,5 2 t3 t4 IQN3 1 7,6,2 3 … t5 … … … 4 … … … … … … … … … … …
[0109] The slave node receives the message indicating whether the PR lock is acquired successfully and sends a PR lock acquisition request (PR IN request) to the shared disk client. The client determines the reservation status of the storage resource based on the received PR lock acquisition message (PR IN message). If the reservation is successful, the I / O request can be issued through the established I / O channel.
[0110] It should be noted that after the block storage gateway successfully obtains the PR lock, it needs to promptly block the I / O channel and release the PR lock within the timeout period set by the master node (Master node). The on-demand access of the client to the gateway indicates that there may be different usage scenarios, namely, the same client uses multipath technology to connect to storage resources through different storage gateways to achieve load balancing and high reliability, and different clients connect to the same resource through the storage gateway layer to use shared disks.
[0111] The above-described distributed block storage gateway resource sharing solution is compatible with existing distributed storage system architectures. At the block storage gateway access layer, the Raft algorithm is used to select a master node and slave nodes to acquire and release the storage resource's persistent lock. This consensus algorithm allows any node to become the master. In theory, clients can access any distributed gateway without worrying about the failure of the SCSI persistent reservation mechanism. The underlying storage cluster also does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause data corruption on the shared disk. Therefore, this solution designs a collaborative approach at the gateway access layer based on the persistent reservation mechanism, ensuring that PR locks do not fail due to establishing I / O channels across multiple block storage gateways. This unifies the block gateway access layer in shared storage resource scenarios, ensuring that each gateway has the same resource access logic. Multipathing technology reduces failover time, improves system reliability and load balancing, and makes the shared disk functionality of the block storage gateway access layer transparent to both upper-layer clients and the underlying distributed storage cluster.
[0112] like Figure 7 As shown, in one embodiment, a resource sharing system of a distributed block storage gateway is applied to a server, and includes a first election module 710 , a first processing module 720 , a second processing module 730 and a first sending module 740 .
[0113] The first election module 710 is used to perform elections through the Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0114] The first processing module 720 is configured to receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and acquire PR lock usage of the corresponding storage resource.
[0115] The second processing module 730 searches the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock, and updates the persistent reservation mechanism information table according to the application result.
[0116] The first sending module 740 is used to send a PR lock acquisition request through the slave node according to the application result. The PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
[0117] In the resource sharing system for the distributed block storage gateway described above, during the initialization phase, the first election module uses the Raft algorithm to conduct an election, dividing the gateway access layer into a master node and multiple slave nodes. The master node then controls the slave nodes to acquire and release storage resource PR locks. Due to the Raft consensus algorithm, any control node can become the control gateway. After initialization, the first processing module receives a PR lock release request and sends PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the slave node via the master node. The master node retrieves the persistent reservation mechanism information table via the second processing module and sends the PR lock application result to the slave node based on the PR lock usage status, and updates the persistent reservation mechanism information table based on the application result. Finally, the slave node sends a PR lock acquisition request to the client via the first sending module based on the success or failure of the PR lock application. After receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the reservation status of the storage resource based on the PR lock acquisition information. The system has designed a collaborative method based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0118] like Figure 8 As shown, in one embodiment, a resource sharing system of a distributed block storage gateway is applied to a server, including a first election module 810, a first processing module 820, a first feedback module 830, a second processing module 840, a first sending module 850 and a first receiving module 860.
[0119] The first election module 810 is used to perform elections through the Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks.
[0120] The first processing module 820 is configured to receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and acquire PR lock usage of the corresponding storage resource.
[0121] The first feedback module 830 is configured to send PR lock release information to the master node when the duration of sending the PR lock acquisition information from the slave node to the master node exceeds a first threshold.
[0122] The second processing module 840 searches the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage. The persistent reservation mechanism information table is updated according to the application result. If there is no used client, the second processing module 840 sends the PR lock application success result to the slave node. If there is a used client and the information is the same as the PR lock acquisition information, the second processing module 840 sends the PR lock application success result to the slave node. If there is a used client and the information is different from the PR lock acquisition information, the second processing module 840 sends the PR lock application failure result to the slave node.
[0123] The first sending module 850 is used to send a PR lock acquisition request through the slave node according to the application result. The PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
[0124] The first receiving module 860 is used to receive a first connection request after the storage resource reservation is successful, and to establish an I / O uplink and downlink channel of the storage resource layer with the client.
[0125] In the resource sharing system of the above-mentioned distributed block storage gateway, during the initialization phase, the first election module uses the Raft algorithm to conduct an election, dividing the gateway access layer into a master node and multiple slave nodes. The master node controls the slave nodes to acquire and release the storage resource PR lock. Due to the consistency algorithm of Raft, any control node can become the control gateway. After initialization, the first processing module receives the PR lock release request and sends the PR lock acquisition information and the PR lock usage of the corresponding storage resource to the slave node through the master node. When the transmission time of the PR lock acquisition information from the slave node to the master node exceeds the first threshold, the PR lock release information is sent to the master node through the first feedback module. The master node retrieves the persistent reservation mechanism information table through the second processing module and sends the PR lock application result to the slave node based on the PR lock usage, and updates the persistent reservation mechanism information table based on the application result. Finally, the slave node sends a PR lock acquisition request to the client through the first sending module based on the success or failure of the PR lock application. After receiving the PR lock acquisition request, the client obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. Finally, the server receives the first connection request from the client through the first receiving module after the storage resource reservation is successful and establishes the I / O uplink and downlink channels of the storage resource layer with the client. The system designs a collaborative method based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the establishment of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multipath technology, improve the system reliability and load balancing capabilities, so that the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail. Moreover, the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0126] like Figure 9 As shown, in one embodiment, a resource sharing system of a distributed block storage gateway is applied to a client and includes a second sending module 910 and a first determining module 920 .
[0127] The second sending module 910 is used to send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource.
[0128] The first determination module 920 is configured to receive a PR lock acquisition request and obtain PR lock acquisition information, and determine a reservation status of storage resources according to the PR lock acquisition information.
[0129] It should be noted that the master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to obtain and release the storage resource PR lock. When the sending time of the PR lock acquisition information from the slave node in the server to the master node exceeds the first threshold, the PR lock release information is sent to the master node. The master node of the server retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0130] In the resource sharing system for the distributed block storage gateway described above, during the initialization phase, the server elects using the Raft algorithm, dividing the gateway access layer into a master node and multiple slave nodes. The master node then controls the slave nodes to acquire and release PR locks for storage resources. Due to Raft's consensus algorithm, any control node can become the control gateway. After initialization, the second sending module sends a PR lock release request to the server. The server sends PR lock acquisition information and the PR lock usage status of the corresponding storage resource to the slave node via the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage status, and updates the persistent reservation mechanism information table based on the application result. Finally, based on the success or failure of the PR lock application, the slave node on the server sends a PR lock acquisition request to the client. Upon receiving the PR lock acquisition request, the client's first judgment module obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. The system has designed a collaborative method based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the construction of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multi-path technology and improve the system reliability and load balancing capabilities. Therefore, the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail, and the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0131] like Figure 10 As shown, in one embodiment, a resource sharing system of a distributed block storage gateway is applied to a client, and includes a second sending module 1010 , a first determining module 1020 and a third sending module 1030 .
[0132] The second sending module 1010 is used to send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource.
[0133] The first determination module 1020 is configured to receive a PR lock acquisition request and obtain PR lock acquisition information, and determine a reservation status of storage resources according to the PR lock acquisition information.
[0134] It should be noted that the master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to obtain and release the storage resource PR lock. When the sending time of the PR lock acquisition information from the slave node in the server to the master node exceeds the first threshold, the PR lock release information is sent to the master node. The master node of the server retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
[0135] The third sending module 1030 is used to send a first connection request after the storage resource reservation is successful, and to establish an I / O uplink and downlink channel of the storage resource layer with the server.
[0136] In the resource sharing system of the above-mentioned distributed block storage gateway, during the initialization phase, the server elects through the Raft algorithm, dividing the gateway access layer into a master node and multiple slave nodes. The master node controls the slave nodes to acquire and release the storage resource PR lock. Due to the consistency algorithm of Raft, any control node can become the control gateway. After initialization, the second sending module sends a PR lock release request to the server. The server sends PR lock acquisition information and the PR lock usage of the corresponding storage resource to the slave node through the master node. When the transmission time of the PR lock acquisition information from the slave node in the server to the master node exceeds the first threshold, the PR lock release information is sent to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node based on the PR lock usage, and updates the persistent reservation mechanism information table based on the application result. Finally, the slave node sends a PR lock acquisition request to the client based on the success or failure of the PR lock application. After receiving the PR lock acquisition request, the client's first judgment module obtains the PR lock acquisition information and determines the storage resource reservation status based on the PR lock acquisition information. Finally, after the storage resource reservation is successful, the third sending module sends a first connection request to the server and establishes an I / O uplink and downlink channel for the storage resource layer with the server. The system designs a collaborative method based on the persistent reservation mechanism at the gateway access layer, so that the PR lock will not fail due to the establishment of I / O channels on multiple block storage gateways. It unifies the block gateway access layer in the shared storage resource scenario, so that each gateway has the same resource access logic in the shared disk scenario. It can reduce the fault switching time through multipath technology, improve the system reliability and load balancing capabilities, so that the client can access any distributed gateway without worrying about whether the SCSI persistent reservation mechanism will fail. Moreover, the underlying storage cluster does not need to consider whether read and write requests from different gateway servers for the same storage resource will cause shared disk data corruption.
[0137] In one embodiment, a computer device is provided. The computer device may be a smart terminal, and its internal structure diagram may be as follows: Figure 11 As shown. The computer device includes a processor, memory, and network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a resource sharing method for a distributed block storage gateway is implemented.
[0138] Those skilled in the art will understand that Figure 11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0139] In one embodiment, a computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0140] In one embodiment, a computer storage medium stores a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0141] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of each of the above-described method embodiments.
[0142] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0143] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0144] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A resource sharing method for a distributed block storage gateway, characterized in that: Applied to the server, the method includes: The Raft algorithm is used to elect nodes so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is used to control the slave nodes to obtain and release storage resource PR locks. Receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain PR lock usage of the corresponding storage resource; By retrieving the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the usage of the PR lock, updating the persistent reservation mechanism information table according to the application result; According to the application result, a PR lock acquisition request is sent through the slave node, where the PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
2. The resource sharing method of the distributed block storage gateway according to claim 1, characterized in that: The retrieving the persistent reservation mechanism information table and sending the PR lock application result to the slave node according to the usage of the PR lock includes: If there is no client in use, a successful PR lock application result is sent to the slave node; If there is a client that has been used and the information is the same as the PR lock acquisition information, a result indicating that the PR lock application is successful is sent to the slave node; If there is a client that has been used and the information is different from the PR lock acquisition information, a result indicating that the PR lock application failed is sent to the slave node.
3. The resource sharing method of the distributed block storage gateway according to claim 1, characterized in that: The receiving of the PR lock release request and sending the PR lock acquisition information to the master node through the slave node comprises: When the duration of the slave node sending the PR lock acquisition information to the master node exceeds a first threshold, the slave node sends PR lock release information to the master node.
4. The resource sharing method of the distributed block storage gateway according to claim 1, characterized in that: The step of sending a PR lock acquisition request through the slave node according to the application result includes: When the storage resource reservation is successful, the first connection request is received, and an I / O uplink and downlink channel of the storage resource layer is established with the client.
5. A resource sharing method for a distributed block storage gateway, characterized in that: Applied to a client, the method includes: Send a PR lock release request, which is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource; Receiving a PR lock acquisition request and obtaining PR lock acquisition information, and determining a reservation status of storage resources according to the PR lock acquisition information; The master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to acquire and release the storage resource PR lock. When the sending time of the PR lock acquisition information sent by the slave node in the server to the master node exceeds a first threshold, the master node sends PR lock release information to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
6. The resource sharing method of the distributed block storage gateway according to claim 5, characterized in that: The step of receiving a PR lock acquisition request and acquiring PR lock acquisition information further includes: When the storage resource reservation is successful, the first connection request is sent, and the I / O uplink and downlink channels of the storage resource layer are established with the server.
7. A resource sharing system for a distributed block storage gateway, characterized in that: Applied to the server, the system includes: A first election module is configured to perform elections using a Raft algorithm, so that the gateway access layer is divided into a master node and multiple slave nodes. The master node is configured to control the slave nodes to acquire and release storage resource PR locks. A first processing module is configured to receive a PR lock release request and send PR lock acquisition information to the master node through the slave node, and obtain PR lock usage of corresponding storage resources; a second processing module, configured to retrieve a persistent reservation mechanism information table and send a PR lock application result to the slave node according to usage of the PR lock, and update the persistent reservation mechanism information table according to the application result; The first sending module is configured to send a PR lock acquisition request through the slave node according to the application result, wherein the PR lock acquisition request is used to trigger the client to obtain PR lock acquisition information and determine the reservation status of storage resources according to the PR lock acquisition information.
8. A resource sharing system for a distributed block storage gateway, characterized in that: Applied to a client, the system includes: A second sending module is configured to send a PR lock release request, wherein the PR lock release request is used to trigger the slave node of the server to send PR lock acquisition information to the master node and obtain the PR lock usage of the corresponding storage resource; a first determination module, configured to receive a PR lock acquisition request and obtain PR lock acquisition information, and determine a reservation status of storage resources according to the PR lock acquisition information; The master node and slave node are elected by the server through the Raft algorithm. The master node is used to control the slave node to acquire and release the storage resource PR lock. When the sending time of the PR lock acquisition information sent by the slave node in the server to the master node exceeds a first threshold, the master node sends PR lock release information to the master node. The master node retrieves the persistent reservation mechanism information table and sends the PR lock application result to the slave node according to the usage of the PR lock and updates the persistent reservation mechanism information table.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 or 5 to 6 are implemented.
10. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 or 5 to 6 are implemented.
Citation Information
Patent Citations
Access method and device for SCSI sharing storage resource for high-availability cluster
CN102984268A
Shared resource access control method and device and equipment
CN107402821A