Resource configuration method and system, electronic device and storage medium
By configuring the collaborative work of management devices and target storage nodes, the problem of user request blocking caused by resource configuration in traditional distributed storage systems is solved, improving the ease of use on the user side.
Patent Information
- Application Number
- CN202110252064.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-08
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-03-08
AI Technical Summary
Traditional resource allocation methods in distributed storage systems can lead to user request blocking, affecting usability on the user side.
The configuration management device receives user requests, generates configuration items, and executes configuration operations by the target storage node. It also receives status information from the target storage node and responds to user query requests by providing status information.
This solves the problem of user request blocking and improves the ease of use for users.
Smart Images

Figure CN112905538B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a resource allocation method, system, electronic device, and storage medium. Background Technology
[0002] For distributed storage systems, it is necessary to provide configuration interfaces to external users to enable user configuration input such as resource configuration.
[0003] Traditional solutions typically employ synchronous semantics, i.e., an imperative resource configuration method. Users send commands requesting resource configuration to the distributed storage system, which then executes the configuration operation and responds to the user with the result. However, in this approach, users must wait for the distributed storage system's command execution result. Before the distributed storage system responds, subsequent business operations, such as receiving other configuration commands from the user, cannot be performed, thus blocking user requests and impacting usability on the user side. Summary of the Invention
[0004] This invention provides a resource allocation method, system, electronic device, and storage medium to solve the problem that resource allocation in traditional solutions can block user requests.
[0005] In a first aspect, the present invention provides a resource allocation method applied to a configuration management device, comprising:
[0006] Receive a configuration request from a user, the configuration request containing configuration resources and configuration operations;
[0007] A configuration item corresponding to the configuration request is generated so that the target storage node performs the configuration operation on the configuration resource according to the configuration item. The target storage node is a storage node in a distributed storage system.
[0008] The system receives status information corresponding to the configuration item sent by the target storage node, wherein the target storage node generates the status information based on the execution result of the configuration operation.
[0009] In response to the user's query request for the configuration resources, the status information is fed back to the user.
[0010] Secondly, the present invention provides a resource allocation method applied to a target storage node in a distributed storage system, comprising:
[0011] In response to a configuration item sent by a configuration management device, a configuration operation is performed on the configuration resource according to the configuration item, wherein the configuration item is generated by the configuration management device after receiving a configuration request from a user, and the configuration request includes the configuration resource and the configuration operation;
[0012] Based on the execution result of the configuration operation, generate status information corresponding to the configuration item;
[0013] The status information is sent to the configuration management device so that the configuration management device can provide feedback to the user after receiving the user's query request for the configuration resources.
[0014] Thirdly, the present invention provides a resource allocation system, including a configuration management device and a distributed storage system, wherein the distributed storage system includes a target storage node;
[0015] The configuration management device is configured to receive configuration requests from users, the configuration requests including configuration resources and configuration operations; generate configuration items corresponding to the configuration requests, so that a target storage node performs the configuration operations on the configuration resources according to the configuration items, the target storage node being a storage node in a distributed storage system; receive status information corresponding to the configuration items sent by the target storage node, wherein the target storage node generates the status information based on the execution result of the configuration operations; and respond to a user's query request for the configuration resources by providing the status information back to the user.
[0016] The target storage node is configured to respond to a configuration item sent by the configuration management device, perform a configuration operation on the configuration resource according to the configuration item, wherein the configuration item is generated by the configuration management device after receiving a configuration request from a user, and the configuration request includes the configuration resource and the configuration operation; generate status information corresponding to the configuration item according to the execution result of the configuration operation; and send the status information to the configuration management device so that the configuration management device can provide feedback to the user after receiving the user's query request for the configuration resource.
[0017] Fourthly, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the resource allocation method described in the first or second aspect above.
[0018] Fifthly, the present invention provides a computer-readable medium having processor-executable non-volatile program code, the program code causing the processor to perform the resource allocation method described in the first or second aspect above.
[0019] In this invention, by setting up a configuration management device, the device receives the user's configuration request, generates configuration items corresponding to the configuration request, and then the target storage node in the distributed storage system performs configuration operations on the configuration resources contained in the configuration request according to the configuration items. The device also receives status information corresponding to the configuration items from the target storage node, responds to the user's query request for configuration resources, and provides feedback status information to the user. This enables the execution of the user's configuration request, solving the problem of blocking user requests caused by the traditional solution where the distributed storage system directly receives the user's configuration request and executes the configuration operation, thus improving the ease of use on the user side. Attached Figure Description
[0020] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0021] Figure 1 This is a flowchart of an embodiment of a resource allocation method provided by the present invention;
[0022] Figure 1-1 -a is a schematic diagram of an embodiment of a configuration view provided by the present invention;
[0023] Figure 1-1 -b is a schematic diagram of an embodiment of a state view provided by the present invention;
[0024] Figure 1-2 -a is the configuration view for write configuration corresponding to volume creation provided by this invention. Figure 1 A schematic diagram of an embodiment;
[0025] Figure 1-2 -b is the status view of the write configuration corresponding to volume creation provided by this invention. Figure 1 A schematic diagram of an embodiment;
[0026] Figure 1-3 -a is the configuration view provided by this invention that indicates successful writing of the response configuration corresponding to volume creation. Figure 1 A schematic diagram of an embodiment;
[0027] Figure 1-3 -b indicates a successful write status of the response configuration corresponding to volume creation provided by this invention. Figure 1 A schematic diagram of an embodiment;
[0028] Figure 1-4 -a is the configuration view for the removal configuration corresponding to volume deletion provided by this invention. Figure 1 A schematic diagram of an embodiment;
[0029] Figure 1-4-b is the status view of the removal configuration corresponding to volume deletion provided by this invention. Figure 1 A schematic diagram of an embodiment;
[0030] Figure 1-5-a This invention provides a configuration view for successful volume deletion, corresponding to the response configuration. Figure 1 A schematic diagram of an embodiment;
[0031] Figure 1-5-b This invention provides a status view of successful removal of the response configuration corresponding to volume deletion. Figure 1 A schematic diagram of an embodiment;
[0032] Figure 2 This is a flowchart of another embodiment of a resource allocation method provided by the present invention;
[0033] Figure 3 This is a schematic diagram of the structure of an embodiment of a resource allocation system provided by the present invention;
[0034] Figure 4 This is a schematic diagram of the structure of an embodiment of an electronic device provided by the present invention. Detailed Implementation
[0035] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0036] In some of the processes described in the specification, claims, and accompanying drawings of this invention, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0037] Distributed storage is a data storage technology. A distributed storage system distributes data across multiple independent devices. The simplest resource configuration scheme for a distributed storage system is to use synchronous semantics (imperative). This means that users use Remote Procedure Call (RPC) or a RESTful Application Programming Interface (RESTful API) to request configuration operations from the distributed storage system. The user sends a command requesting resource configuration to the distributed storage system, which then executes the configuration operation and responds to the user with the result after completion.
[0038] However, in this approach, users need to wait for the command execution result from the distributed storage system. Before the distributed storage system responds to the user with the execution result, subsequent business operations, such as receiving other commands requested by the user, cannot be performed, which will block user requests and affect the ease of use on the user side.
[0039] To address this, the inventors have proposed a technical solution for this invention: a resource allocation method applied to a configuration management device, comprising: receiving a user's configuration request, the configuration request including configuration resources and configuration operations; generating a configuration item corresponding to the configuration request, so that a target storage node performs the configuration operation on the configuration resource according to the configuration item, the target storage node being a storage node in a distributed storage system; receiving status information corresponding to the configuration item sent by the target storage node, wherein the target storage node generates the status information based on the execution result of the configuration operation; and responding to the user's query request for the configuration resource by providing feedback of the status information to the user.
[0040] In this invention, by setting up a configuration management device, the device receives the user's configuration request, generates configuration items corresponding to the configuration request, and then the target storage node in the distributed storage system performs configuration operations on the configuration resources contained in the configuration request according to the configuration items. The device also receives status information corresponding to the configuration items from the target storage node, responds to the user's query request for configuration resources, and provides feedback status information to the user. This enables the execution of the user's configuration request, solving the problem of blocking user requests caused by the traditional solution where the distributed storage system directly receives the user's configuration request and executes the configuration operation, thus improving the ease of use on the user side.
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] like Figure 1 The diagram shown is a flowchart of an embodiment of a verification method provided by the present invention. This method can be applied to a configuration management device and may include the following steps:
[0043] Step 101: Receive the user's configuration request.
[0044] The configuration request may include configuration resources and configuration operations.
[0045] In this embodiment of the invention, the configuration management device can be a management device responsible for managing distributed configuration information, and can employ a distributed, open-source distributed application coordination service (ZooKeeper), etc. In practical applications, a distributed storage system can include various configuration resources, such as storage pools, volumes, snapshots, policies, etc. A storage pool is a group of disks in which a Data Protection Manager (DPM) server stores copies, volume shadow copies, and transfer logs. It can contain pooled storage resources, including solid-state drives (SSDs) and hard disk drives (HDDs). A volume can provide contiguous address space and can belong to a storage pool; volumes can be created under a storage pool. A snapshot can refer to a volume shadow copy, which is a point-in-time copy of a copy stored on the DPM server. A snapshot can be a fast copy of a volume, and snapshots are typically created based on volumes. Policies can specify volume configurations and can include Quality of Service (QoS) policies, etc.
[0046] Configuration operations refer to the commands executed on configuration resources, which can include creation commands, deletion commands, expansion commands, etc. Taking volume resources as an example, configuration operations can include volume creation commands, volume deletion commands, volume expansion commands, etc.
[0047] In practical applications, taking volume creation as an example, the configuration request can include configuration information such as the creation command, volume name (which can be called the volume ID), volume size, storage pool ID to which the volume belongs, and redundancy policy. Taking volume deletion as an example, the configuration request can include configuration information such as the deletion command and volume ID. Taking volume expansion as an example, the configuration request can include configuration information such as the expansion command, volume ID, and the size of the expanded volume.
[0048] In this step, receiving the user's configuration request can be done by receiving a configuration request sent by the user's client. Specifically, the client can respond to the user's configuration request by generating a configuration request containing configuration information such as configuration resources and configuration operations, and then send the configuration request to the configuration management device, which can then receive the user's configuration request.
[0049] Step 102: Generate configuration items corresponding to the configuration request, so that the target storage node performs the configuration operation on the configuration resource according to the configuration items.
[0050] The target storage node can be any storage node in the distributed storage system.
[0051] Upon receiving a user's configuration request, the configuration resources contained in the request can be written to the configuration management device. In practical applications, the configuration management device can provide a configuration view to save its configuration information. Writing configuration resources to the configuration management device can be done by writing the configuration resources to the configuration view of the configuration management device. The configuration resources written to this configuration view can be called configuration items. Therefore, writing configuration resources to the configuration view signifies the generation of configuration items, and the generation of these configuration items indicates that the configuration has been successfully written to the user.
[0052] Based on this configuration item, the target storage node of the distributed storage system can perform configuration operations on the configuration resource corresponding to this configuration item. Optionally, since the distributed storage system contains a large number of configuration resources, each configuration item can be assigned a unique identifier to facilitate differentiation between them. This identifier can be a Universally Unique Identifier (UUID). The target storage node of the distributed storage system can then perform configuration operations on the configuration resource corresponding to the configuration item based on the UUID.
[0053] Step 103: Receive the status information corresponding to the configuration item sent by the target storage node.
[0054] The target storage node generates the status information based on the execution result of the configuration operation.
[0055] Configuration items in the configuration management device allow target storage nodes in a distributed storage system to perform corresponding configuration operations on configuration resources. Taking volume creation as an example, the configuration items corresponding to volume creation allow the target storage node to obtain relevant configuration information, such as the volume's name, size, storage pool, and policy. The node then requests the storage pool to create a volume with the corresponding policy and size. After successful creation, the node saves the volume name and other attributes to the storage pool, completing the configuration operation. Furthermore, the target storage node can generate status information related to the configuration items based on the execution results of the configuration operations.
[0056] In practical applications, in addition to the configuration view, the configuration management device can also provide a status view. This status view can correspond to the configuration view, allowing the target storage node in the distributed storage system to write status information into the status view, thereby saving the status of user configuration items. Therefore, in this step, receiving the status information sent by the target storage node can mean receiving the status information written by the target storage node in the status view; this status information written in the status view can be called a status item.
[0057] In practical applications, such as Figure 1-1 -a is a schematic diagram of a configuration view provided by a configuration management device. Correspondingly, as shown in Figure 1. Figure 1-1 -b is a schematic diagram of a status view provided for configuration management devices.
[0058] Step 104: In response to the user's query request for the configuration resources, provide the user with the status information.
[0059] The configuration management device can store status information for users to query. Specifically, in response to a user's query request for a configuration resource, the configuration management device can return the status information corresponding to that configuration resource to the user. In practical applications, the user can poll the status item in the status view of the configuration resource in the configuration management device to determine whether the configuration was successful. If successful, the device can then acknowledge successful configuration to the user.
[0060] In this embodiment, by setting up a configuration management device, the configuration management device receives the user's configuration request, generates configuration items corresponding to the configuration request, and then the target storage node in the distributed storage system performs configuration operations on the configuration resources contained in the configuration request according to the configuration items. The device also receives status information corresponding to the configuration items sent by the target storage node, responds to the user's query request for configuration resources, and provides feedback status information to the user. This enables the execution of the user's configuration request, solves the problem of blocking user requests caused by the traditional solution where the distributed storage system directly receives the user's configuration request and executes the configuration operation, thus improving the ease of use on the user side.
[0061] In practical applications, invalid user configuration requests may occur, affecting configuration efficiency. Therefore, to improve configuration efficiency, after receiving a user's configuration request, it can be validated. Thus, in some embodiments, the method for receiving a user's configuration request may include:
[0062] The configuration server receives a verified configuration request sent by the configuration server after receiving the configuration request sent by the user.
[0063] In this embodiment of the invention, a configuration server can be used to receive configuration requests from users. The user's client can send a configuration request to the configuration server, allowing the server to perform parameter validation on the request, such as validating the name, size, and other attributes. Taking volume creation as an example, after receiving a volume creation configuration request, the configuration server can validate the volume size included in the request, such as checking if the size is too large; if so, the validation fails. It can also validate the volume name, such as checking if the name is duplicated; if duplicated, the validation fails.
[0064] If the verification fails, the configuration server can directly send the failed configuration request to the user, effectively returning a failure message. If the verification succeeds, the configuration server can send the successful configuration request to the configuration management device, such as writing the successful configuration request into the configuration view of the configuration management device to generate configuration items, thus confirming to the user that the configuration was written successfully. In this case, the configuration request received by the configuration management device is the successful configuration request sent by the configuration server.
[0065] By setting up a configuration server, configuration requests sent by users are preferentially verified, and configuration requests that pass verification are written to the configuration management device. This avoids the configuration management device performing the verification operation, reduces the operation of the configuration management device, and improves the efficiency of resource configuration.
[0066] In practical applications, considering the execution status of the target storage node in response to the configuration request, the status information corresponding to the configuration item sent by the target storage node to the configuration management device can be implemented in different ways.
[0067] As an optional implementation, when the target storage node successfully executes the configuration operation, this status information can be the first status information.
[0068] When this first state information is written into the state view to generate a state item, it can be represented by "Active". Therefore, "Active" in a state item indicates that the state corresponding to the configuration item is ready, meaning that the configuration operation corresponding to that configuration item has been successfully executed.
[0069] Taking volume creation as an example, such as Figure 1-2 The diagram shown in -a illustrates the configuration view for the write configuration corresponding to volume creation. Within this view, "Volume-0" represents the configuration item corresponding to volume creation, and "Storage Pool-0" represents the storage pool to which the volume belongs. Figure 1-2 The -b diagram illustrates the status view for creating the corresponding write configuration for the volume.
[0070] Based on this, such as Figure 1-3 The diagram shown in -a illustrates the configuration view where the response configuration for volume creation has been successfully written. The "Volume-0" field in this view represents the configuration item corresponding to volume creation, and "Storage Pool-0" represents the storage pool to which the volume belongs. Figure 1-3 As shown in -b, this is a schematic diagram of the status view where the corresponding response configuration for the volume has been successfully written. The "Volume-0-state("Active")" contained in this status view can represent the status item corresponding to the "Volume-0" configuration item. "Active" can indicate that the configuration was executed successfully.
[0071] Taking volume deletion as an example, such as Figure 1-4 The image shown (-a) illustrates the configuration view for the removal configuration corresponding to volume deletion. The "Storage Pool-0" field in this configuration view represents a storage pool. For example... Figure 1-4 The diagram shown in -b illustrates the status view of the removal configuration corresponding to volume deletion. The "Volume-0-state("Active")" field in this status view represents the status item corresponding to the "Volume-0" configuration item, and "Active" indicates that the configuration was executed successfully. At this point, the "Volume-0" configuration item has been removed from the configuration view.
[0072] Based on this, such as Figure 1-5-a The image shows a schematic diagram of the configuration view indicating a successful volume deletion response. The "Storage Pool-0" field in this configuration view represents the storage pool to which the volume belongs. Figure 1-5-b The diagram shows the status view of the response configuration for volume deletion being successfully removed. The "Volume-0" configuration item is no longer present in either the configuration view or the status view. At this point, the status of the "Volume-0" configuration item has been updated in the status view.
[0073] The above diagrams of configuration views and status views are illustrated using the creation and deletion of volume resources as an example. The configuration views and status views of other configuration resources included in the distributed storage system can be referred to the above diagrams, and will not be illustrated one by one here.
[0074] As an alternative implementation, when the target storage node fails to perform the configuration operation, the status information can be the second status information.
[0075] When this second status information is written into the status view to generate a status item, it can be represented by terms such as "failed" or "broken". Therefore, "failed" or "broken" in the status item indicates that the status corresponding to the configuration item is not ready, and the configuration has not been successfully executed.
[0076] In practical applications, when the target storage node fails to execute the configuration operation, it may be due to system anomalies, such as network anomalies, target storage node anomalies, or device anomalies. In distributed storage systems, configuring resources involves updating metadata. For example, when performing a volume creation operation, metadata needs to be recorded in the storage pool to which the volume belongs, and the metadata needs to be persisted to disk; when performing a volume deletion operation, the metadata in the storage pool to which the volume belongs needs to be updated, and so on. Furthermore, when performing a volume creation operation, the metadata persistence to disk in the storage pool to which the volume belongs may be asynchronous, meaning the metadata is stored in memory. In this case, if a system anomaly occurs, the cached metadata in memory may disappear, thus preventing the configuration operation from executing successfully. Therefore, when the anomaly is repaired, the unsuccessfully executed configuration operation needs to be replayed for re-execution. Therefore, in some embodiments, the resource configuration method may further include:
[0077] The target storage node writes a transaction corresponding to the configuration request. The transaction contains the configuration resources and the configuration operation. The transaction is written to the configuration management device by the target storage node before executing the configuration operation.
[0078] To enable the replay and re-execution of unsuccessful configuration operations during anomaly repair, the target storage node can initiate a transaction corresponding to the acquired configuration item before executing the configuration operation. This transaction is then written to the configuration management device to record the configuration item and its corresponding configuration operation content. The configuration management device can then store the transaction corresponding to the configuration request. For easy mapping to the configuration item, this transaction can also be assigned a unique transaction number, such as based on the configuration item's UUID. The configuration operation content recorded in this transaction can include the execution progress of the configuration operation; for example, in the case of volume deletion, the progress can be recorded as 10%, 20%, 30%, etc.
[0079] The configuration management device stores transactions so that, in the event of an anomaly, the configuration operations recorded in the transactions can be replayed to re-execute the configuration operations that failed to execute.
[0080] Based on this, if a system anomaly occurs, the target storage node may contain incomplete configuration operations, and correspondingly, the configuration management device may contain incomplete transactions. Therefore, the method may further include:
[0081] In response to a read request triggered by the target storage node after an anomaly repair, the transaction is provided to the target storage node so that the target storage node can execute an incomplete configuration request based on the transaction, wherein the read request corresponds to the incomplete configuration request;
[0082] The system receives third status information corresponding to the configuration item sent by the target storage node; wherein, the target storage node can generate the third status information after executing an incomplete configuration request based on the transaction; the configuration item corresponds to the configuration request;
[0083] The second state information is updated with the third state information.
[0084] When the configuration management device receives a transaction read request from the target storage node corresponding to an incomplete configuration request, it can provide the requested transaction to the target storage node so that the target storage node can replay the configuration operations recorded in the transaction to re-execute the configuration operation.
[0085] Furthermore, after the target storage node re-executes the configuration operation, it can generate third status information corresponding to the configuration item. The configuration management device can then receive this third status information sent by the target storage node. Since this third status information is generated by the target storage node based on the execution result of the configuration operation after the anomaly is resolved, and the configuration operation was not affected by the system anomaly at this time, this third status information can be status information indicating successful configuration corresponding to the configuration item. Therefore, the configuration management device can update the second status information based on this third status information.
[0086] Specifically, the determination of this third state information can be implemented in several ways. As one optional implementation, if the target storage node stores metadata corresponding to the transaction, then the third state information is determined based on the metadata.
[0087] In practical applications, the target storage node can first determine whether it stores metadata corresponding to the configuration operation. Taking volume creation as an example, if the target storage node already stores metadata corresponding to the volume creation, it means that the system anomaly did not affect the storage of metadata on disk when the target storage node performs the volume creation configuration operation. Therefore, there is no need to restore the metadata, and the third status information corresponding to the configuration item can be directly generated based on the already stored metadata.
[0088] As another optional implementation, if the target storage node does not store metadata corresponding to the transaction, the transaction is re-executed, and the third state information is determined based on the execution result of the transaction.
[0089] Taking volume creation as an example, if the target storage node does not store the metadata corresponding to the volume creation, it indicates that the system abnormality has affected the storage of metadata on disk when the target storage node performs the volume creation configuration operation. If the metadata is not successfully written to disk, the transaction needs to be re-executed, the metadata needs to be stored again, and the third status information is determined based on the execution result of the transaction.
[0090] By setting up transactions corresponding to configuration items, if a system anomaly occurs on the target storage node before it updates the status items of the configuration management device, causing inconsistencies between the configuration status stored on the target storage node and the configuration status displayed in the configuration management device, the incomplete configuration operations can be replayed based on the configuration operations recorded in the transaction to re-execute the incomplete configuration operations, thus ensuring configuration consistency.
[0091] In practical applications, considering that a distributed storage system contains multiple storage nodes, this method may further include the following to improve resource allocation efficiency:
[0092] In response to the coordinator's listening to the configuration item, the configuration item is provided to the coordinator so that the coordinator can determine the target storage node from the distributed storage system and send a notification including the identification information of the configuration item to the target storage node;
[0093] Receive the read request sent by the target storage node based on the identification information of the configuration item;
[0094] The configuration items are sent to the target storage node based on the identification information.
[0095] In this embodiment of the invention, the coordinator can refer to a configuration scheduler, which can be used to monitor updates to configuration items in the configuration management device and determine the target storage node for executing the configuration item. The coordinator can be applied in a configuration server or can be used independently as a separate server, establishing a long connection with the configuration management device to monitor configuration item updates. The configuration management device can then respond to the coordinator's monitoring of configuration items and provide the configuration items to the coordinator, enabling the coordinator to determine the target storage node from the distributed storage system and send a notification containing the identification information of the configuration item to the target storage node, notifying the target storage node to perform configuration operations according to the configuration item. The coordinator's determination of the target storage node from the distributed storage system based on the configuration item can be based on a preset load balancing strategy, such as random, hash, or designated node, without specific limitations here.
[0096] Furthermore, the configuration management device can receive a read request corresponding to a configuration item sent by the target storage node, and send the configuration item to the target storage node for configuration operation.
[0097] By setting up a coordinator, the storage node corresponding to the configuration request is determined without requiring the user to specify the storage node to be configured. This avoids exposing the internal implementation details of the distributed storage system to the user and improves the ease of use of the storage side.
[0098] like Figure 2 The diagram shown is a flowchart of another embodiment of a resource configuration method provided by this invention. This method can be applied to a target storage node and may include the following steps:
[0099] Step 201: In response to the configuration item sent by the configuration management device, perform configuration operations on the configuration resource according to the configuration item. The configuration item is generated by the configuration management device after receiving the user's configuration request. The configuration request may include configuration resources and configuration operations.
[0100] In response to a configuration item sent by the configuration manager, the target storage node in the distributed storage system can perform configuration operations on the configured resource according to the configuration item. This configuration item can be generated by the configuration management device after receiving a configuration request from the user and provided to the target storage node. The configuration request can include the configuration resource and the configuration operation.
[0101] In practical applications, distributed storage systems can include various configuration resources, such as storage pools, volumes, snapshots, and policies. The configuration operations corresponding to these resources can also include various operation commands, such as create commands, delete commands, and expand commands. Taking volume creation as an example, the configuration request can include configuration information such as the creation command, volume ID, volume size, the storage pool ID to which the volume belongs, and redundancy policies. The configuration management device can generate corresponding configuration items based on this configuration request and provide them to the target storage node. The target storage node can then obtain the configuration information corresponding to the configuration item and execute the configuration operation based on this information. Specifically, the target storage node can apply to the storage pool to which the volume belongs to create a volume with the corresponding policy and size, and after successful creation, save the volume ID and other attributes to the storage pool.
[0102] Taking volume deletion as an example, the configuration request can include deletion instructions, volume ID, and other configuration information. The configuration management device can generate configuration items based on this configuration request and provide them to the target storage node. The target storage node can then obtain the configuration information corresponding to the configuration items and perform the configuration operation. Specifically, the target storage node can apply to the storage pool to which the volume belongs to delete the volume with the corresponding volume ID, and after successful deletion, remove the volume ID and other attributes from the storage pool.
[0103] Step 202: Generate status information corresponding to the configuration item based on the execution result of the configuration operation.
[0104] In this embodiment, the configuration management device provides a configuration view and a status view. The configuration resource written in the configuration view can be a configuration item, facilitating user saving of their configuration. Correspondingly, the status view can write status information corresponding to the configuration item, allowing the target storage node to save the status of the user's configuration item. This can include configuration success status, configuration failure status, etc. The target storage node can then generate status information corresponding to the configuration item based on the execution result of the configuration operation.
[0105] Step 203: Send the status information to the configuration management device so that the configuration management device can provide the status information to the user after receiving the user's query request for the configuration resources.
[0106] The target storage node can send the generated status information to the configuration management device, so that the configuration management device can provide feedback on the status information to the user. Specifically, the target storage node can write the status information into the status view provided by the configuration management device to generate a status item. This status item can be queried by the user. For example, the user can poll to determine whether the configuration resource has been configured successfully in the status view of the configuration management device. If successful, the user can be informed that the configuration was successful.
[0107] In this embodiment, based on a configuration management device and a distributed storage system, the target storage node in the distributed storage system performs configuration operations on the configuration resources contained in the configuration request according to the configuration items corresponding to the configuration request provided by the configuration management device. Based on the execution result of the configuration operation, it generates status information corresponding to the configuration items and sends the status information to the configuration management device to respond to the user's query request for configuration resources and provide feedback on the status information to the user. This solves the problem in traditional solutions where the distributed storage system directly receives the user's configuration request and executes the configuration operation, which leads to the blocking of user requests and improves the ease of use on the user side.
[0108] In practical applications, when the target storage node successfully executes the configuration operation, the status information corresponding to the configuration item is generated based on the execution result of the configuration operation. This first status information can be represented as Active in the status view. That is, when the status item is Active, it indicates that the configuration operation corresponding to that configuration item was executed successfully.
[0109] When the target storage node fails to execute the configuration operation, a second status information is generated based on the execution result of the configuration operation, corresponding to the configuration item. This second status information can be represented in the status view using terms such as "failed" or "broken." In other words, a status item of "failed" or "broken" indicates that the configuration operation corresponding to that configuration item failed to execute successfully.
[0110] In practical applications, when the target storage node fails to execute the configuration operation, it may be due to system anomalies, such as network anomalies, target storage node anomalies, or device anomalies. In distributed storage systems, configuring resources involves updating metadata. For example, when performing a volume creation operation, metadata needs to be recorded in the storage pool to which the volume belongs, and then persisted to disk; when performing a volume deletion operation, the metadata in the storage pool to which the volume belongs needs to be updated, and so on. Furthermore, when performing a volume creation operation, the metadata is persisted to disk asynchronously in the storage pool to which the volume belongs, meaning the metadata is stored in memory. In this case, if a system anomaly occurs, the cached metadata in memory may disappear, preventing the configuration operation from executing successfully. Therefore, when the anomaly is repaired, the unsuccessful configuration operation needs to be replayed for re-execution. Thus, in some embodiments, the method may further include:
[0111] Before executing the configuration operation, the transaction corresponding to the configuration request is written to the configuration management device so that the configuration management device can store the transaction, which includes the configuration resource and the configuration operation.
[0112] Before executing the configuration operation, the target storage node can initiate a transaction corresponding to the acquired configuration item and write the transaction to the configuration management device to record the configuration item and the content of the corresponding configuration operation. To facilitate mapping to the configuration item, the transaction can also be assigned a unique transaction number, such as based on the configuration item's UUID. Then, when executing the configuration operation corresponding to the configuration item, the process of the configuration operation can be recorded in the transaction. Specifically, when the target storage node requests the creation of a volume with the corresponding policy and size from the storage pool to which the volume belongs, it can record the execution progress of the request in the transaction, such as "Started request for creation," "Creation in progress," or "Request for creation completed." Furthermore, after successful creation, when the target storage node saves attributes such as the volume ID to the storage pool, it can record the saved execution progress in the transaction, such as "Saved 10%," "Saved 50%," or "Saved 100%."
[0113] The target storage node writes the transaction to the configuration management device. This allows the target storage node to replay the configuration operations recorded in the transaction during anomaly recovery, thus re-executing the configuration operations that failed to execute.
[0114] Based on this, if a system anomaly occurs, the target storage node may contain incomplete configuration operations, and correspondingly, the configuration management device may contain incomplete transactions. Therefore, the method may further include:
[0115] After the anomaly is fixed, a read request is sent to the configuration management device, the read request corresponding to the configuration request that was not completed.
[0116] Receive the transaction provided by the configuration management device, and execute the configuration request that has not been completed based on the transaction;
[0117] After executing an incomplete configuration request, determine the third status information corresponding to the configuration item; the configuration item corresponds to the configuration request.
[0118] The third status information is sent to the configuration management device so that the configuration management device updates the second status information with the third status information.
[0119] After an anomaly repair, if the target storage node has incomplete configuration operations, it can send a read request corresponding to the incomplete configuration request to the configuration management device to obtain the transaction corresponding to that configuration request. After obtaining the transaction provided by the configuration management device, the target storage node can determine the third status information corresponding to the configuration item. Specifically, the target storage node can replay the configuration operations recorded in the transaction to re-execute the incomplete configuration operations and generate third status information upon completion. Since this third status information is generated based on the execution result of the configuration operations after the anomaly repair, and the configuration operations were not affected by the system anomaly, this third status information can be status information indicating successful configuration corresponding to the configuration item. Then, this third status information can be sent to the configuration management device so that the configuration management device can update the second status information based on it.
[0120] Specifically, the method for determining the third state information corresponding to the configuration item may include:
[0121] Determine whether the target storage node stores the corresponding metadata;
[0122] If so, then determine the third status information corresponding to the configuration item based on the metadata;
[0123] If not, re-execute the transaction and determine the third state information based on the execution result of the transaction.
[0124] After obtaining an incomplete transaction from the configuration management device, the target storage node can first determine whether it stores the corresponding metadata. Taking volume creation as an example, if the target storage node already stores the metadata corresponding to the volume creation, it indicates that the system anomaly did not affect the storage of metadata on disk when the target storage node performed the volume creation configuration operation. Therefore, there is no need to restore the metadata, and the third status information corresponding to the configuration item can be directly generated based on the already stored metadata.
[0125] If the target storage node does not store the metadata corresponding to the volume creation, it indicates that a system anomaly has affected the storage of metadata on disk when the target storage node performs the volume creation configuration operation. Since the metadata has not been successfully written to disk, the transaction needs to be re-executed, the metadata needs to be re-stored, and the third status information needs to be determined based on the execution result of the transaction.
[0126] By setting up transactions corresponding to configuration items, if a system anomaly occurs on the target storage node before it updates the status items of the configuration management device, causing inconsistencies between the configuration status stored on the target storage node and the configuration status displayed in the configuration management device, the incomplete configuration operations can be replayed based on the configuration operations recorded in the transaction to re-execute the incomplete configuration operations, thus ensuring configuration consistency.
[0127] In practical applications, considering that a distributed storage system contains multiple storage nodes, this method may further include the following to improve resource allocation efficiency:
[0128] The system receives a notification from the coordinator that includes the identification information of the configuration items and the identification information of the target storage node. The target storage node is determined by the coordinator from the distributed storage system based on the configuration items, which are provided to the coordinator by the configuration management device.
[0129] A read request is sent to the configuration management device based on the identification information;
[0130] Receive the configuration items sent by the configuration management device.
[0131] The coordinator, which can refer to a configuration scheduler, can monitor updates to configuration items in the configuration management device and determine the storage node to execute the configuration item. The target storage node can receive a notification from the coordinator including the identifier information of the configuration item, and send a read request to the configuration management device based on this identifier information to obtain the corresponding configuration item. This notification may also include the identifier information of the target storage node. The coordinator can determine the target storage node from the distributed storage system based on the configuration item provided by the configuration management device and notify the target storage node to perform the configuration operation according to the configuration item. In practical applications, the coordinator can determine the target storage node from the distributed storage system based on the configuration item according to a preset load balancing strategy, such as random, hash, or designated node; no specific limitation is made here.
[0132] Furthermore, the target storage node can receive configuration items sent by the configuration management device to perform configuration operations. By setting a coordinator, the storage node corresponding to the configuration request is determined without requiring the user to specify the storage node to be configured, thus avoiding exposing the internal implementation details of the distributed storage system to the user and improving the usability of the storage side.
[0133] like Figure 3 The diagram shown is a structural schematic of an embodiment of a resource allocation system provided by the present invention, including a configuration management device and a distributed storage system, wherein the distributed storage system includes a target storage node;
[0134] The configuration management device is configured to receive configuration requests from users, the configuration requests including configuration resources and configuration operations; generate configuration items corresponding to the configuration requests, so that a target storage node performs the configuration operations on the configuration resources according to the configuration items, the target storage node being a storage node in a distributed storage system; receive status information corresponding to the configuration items sent by the target storage node, wherein the target storage node generates the status information based on the execution result of the configuration operations; and respond to a user's query request for the configuration resources by providing the status information back to the user.
[0135] The target storage node is configured to respond to a configuration item sent by the configuration management device, perform a configuration operation on the configuration resource according to the configuration item, wherein the configuration item is generated by the configuration management device after receiving a configuration request from a user, and the configuration request includes the configuration resource and the configuration operation; generate status information corresponding to the configuration item according to the execution result of the configuration operation; and send the status information to the configuration management device so that the configuration management device can provide feedback to the user after receiving the user's query request for the configuration resource.
[0136] In this embodiment, by setting up a configuration management device, the configuration management device receives the user's configuration request, generates configuration items corresponding to the configuration request, and then the target storage node in the distributed storage system performs configuration operations on the configuration resources contained in the configuration request according to the configuration items. The device also receives status information corresponding to the configuration items sent by the target storage node, responds to the user's query request for configuration resources, and provides feedback status information to the user. This enables the execution of the user's configuration request, solves the problem of blocking user requests caused by the traditional solution where the distributed storage system directly receives the user's configuration request and executes the configuration operation, thus improving the ease of use on the user side.
[0137] like Figure 4 The diagram shown is a structural schematic of an embodiment of an electronic device provided by the present invention, including a memory 401 and a processor 402; the memory 401 stores a computer program that can run on the processor, and the processor 402 executes the computer program to implement the above-described... Figure 1 or Figure 2 The resource configuration method shown in the embodiment.
[0138] In this embodiment, by setting up a configuration management device, the configuration management device receives the user's configuration request, generates configuration items corresponding to the configuration request, and then the target storage node in the distributed storage system performs configuration operations on the configuration resources contained in the configuration request according to the configuration items. The device also receives status information corresponding to the configuration items sent by the target storage node, responds to the user's query request for configuration resources, and provides feedback status information to the user. This enables the execution of the user's configuration request, solves the problem of blocking user requests caused by the traditional solution where the distributed storage system directly receives the user's configuration request and executes the configuration operation, thus improving the ease of use on the user side.
[0139] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0140] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to traditional solutions, can be embodied in the form of software products. These computer software products can be stored in computer-readable storage media, such as ROM / RAM, magnetic disks, optical disks, etc., and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or certain parts of the embodiments.
[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A resource allocation method, characterized in that, Applied to configuration management devices, including: Receive a configuration request from a user, the configuration request containing configuration resources and configuration operations; generate configuration items corresponding to the configuration request, so that a target storage node performs the configuration operation on the configuration resources according to the configuration items, the target storage node being any storage node in the distributed storage system; The target storage node writes a transaction corresponding to the configuration request, the transaction containing the configuration resources and the configuration operation, and the transaction is written to the configuration management device by the target storage node before executing the configuration operation; The system receives status information corresponding to the configuration item sent by the target storage node, wherein the target storage node generates the status information based on the execution result of the configuration operation. In response to the user's query request for the configuration resource, the status information is fed back to the user; The method further includes: In response to the coordinator's listening to the configuration item, the configuration item is provided to the coordinator so that the coordinator can determine the target storage node from the distributed storage system and send a notification including the identification information of the configuration item to the target storage node; Receive the read request sent by the target storage node based on the identification information of the configuration item; The configuration items are sent to the target storage node based on the identification information; When an exception occurs during the configuration operation of the target storage node, the method further includes: In response to a read request triggered by the target storage node after an anomaly repair, the transaction is provided to the target storage node so that the target storage node can execute an incomplete configuration request based on the transaction, wherein the read request corresponds to the incomplete configuration request.
2. The method according to claim 1, characterized in that, The target storage node generates the status information based on the execution result of the configuration operation, including: When the target storage node successfully executes the configuration operation, the status information is the first status information; When the target storage node fails to execute the configuration operation, the status information is the second status information.
3. The method according to claim 2, characterized in that, The method further includes: The system receives third status information corresponding to the configuration item sent by the target storage node, wherein the target storage node generates the third status information after executing a configuration request that has not been completed based on the transaction; the configuration item corresponds to the configuration request. The second state information is updated with the third state information.
4. The method according to claim 3, characterized in that, If the target storage node stores metadata corresponding to the transaction, then the third state information is determined based on the metadata; If the target storage node does not store metadata corresponding to the transaction, the transaction is re-executed, and the third state information is determined based on the execution result of the transaction.
5. The method according to claim 1, characterized in that, The process of receiving a user's configuration request includes: The configuration server receives a verified configuration request sent by the configuration server after receiving the configuration request sent by the user.
6. A resource allocation method, characterized in that, A target storage node applied in a distributed storage system, wherein the target storage node is any storage node in the distributed storage system; including: In response to a configuration item sent by a configuration management device, a configuration operation is performed on the configuration resource according to the configuration item, wherein the configuration item is generated by the configuration management device after receiving a configuration request from a user, and the configuration request includes the configuration resource and the configuration operation; The transaction corresponding to the configuration request is written to the configuration management device. The transaction includes the configuration resource and the configuration operation. The transaction is written to the configuration management device by the target storage node before the configuration operation is executed. Based on the execution result of the configuration operation, generate status information corresponding to the configuration item; The status information is sent to the configuration management device so that the configuration management device can return the status information to the user after receiving the user's query request for the configuration resource; The method further includes: The system receives a notification from the coordinator that includes the identification information of the configuration items and the identification information of the target storage node. The target storage node is determined by the coordinator from the distributed storage system based on the configuration items, and the configuration items are provided to the coordinator by the configuration management device. A read request is sent to the configuration management device based on the identification information of the configuration item; Receive the configuration items sent by the configuration management device; When an exception occurs during the configuration operation of the target storage node, the method further includes: After the anomaly is fixed, a read request is sent to the configuration management device, the read request corresponding to the configuration request that was not completed. The system receives the transaction provided by the configuration management device and executes any incomplete configuration requests based on the transaction. The read request corresponds to any incomplete configuration requests.
7. The method according to claim 6, characterized in that, The step of generating status information corresponding to the configuration item based on the execution result of the configuration operation includes: When the configuration operation is successfully executed, first status information corresponding to the configuration item is generated; If the configuration operation is not successfully executed, a second status information corresponding to the configuration item is generated.
8. The method according to claim 7, characterized in that, The method further includes: After executing an incomplete configuration request, determine the third status information corresponding to the configuration item; the configuration item corresponds to the configuration request. The third status information is sent to the configuration management device so that the configuration management device updates the second status information with the third status information.
9. The method according to claim 8, characterized in that, The determination of the third status information corresponding to the configuration item includes: Determine whether the target storage node stores the corresponding metadata; If so, then determine the third status information corresponding to the configuration item based on the metadata; If not, re-execute the transaction and determine the third status information corresponding to the configuration item based on the execution result of the transaction.
10. A resource allocation system, characterized in that, It includes configuration management equipment and a distributed storage system, wherein the distributed storage system includes a target storage node, and the target storage node is any storage node in the distributed storage system; The configuration management device is configured to receive configuration requests from users, the configuration requests including configuration resources and configuration operations; generate configuration items corresponding to the configuration requests; and, in response to the coordinator's listening to the configuration items, provide the configuration items to the coordinator so that the coordinator can determine the target storage node from the distributed storage system and send a notification including the identification information of the configuration items to the target storage node. Receive the read request sent by the target storage node based on the identification information of the configuration item; The configuration item is sent to the target storage node according to the identification information, so that the target storage node performs the configuration operation on the configuration resource according to the configuration item. The target storage node is a storage node in a distributed storage system. The target storage node writes a transaction corresponding to the configuration request, the transaction containing the configuration resources and the configuration operation, and the transaction is written to the configuration management device by the target storage node before executing the configuration operation; The system receives status information corresponding to the configuration item sent by the target storage node, wherein the target storage node generates the status information based on the execution result of the configuration operation; responds to the user's query request for the configuration resource and provides the status information back to the user; when an exception occurs during the execution of the configuration operation by the target storage node, in response to a read request triggered by the target storage node after the exception is resolved, the system provides the transaction to the target storage node so that the target storage node can execute the incomplete configuration request based on the transaction, wherein the read request corresponds to the incomplete configuration request; The target storage node is configured to receive a notification from the coordinator including the identification information of the configuration item and the identification information of the target storage node. The target storage node is determined by the coordinator from the distributed storage system based on the configuration item, which is provided to the coordinator by the configuration management device. The node is configured to: send a read request to the configuration management device based on the identification information of the configuration item; receive the configuration item sent by the configuration management device; and, in response to the configuration item sent by the configuration management device, perform a configuration operation on the configuration resource based on the configuration item. The configuration item is generated by the configuration management device after receiving a configuration request from a user, and the configuration request includes the configuration resource and the configuration operation. The node is also configured to: write a transaction corresponding to the configuration request to the configuration management device. The system includes the configuration resources and the configuration operations, wherein the transaction is written to the configuration management device by the target storage node before executing the configuration operations; status information corresponding to the configuration items is generated based on the execution result of the configuration operations; the status information is sent to the configuration management device so that the configuration management device can provide feedback to the user after receiving the user's query request for the configuration resources; when an exception occurs during the execution of the configuration operations by the target storage node, after the exception is resolved, a read request is sent to the configuration management device, the read request corresponding to an incomplete configuration request; the system receives the transaction provided by the configuration management device, and executes the incomplete configuration request based on the transaction, the read request corresponding to the incomplete configuration request.
11. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described in any one of claims 1 to 9.
12. A computer-readable medium having processor-executable non-volatile program code, characterized in that, The program code causes the processor to execute the method described in any one of claims 1 to 9.
Citation Information
Patent Citations
Node resource management method and device and storage medium
CN111459676A