Method and device for creating cloud disk in distributed storage system and electronic equipment
By creating cloud disks in slices in a distributed storage system and controlling the number and distribution of slices on the cloud server, the problem of cloud disk performance degradation caused by cloud server crashes is solved, and the effect of reducing the explosion radius of a single machine and improving cloud disk performance is achieved.
Patent Information
- Application Number
- CN202410303046.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-09-16
AI Technical Summary
In a distributed storage system, cloud server downtime leads to poor cloud disk performance, a large explosion radius for a single server, and affects all cloud disks. Existing technologies make it difficult to effectively reduce the explosion radius of a single server to improve cloud disk performance.
By creating cloud disks in slices in a distributed storage system, controlling the number and distribution of slices on the cloud server, setting different single-machine explosion radiuses, and using the fault-tolerant mechanism to reserve idle slices, we can ensure that the number of cloud disks affected when a cloud server goes down is minimized.
While ensuring the performance of the cloud disk, the single-machine explosion radius of the cloud server is reduced, the overall performance of the cloud disk is improved, and the impact on the cloud disk when the cloud server goes down is reduced.
Smart Images

Figure CN120658762A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud storage technology, and in particular to a method, device, and electronic device for creating a cloud disk in a distributed storage system. Background Art
[0002] With the development of cloud computing technology and the explosive growth of data, cloud computing has penetrated into various industries, and storage services have become ubiquitous. A large number of services run on cloud servers and utilize a large number of storage services. Block storage provides cloud servers with low-latency, persistent, and highly reliable block-level random access storage, making it the most widely used storage service. To access the services provided by block storage, users can create cloud disks in a distributed storage system. To leverage the concurrency of multiple cloud servers in a distributed storage system, the cloud disk to be created can be divided into multiple logical units based on the logical address space. These logical units are then mapped to multiple cloud servers, ensuring that each cloud server has at least one logical unit of the cloud disk. Based on the mapping between logical units and cloud servers, cloud disks can then be created on each cloud server in the distributed storage system.
[0003] With the above approach, each cloud server serves all cloud disks. This results in a large impact radius for each cloud server. If any cloud server goes down, all cloud disks are affected, resulting in poor performance. Therefore, how to create cloud disks in a distributed storage system to improve performance and reduce the impact radius has become a major concern for those skilled in the art. Summary of the Invention
[0004] The present invention provides a method, device, and electronic device for creating a cloud disk in a distributed storage system, which can improve the performance of the cloud disk and reduce the explosion radius of a single machine. The technical solution is as follows:
[0005] In a first aspect, a method for creating a cloud disk in a distributed storage system is provided, the method comprising:
[0006] In response to a request to create a target cloud disk, determining a first number of slices of the target cloud disk based on a first number of cloud disks served by the distributed storage system, a target single-server explosion radius corresponding to the first number, a second number of cloud servers included in the distributed storage system, and a target storage space of the target cloud disk;
[0007] Determine, based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual single-machine explosion radius of each cloud server, a distribution method of the multiple slices of the target cloud disk on the distributed storage system, where the distribution method indicates a mapping relationship between the logical units and slices of the target cloud disk, and a mapping relationship between the slices of the target cloud disk and cloud servers;
[0008] According to the distribution method, the target cloud disk is created on the corresponding cloud server of the distributed storage system.
[0009] In a second aspect, a device for creating a cloud disk in a distributed storage system is provided, the device comprising:
[0010] A first determining module is configured to, in response to a request to create a target cloud disk, determine a first number of slices of the target cloud disk based on a first number of cloud disks served by the distributed storage system, a target single-machine explosion radius corresponding to the first number, a second number of cloud servers included in the distributed storage system, and a target storage space of the target cloud disk;
[0011] A second determining module is configured to determine a distribution method of the multiple slices of the target cloud disk on the distributed storage system based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual single-machine explosion radius of each cloud server, wherein the distribution method is used to indicate a mapping relationship between the logical units and slices of the target cloud disk, and a mapping relationship between the slices of the target cloud disk and cloud servers;
[0012] A creation module is used to create the target cloud disk on the corresponding cloud server of the distributed storage system according to the distribution method.
[0013] In a third aspect, an electronic device is provided, comprising a processor and a memory; the memory stores at least one program code; the at least one program code is used to be called and executed by the processor to implement the method for creating a cloud disk in a distributed storage system as described in the first aspect.
[0014] In a fourth aspect, a computer-readable storage medium is provided, in which at least one computer program is stored. When the at least one computer program is executed by a processor, it can implement the method for creating a cloud disk in a distributed storage system as described in the first aspect.
[0015] In a fifth aspect, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, it can implement the method for creating a cloud disk in a distributed storage system as described in the first aspect.
[0016] The beneficial effects of the technical solution provided by the embodiments of the present application are:
[0017] Cloud disks are created on each cloud server of the distributed storage system in slices, rather than logical units. This allows the single-machine explosion radius of the cloud server to be controlled by controlling the number of slices of the cloud disk on the cloud server. In addition, different single-machine explosion radii are set for the cloud servers of the cloud disks in the distributed storage system based on the number of cloud disks served by the cloud servers. The single-machine explosion radius can meet the performance of the cloud disk, and when any cloud server goes down, the number of cloud disks affected will not be too large. When a request to create a disk for a target cloud disk is received, the first number of slices of the target cloud disk is determined based on the first number of cloud disks currently served by the distributed storage system, the target single-machine explosion radius corresponding to the first number, the second number of cloud servers included in the distributed storage system, and the target storage space of the target cloud disk. Then, based on the first number of slices of the target cloud disk, the distribution method of the multiple slices of the target cloud disk on the distributed storage system is determined, and then the target cloud disk is created in the distributed storage system according to the distribution method, thereby reducing the single-machine explosion radius of the cloud server while ensuring the performance of the target cloud disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 This is a schematic diagram of a distribution method of cloud disks in a distributed storage system in the related art;
[0020] Figure 2 This is a flow chart of a method for creating a cloud disk in a distributed storage system provided by an embodiment of the present application;
[0021] Figure 3 This is a schematic diagram of a distribution method of cloud disks in a distributed storage system provided in an embodiment of the present application;
[0022] Figure 4 This is a schematic diagram of a cloud disk distribution process in a distributed storage system provided by an embodiment of the present application;
[0023] Figure 5 This is a schematic diagram of the structure of a device for creating a cloud disk in a distributed storage system provided by an embodiment of the present application;
[0024] Figure 6 A structural block diagram of an electronic device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0026] It should be understood that the terms "each," "plurality," and "any" used in the embodiments of this application include two or more, "each" refers to each of the corresponding plurality, and "any" refers to any one of the corresponding plurality. For example, if a plurality of words includes 10 words, "each" refers to each of the 10 words, and "any" refers to any one of the 10 words.
[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0028] Before executing the embodiments of the present application, the terms involved in the embodiments of the present application are first explained.
[0029] Computer downtime, also known as "crash" or "freeze," refers to the phenomenon that a computer (including server) operating system is unable to recover from a serious system error, or a problem occurs at the system hardware level, causing the system to be unresponsive for a long time and forcing the computer to be restarted.
[0030] A distributed storage system is software that runs on multiple cloud servers and works collaboratively, providing programming interfaces similar to block devices, such as block read and write interfaces. This distributed storage system consists of a scheduling device at the upper layer and a storage cluster at the lower layer. The scheduling device determines the distribution of cloud disks based on user account creation requests and manages the cloud disks in the distributed storage system. A storage cluster consists of multiple cloud servers, which can be linked together through software to provide external storage services.
[0031] A cloud server is a server used to process requests in a distributed storage system and store user data.
[0032] A cloud disk (Device) is a block device corresponding to a user's virtual machine and can be used to store user data.
[0033] A logical unit (Segment) refers to the unit into which the cloud disk is divided according to the logical address space. Each logical unit is ultimately stored on a cloud server at the back end.
[0034] The explosion radius of a single server refers to the number of cloud disks affected by a cloud server outage. If a cloud disk has a logical unit stored on a cloud server, the cloud disk will be affected when the cloud server goes down.
[0035] Cloud storage is a new concept that has been extended and developed from the concept of cloud computing. A distributed cloud storage system refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide data storage and access functions to the outside world. Cloud storage is mainly aimed at cloud customers running on the cloud provider's hardware. These functions can meet a variety of different needs and all support pay-per-use. In the cloud storage model, the provider is responsible for maintaining the underlying hardware and ensuring the availability, elasticity, and security of the data. Common cloud storage types include object storage, block storage, and file storage, and this application is applied to block storage scenarios.
[0036] Distributed storage systems typically include multiple cloud servers, which concurrently provide block storage services, potentially servicing tens of thousands or even more cloud disks. To meet the performance requirements of cloud disks, cloud disks are typically divided into multiple logical units, which are then stored on different cloud servers. This leverages the concurrent performance of multiple cloud servers to provide block storage services. Figure 1 A schematic diagram showing the cloud disk distribution in a distributed storage system provided by related technologies is shown in FIG. Figure 1 The distributed storage system includes multiple cloud servers, such as Server 1, Server 2, ..., Server x. Devices can be divided into multiple logical units, such as Segment 0, Segment 1, Segment 2, ..., Segment n. These logical units are distributed across multiple cloud servers, with each cloud server storing at least one logical unit. Cloud server Server 1 stores logical unit Segment 0, cloud server Server 2 stores logical units Segment 1 and Segment 2, and cloud server Server x stores logical unit Segment n. This approach can leverage the concurrent performance of multiple cloud servers, but the explosion radius of a single cloud server is large. If any cloud server fails, all cloud disks in the distributed storage system will be affected, resulting in poor performance of the cloud disks in the distributed storage system.
[0037] To this end, an embodiment of the present application provides a method for creating a cloud disk in a distributed storage system. This method controls the distribution of cloud disk slices on cloud servers, minimizing the number of cloud disks affected by a downtime of any cloud server while maintaining cloud disk performance. Specifically, the method defines a slice distribution model for the distributed storage system. The slice distribution model is used to determine the number of slices into which the cloud disk is divided and the distribution of the cloud disk slices within the storage cluster of the distributed storage system, thereby creating a cloud disk on the storage cluster of the distributed storage system based on the distribution model.
[0038] Next, the slice distribution model defined in the embodiments of the present application is introduced.
[0039] First, this embodiment of the application assumes that the storage cluster of the distributed storage system includes S cloud servers. To facilitate subsequent analysis and calculation, the performance parameters of the S cloud servers are assumed to be the same. This embodiment of the application also assumes that the distributed storage system serves D cloud disks. When the distributed storage system serves D cloud disks, the target single-server explosion radius of each cloud server in the distributed storage cluster is N.
[0040] In addition, the embodiment of the present application adds an intermediate layer, namely, a slice (represented by Partition), between the logical unit (Segment) of the cloud disk and the cloud server (abbreviated as bs), and creates a cloud disk in a distributed storage system in units of slices. Since the cloud disk is stored in units of slices on the cloud server, as long as a slice of the cloud disk is stored on the cloud server, the cloud server will serve the cloud disk. Therefore, the single-machine explosion radius of the cloud server is related to whether the cloud server stores the slices of the cloud disk, and has nothing to do with the number of logical units of the cloud disk stored on the cloud server. By introducing the concept of slices, there is no need to care about the number of logical units divided into the cloud disk, but it is necessary to care about the number of shards into which the cloud disk is divided, and the distribution method of the slices of the cloud disk on the cloud server, thereby converting the original how to determine the distribution method of the logical units of the cloud disk on the cloud server to how to determine the distribution method of the slices of the cloud disk on the cloud server, and how to allocate the logical units of the cloud disk to the slices.
[0041] Based on the above settings, this application implements the solution using D cloud disks, S cloud servers, and the target explosion radius N of a single cloud server as input conditions to solve the first number of slices X of the cloud disk. This first number of slices can be the maximum number of slices that the cloud disk can be divided into while ensuring that the performance of the cloud disk and the explosion radius of the single cloud server do not exceed the expected value. The solution process is as follows:
[0042] Assuming that the number of cloud disks served by each cloud server fills the target single-machine explosion radius N, the total number of cloud disks served by the storage cluster = S*N. Assuming that the storage space (DeviceSize) of D cloud disks is the same, the theoretical first slice number of each cloud disk is X = (S*N) / D. Taking into account the actual scenario, the storage space of each cloud disk is different, and thus the number of first slices that each cloud disk can be divided into must be different. For this reason, the embodiment of the present application introduces a slice number weight Y for each cloud disk. By calculating the slice number weight of each cloud disk, the first slice number of each cloud disk can be determined. In order to calculate the slice number weight of each cloud disk, the embodiment of the present application assumes that the average storage space of D cloud disks is Davg, and the storage space of the cloud disk to be created is Ds. Then the slice number weight Y of the cloud disk is Y = Ds / Davg. Correspondingly, the first slice number Xi of the cloud disk is X*(Ds / Davg) = (Ds / Davg)*(S*N) / D.
[0043] Generally speaking, if the number of slices of a cloud disk is greater, the high concurrency performance of the distributed storage system will be utilized, and the data reading speed of the cloud disk will be faster. However, the more slices the cloud disk is divided into, the larger the explosion radius of the cloud server will be. If the number of slices of a cloud disk is less, the explosion radius of the cloud server will be smaller. However, the fewer the number of slices, the less likely it is to utilize the concurrency of multiple cloud servers, which will affect the performance of the cloud disk and cause the data reading and writing speed of the cloud disk to be slower. Therefore, in order to ensure the performance of the cloud disk, the embodiment of the present application needs to determine the second number of slices of the cloud disk after determining the first number of slices of the cloud disk. The second number of slices can be determined based on the performance parameters of the cloud disk (such as throughput, IOPS (Input / Output Operations Per Second, the number of read and write operations per second), etc.).
[0044] After determining the number of first slices and the number of second slices of the cloud disk, the next step is to distribute the logical units divided by the cloud disk to multiple slices, that is, to determine the mapping relationship between the logical units and slices of the cloud disk. Considering that as long as the number of shards of the cloud disk does not exceed the upper limit, the number of logical units in each slice has no effect on the single-machine explosion radius of the cloud server, but has an impact on the performance of the cloud disk and the cloud server, in order to ensure the performance of the cloud disk and the cloud server, the embodiment of the present application can use the performance of the cloud disk and the cloud server as a constraint condition when distributing the multiple logical units divided by the cloud disk to multiple slices. For example, if the cloud disk requires at least two cloud servers to store, the logical units divided by the cloud disk can be evenly distributed to at least two slices.
[0045] When determining the mapping between cloud disk slices and cloud servers, the actual per-server explosion radius of the cloud server and the number of cloud disk slices stored on each cloud server can be used as constraints. Under the premise that the actual per-server explosion radius of the cloud server does not exceed the target per-server explosion radius and that the number of cloud disk slices stored on each cloud server is at most one, the cloud disk slices are allocated to the cloud servers that meet these two conditions. The allocation can be based on the order of cloud disk identification or can be random.
[0046] Furthermore, considering that cloud servers may crash during operation, in order to improve the performance of cloud disks and avoid cloud disks being unusable when cloud servers crash, idle slices can be reserved based on a fault-tolerant mechanism. Specifically, based on the first number of slices and the second number of slices of the cloud disk, multiple physical slices and multiple idle slices can be determined for the cloud disk. Each physical slice includes at least one logical unit of the cloud disk. When any cloud server crashes, the data on the physical slice of the cloud disk on that cloud server is scheduled to the idle slice, thereby ensuring the normal use of the cloud disk. For example, if the number of slices of a cloud disk is in the range [4,8], 7 slices can be determined as physical slices to carry user data, and the remaining slice can be used as an idle slice. When the cloud server where any physical slice is located crashes, the data on the physical slice can be migrated to the idle slice.
[0047] In addition, considering that the number of cloud disks served by the distributed storage system changes dynamically, when a new cloud disk is created or a created cloud disk is deleted in the distributed storage system, the number of cloud disks in the distributed storage system will change. In the embodiment of the present application, the number of first slices of the cloud disk = (Ds / Davg)*(S*N) / D. When the number D of cloud disks in the distributed storage system changes, Davg also changes with the number of cloud disks, and the number of first slices determined for the cloud disk also changes accordingly. In response to the above problem, the embodiment of the present application can set a single-machine explosion radius for the cloud server in a manner that increases the single-machine explosion radius by a gradient. Specifically, the single-machine explosion radius of the cloud server under different number ranges can be set for different number ranges of cloud disks served by the distributed storage system. For example, when the number range of cloud disks is 0 to 5000, the single-machine explosion radius of the cloud disk is set to 256. For every 5000 cloud disks added, the single-machine explosion radius of the cloud disk increases by 256. In this way, when the number range of cloud disks is 5001 to 10000, the single-machine explosion radius of the cloud disk is set to 512; when the number range of cloud disks is 10001 to 15000, the single-machine explosion radius of the cloud disk is set to 768. The embodiment of the present application sets a single-machine explosion radius for the cloud server for different number ranges of cloud disks, which not only meets the performance requirements of the cloud disk, but also does not affect the number of cloud disks affected when any cloud server goes down. In addition, when the created cloud disk is deleted in the distributed storage system, the single-machine explosion radius of the cloud server will decrease, so there is no need to recalculate the number of first slices of the cloud disk.
[0048] The embodiment of the present application defines a model for controlling the explosion radius of a single cloud server in a distributed storage system, thereby making data scheduling in a storage cluster more flexible while meeting the requirements of the explosion radius of a single cloud server in the storage cluster.
[0049] The embodiment of the present application provides a method for creating a cloud disk in a distributed storage system. Taking the scheduling device to execute the embodiment of the present application as an example, see Figure 2 , the method process provided in the embodiment of the present application includes:
[0050] 201. In response to a request to create a target cloud disk, determine the first number of slices of the target cloud disk based on the first number of cloud disks served by the distributed storage system, the target single-machine explosion radius corresponding to the first number, the second number of cloud servers included in the distributed storage system, and the target storage space of the target cloud disk.
[0051] Among them, the first number of slices can be the maximum number of slices that the cloud disk can be divided into while ensuring that the performance of the cloud disk and the single-machine explosion radius of the cloud server do not exceed expectations. When a user account needs to obtain the service provided by the cloud disk, the user account can send a disk creation request for the target cloud disk to the distributed storage system. When the scheduling device in the distributed storage system receives the disk creation request, it obtains the first number of cloud disks served by the distributed storage system. Since the embodiment of the present application sets the single-machine explosion radius of the cloud server for different number ranges of cloud disks, the target single-machine explosion radius corresponding to the first number can be obtained based on the first number. In response to the disk creation request, the second number of cloud servers included in the distributed storage system and the target storage space of the target cloud disk will also be obtained, and then the first number of slices of the target cloud disk will be determined based on the first number of cloud disks served by the distributed storage system, the target single-machine explosion radius corresponding to the first number, the second number of cloud servers included in the distributed storage system and the target storage space of the target cloud disk. Specifically, the following steps may be included:
[0052] 2011. Obtain a maximum value of a preset quantity range to which the first quantity belongs as a third quantity.
[0053] In this embodiment of the present application, different ranges of cloud disk quantities are pre-set. Based on the pre-set ranges of cloud disk quantities, it is possible to determine that the first quantity falls within the pre-set range, and then obtain the maximum value of the pre-set range as the third value. For example, if the first quantity is 200, then the range of the first quantity can be obtained as 0-5000, and the third quantity can be obtained as 5000.
[0054] 2012. Determine the number of first slices of the target cloud disk based on the second number, the third number, the target single-machine explosion radius, and the target storage space of the target cloud disk.
[0055] In the embodiment of the present application, the number of first slices of the target cloud disk is determined based on the second number, the third number, the target single-machine explosion radius, and the target storage space of the target cloud disk. The following method can be used:
[0056] 20121. Based on the second quantity, the third quantity, and the target single-machine explosion radius, determine the theoretical number of first slices of each cloud disk when the distributed storage system serves the third number of cloud disks.
[0057] Among them, the theoretical first slice number is the first slice number of the cloud disk calculated under the assumption that the storage space of each cloud disk in the distributed storage system is the same. Specifically, based on the second number of cloud servers included in the distributed storage system and the target single-machine explosion radius of the cloud servers, the total number of cloud disks served by the distributed storage system can be determined, and then the ratio of the total number of cloud disks to the third number can be calculated to obtain the theoretical first slice number. For example, the number of cloud servers included in the distributed storage system is S, the third number is D, and the target single-machine explosion radius of the cloud servers is N. Then, when the distributed storage system serves the third number of cloud disks, the theoretical first slice number of each cloud disk is (S*N) / D.
[0058] 20122. Based on the theoretical number of first slices and the target storage space, determine the number of first slices of the target cloud disk.
[0059] The theoretical first number of slices calculated in the above step 20121 is the first number of slices of the cloud disk calculated assuming that the storage space of each cloud disk in the distributed storage system is the same. In fact, the storage space of each cloud disk in the distributed storage system is not exactly the same, and the number of slices that can be divided into cloud disks with different storage spaces is different. In order to more accurately determine the first number of slices of the target cloud disk, the embodiment of the present application can determine the first number of slices of the target cloud disk based on the theoretical first number of slices and the target storage space. Specifically, the theoretical average storage space of each cloud disk when the distributed storage system serves a third number of cloud disks can be obtained. The theoretical average storage space can be estimated under the assumption that the storage space of the third number of cloud disks is the same. Then, the ratio of the target storage space to the theoretical average storage space is calculated to obtain the slice number weight of the target cloud disk. Based on the obtained slice number weight of the target cloud disk, the first number of slices of the target cloud disk can be obtained by calculating the product of the slice number weight and the theoretical first number of slices.
[0060] For example, when the distributed storage system serves the third number of cloud disks, the theoretical average storage space of each cloud disk is Davg, and the target storage space of the target cloud disk is Ds. Then the weight of the number of slices of the target cloud disk is Ds / Davg. By multiplying the weight of the number of slices and the theoretical first number of slices, the first number of slices of the target cloud disk can be obtained as (Ds / Davg)*(S*N) / D.
[0061] 202. Based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual explosion radius of each cloud server, determine a distribution method for the multiple slices of the target cloud disk on the distributed storage system.
[0062] The distribution mode is used to indicate the mapping relationship between logical units and slices, as well as the mapping relationship between slices of the target cloud disk and cloud servers.
[0063] In one possible implementation, determining a distribution method for the multiple slices of the target cloud disk on the distributed storage system based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual explosion radius of each cloud server includes the following steps:
[0064] 20211. Allocate the multiple logical units of the target cloud disk to the fourth number of physical slices.
[0065] In an embodiment of the present application, slices are divided into physical slices and idle slices based on whether the slices carry user data. The physical slice can carry user data and may include at least one logical unit. The idle slice does not carry any user data. For any slice, its type is not fixed and will change as user data migrates. For example, if a slice is a physical slice and the cloud server where the slice is located goes down, the data on the slice will be migrated to other cloud servers, and the slice will become an idle slice; for another example, if a slice is an idle slice and the data on other physical slices is migrated to the slice, the slice will become a physical slice.
[0066] Among them, the fourth number is less than or equal to the first number of slices. For example, if the first number of slices is 8, the fourth number can be 6. When allocating the logical units of the target cloud disk to the fourth number of physical slices, the logical units of the target cloud disk can be randomly allocated to the fourth number of physical slices, or the logical units of the target cloud disk can be evenly distributed to the fourth number of physical slices. For example, if the target cloud disk is divided into 60 logical units, the 60 logical units can be randomly allocated to 6 physical slices, or the 60 logical units can be evenly distributed to 6 physical slices. By allocating multiple logical units of the target cloud disk to the fourth number of physical slices, a mapping relationship between the logical units and physical slices of the target cloud disk can be established.
[0067] 20212. With the constraints that the actual single-machine explosion radius of each cloud server does not exceed the target single-machine explosion radius, and the number of slices belonging to the target cloud disk on each cloud server is at most one, the fourth number of slices are distributed to multiple cloud servers to obtain a distribution method.
[0068] In this embodiment of the application, for a preset number of cloud disks, the target per-server explosion radius set for each cloud server ensures that the number of cloud disks affected in the event of a cloud server failure is not too large. When creating a disk, the actual per-server explosion radius of each cloud server should not exceed the target per-server explosion radius. Furthermore, to leverage the high concurrency of multiple cloud servers in a distributed storage system and ensure the read and write performance of the target cloud disk, each cloud server should be guaranteed to have at most one slice belonging to the target cloud disk.
[0069] Based on the above, the scheduling device can use the constraints that the actual single-machine explosion radius of each cloud server does not exceed the target single-machine explosion radius, and that the number of slices belonging to the target cloud disk on each cloud server is at most one, to distribute the fourth number of physical slices to multiple cloud servers, thereby obtaining a distribution method for the target cloud disk in the distributed storage system. When distributing the fourth number of physical slices to multiple cloud servers, the fourth number of physical slices can be sequentially distributed to cloud servers that meet the above conditions according to the identifier of the target cloud disk, or the fourth number of physical slices can be randomly distributed to cloud servers that meet the above conditions.
[0070] In another possible implementation, determining a distribution method of the multiple slices of the target cloud disk on the distributed storage system based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual explosion radius of each cloud server includes the following steps:
[0071] 20221. Determine a fifth number of physical slices and a sixth number of free slices based on the second number of slices and the first number of slices of the target cloud disk.
[0072] Among them, the sum of the fifth number and the sixth number is less than or equal to the first number of slices, and the fifth number is greater than the second number of slices and less than the first number of slices. The second number of slices can be the minimum number of slices that the cloud disk can be divided into while ensuring that the performance of the cloud disk and the single-machine explosion radius of the cloud server do not exceed expectations. The second number of slices can be determined based on the performance parameters of the target cloud disk, which can be throughput, IOPS, etc. Specifically, the IOPS of the target cloud disk can be divided by the IOPS of each slice to obtain the second number of slices of the target cloud disk. When determining the fifth number of physical slices and the sixth number of free slices, it is sufficient to meet the requirements of the fifth and sixth numbers. For example, if the second number of slices of the target cloud disk is 4 and the first number of slices is 8, then 5 physical slices and 3 free slices can be determined.
[0073] 20222. Allocate the multiple logical units obtained by slicing the target cloud disk to the fifth number of physical slices.
[0074] 20223. With the constraints that the actual single-machine explosion radius of each cloud server does not exceed the target single-machine explosion radius, and the number of slices belonging to the target cloud disk on each cloud server is at most one, the fifth number of physical slices and the sixth number of idle slices are allocated to multiple cloud servers to obtain a distribution method.
[0075] It should be noted that although the idle slice does not carry user data, it is also part of the target cloud disk. Therefore, when the idle slice is allocated to a cloud server, the cloud server will also serve the target cloud disk, and the single-machine explosion radius of the cloud server will also change.
[0076] Figure 3 A schematic diagram showing the cloud disk distribution method in the distributed storage system determined in the embodiment of the present application is shown. Figure 3 , the cloud disks served by the distributed storage system are Device 1, Device 2, and Device 3, among which the slices divided by Device 1 are Dev 1Part 0, the slices divided by Device 2 are Dev 2Part 0 and Dev 2Part 1, and the slices divided by Device 3 are Dev 3Part 0, Dev 3Part 1, and Dev 3Part 2. The slices divided by Device 1, Device 2, and Device 3 constitute a Partition set, including Dev 1Part 0, Dev 2Part 0, Dev 2Part1, Dev 3Part 0, Dev 3Part 1, and Dev 3Part 2. Based on the cloud disk identifier, the slice order of each cloud disk is scattered (i.e., allocated). In the first round of scattering, Dev 1Part 0 can be scattered to Server 1, Dev 2Part 0 can be scattered to Server 2, and Dev Dev 2 Part 1 is scattered on Server 3. In the second round of scattering, Dev 3 Part 0 can be scattered on Server 1, Dev 3 Part 1 can be scattered on Server 2, and Dev 3 Part 2 can be scattered on Server 3.
[0077] The method provided by the embodiment of the present application can reduce the explosion radius of a single cloud server and improve the performance of the cloud disk. For example, for any cloud disk, the logical units of the cloud disk include Segment 0, Segment 1, Segment 2, ..., Segment n. Figure 1 In the method of the related art shown, the logical unit of the cloud disk is stored on each cloud server, resulting in a large explosion radius of the single cloud server. Figure 4A schematic diagram showing the cloud disk distribution method in the distributed storage system determined in the embodiment of the present application is shown. Figure 4 The cloud disk has three physical slices, namely Partition 0, Partition 1, and Partition 2. The logical units divided by the cloud disk are allocated to Partition 0, Partition 1, and Partition 2. It can be obtained that Partition 0 includes Segment 0 and Segment 2, Partition 1 includes Segment 1, and Partition 2 includes Segment n. Partition 0 is allocated to Server 1 of the distributed storage system, Partition 1 is allocated to Server 2 of the distributed storage system, and Partition 2 is allocated to Server 3 of the distributed storage system. Using the method provided in the embodiment of the application, the logical units of the cloud disk are stored on some cloud servers of the distributed storage system, and the explosion radius of a single cloud server is smaller than that of a single cloud server in the related art.
[0078] 203. Create a target cloud disk on a corresponding cloud server of the distributed storage system according to the distribution method.
[0079] After determining the distribution mode of the target cloud disk on the distributed storage system, slices of the target cloud disk can be created on the corresponding cloud servers of the distributed storage system. When each slice is created, the target cloud disk can be obtained.
[0080] In another embodiment of the present application, after creating a target cloud disk on the corresponding cloud server of the distributed storage system, the scheduling device will also detect the operating status of each cloud server on the distributed storage system. When it is detected that the cloud server where any physical slice of the target cloud disk is located is down, the data on the physical slice can be scheduled to the sixth number of free slices. When scheduling the physical slice of the target cloud disk to the sixth number of free slices, an free slice can be selected from the sixth number of free slices, and then the data on the physical slice can be scheduled to the selected free slice; the data on the physical cloud disk can also be scheduled to the sixth number of free slices at the same time. By loading data simultaneously on multiple free slices, the data loading time can be shortened, and the impact of the cloud server downtime on the target cloud disk can be reduced.
[0081] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.
[0082] Please refer to Figure 5, which shows a schematic diagram of the structure of a device for creating a cloud disk in a distributed storage system provided by an embodiment of the present application. The device can be implemented by software, hardware, or a combination of both, and becomes all or part of an electronic device. The device includes:
[0083] A first determining module 501 is configured to, in response to a request to create a target cloud disk, determine a first number of slices of the target cloud disk based on a first number of cloud disks served by the distributed storage system, a target single-server explosion radius corresponding to the first number, a second number of cloud servers included in the distributed storage system, and a target storage space of the target cloud disk;
[0084] The second determining module 502 is configured to determine a distribution mode of the multiple slices of the target cloud disk on the distributed storage system based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual explosion radius of each cloud server. The distribution mode indicates a mapping relationship between the logical units and slices of the target cloud disk, and a mapping relationship between the slices of the target cloud disk and cloud servers.
[0085] The creation module 503 is used to create a target cloud disk on a corresponding cloud server of the distributed storage system in a distributed manner.
[0086] In another embodiment of the present application, the first determination module 501 is used to obtain the maximum value of the preset quantity range to which the first quantity belongs as the third quantity; based on the second quantity, the third quantity, the target single-machine explosion radius and the target storage space of the target cloud disk, determine the first slice quantity of the target cloud disk.
[0087] In another embodiment of the present application, the first determination module 501 is used to determine the theoretical maximum number of slices, the first number of slices, of each cloud disk when the distributed storage system serves the third number of cloud disks based on the second number, the third number and the target single-machine explosion radius; and determine the maximum number of slices, the first number of slices, of the target cloud disk based on the theoretical maximum number of slices, the first number of slices and the target storage space.
[0088] In another embodiment of the present application, the first determination module 501 is used to determine the total number of cloud disks served by the distributed storage system based on the second number and the target single-machine explosion radius; calculate the ratio of the total number of cloud disks to the third number to obtain the theoretical first slice number.
[0089] In another embodiment of the present application, the first determination module 501 is used to obtain the theoretical average storage space of each cloud disk when the distributed storage system serves a third number of cloud disks; calculate the ratio of the target storage space to the theoretical average storage space to obtain the slice quantity weight of the target cloud disk; calculate the product of the slice quantity weight and the theoretical first slice quantity to obtain the first slice quantity of the target cloud disk.
[0090] In another embodiment of the present application, the second determination module 502 is used to allocate the multiple logical units divided into the target cloud disk to a fourth number of physical slices, where the physical slice includes at least one logical unit, and the fourth number is less than or equal to the first number of slices; with the actual single-machine explosion radius of each cloud server not exceeding the target single-machine explosion radius, and the number of slices belonging to the target cloud disk on each cloud server is at most one as constraints, the fourth number of physical slices are allocated to multiple cloud servers to obtain a distribution method.
[0091] In another embodiment of the present application, the second determination module 502 is used to determine a fifth number of physical slices and a sixth number of free slices based on the second number of slices and the first number of slices of the target cloud disk, where the physical slice includes at least one logical unit, the sum of the fifth number and the sixth number is less than or equal to the first number of slices, and the fifth number is greater than the second number of slices and less than the first number of slices; the multiple logical units divided by the target cloud disk are allocated to the fifth number of physical slices; with the actual single-machine explosion radius of each cloud server not exceeding the target single-machine explosion radius, and the number of slices belonging to the target cloud disk on each cloud server is at most one as constraints, the fifth number of physical slices and the sixth number of free slices are allocated to multiple cloud servers to obtain a distribution method.
[0092] In another embodiment of the present application, the device further comprises:
[0093] The third determining module is used to determine the number of second slices of the target cloud disk according to the performance parameters of the target cloud disk.
[0094] In another embodiment of the present application, the device further comprises:
[0095] The scheduling module is used to schedule the data on the physical slice to the sixth number of idle slices when the cloud server where any physical slice is located crashes.
[0096] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0097] Figure 6 FIG. 6 is a block diagram of an electronic device 600 according to an exemplary embodiment of the present application. Generally, the electronic device 600 includes a processor 601 and a memory 602 .
[0098] The processor 601 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an artificial intelligence processor, which is used to process computing operations related to machine learning.
[0099] The memory 602 may include one or more computer-readable storage media, which may be non-transitory computer-readable storage media, such as CD-ROMs (Compact Disc Read-Only Memory), ROMs, RAMs (Random Access Memory), magnetic tapes, floppy disks, and optical data storage devices. The computer-readable storage media may store at least one computer program, which, when executed, can implement a method for creating a cloud disk in a distributed storage system.
[0100] Of course, the electronic device described above may also include other components, such as input / output interfaces and communication components. The input / output interface provides an interface between the processor and a peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the electronic device and other devices.
[0101] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device 600, and the electronic device 600 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0102] An embodiment of the present application provides a computer-readable storage medium, which stores at least one computer program. When the at least one computer program is executed by a processor, it can implement the method for creating a cloud disk in the above-mentioned distributed storage system.
[0103] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it can implement the above-mentioned method for creating a cloud disk in a distributed storage system.
[0104] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for creating a cloud disk in a distributed storage system, characterized in that: The method comprises: In response to a request to create a target cloud disk, determining a first number of slices of the target cloud disk based on a first number of cloud disks served by the distributed storage system, a target single-server explosion radius corresponding to the first number, a second number of cloud servers included in the distributed storage system, and a target storage space of the target cloud disk; Determine, based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual single-machine explosion radius of each cloud server, a distribution method of the multiple slices of the target cloud disk on the distributed storage system, where the distribution method indicates a mapping relationship between the logical units and slices of the target cloud disk, and a mapping relationship between the slices of the target cloud disk and cloud servers; According to the distribution method, the target cloud disk is created on the corresponding cloud server of the distributed storage system.
2. The method according to claim 1, characterized in that The determining, based on a first number of cloud disks served by the distributed storage system, a target single-machine explosion radius corresponding to the first number, a second number of cloud servers included in the distributed storage system, and a target storage space of the target cloud disk, of a first number of slices of the target cloud disk includes: Obtaining a maximum value of a preset quantity range to which the first quantity belongs as a third quantity; The first slice quantity of the target cloud disk is determined based on the second quantity, the third quantity, the target single-machine explosion radius, and the target storage space of the target cloud disk.
3. The method according to claim 2, characterized in that The determining, based on the second number, the third number, the target single-machine explosion radius, and the target storage space of the target cloud disk, of the first slice quantity of the target cloud disk includes: Determining, based on the second number, the third number, and the target single-machine explosion radius, a theoretical number of first slices for each cloud disk when the distributed storage system serves the third number of cloud disks; Based on the theoretical first slice quantity and the target storage space, the first slice quantity of the target cloud disk is determined.
4. The method according to claim 3, characterized in that The determining, based on the second number, the third number, and the target single-machine explosion radius, of a theoretical number of first slices for each cloud disk when the distributed storage system serves the third number of cloud disks includes: Determining the total number of cloud disks served by the distributed storage system based on the second number and the target single-machine explosion radius; The ratio of the total number of cloud disks to the third number is calculated to obtain the theoretical first slice number.
5. The method according to claim 3, characterized in that The determining the first number of slices of the target cloud disk based on the theoretical first number of slices and the target storage space includes: Obtaining a theoretical average storage space of each cloud disk when the distributed storage system serves the third number of cloud disks; Calculate the ratio of the target storage space to the theoretical average storage space to obtain the slice quantity weight of the target cloud disk; The product of the slice quantity weight and the theoretical first slice quantity is calculated to obtain the first slice quantity of the target cloud disk.
6. The method according to claim 1, characterized in that The determining, based on the first number of slices, the plurality of logical units into which the target cloud disk is divided, and the actual explosion radius of each cloud server, of distributing the plurality of slices of the target cloud disk on the distributed storage system includes: Allocate the multiple logical units obtained by slicing the target cloud disk to a fourth number of physical slices, where the fourth number is less than or equal to the first number of slices, and the physical slice includes at least one logical unit; With the constraints that the actual single-machine explosion radius of each cloud server does not exceed the target single-machine explosion radius, and the number of slices belonging to the target cloud disk on each cloud server is at most one, the fourth number of physical slices are distributed to multiple cloud servers to obtain the distribution method.
7. The method according to claim 1, characterized in that The determining, based on the first number of slices, the plurality of logical units into which the target cloud disk is divided, and the actual explosion radius of each cloud server, of distributing the plurality of slices of the target cloud disk on the distributed storage system includes: Determining a fifth number of physical slices and a sixth number of free slices based on the second number of slices and the first number of slices of the target cloud disk, where the second number of slices is smaller than the first number of slices, a sum of the fifth number and the sixth number is smaller than or equal to the first number of slices, and the fifth number is larger than the second number of slices and smaller than the first number of slices; Allocating the multiple logical units obtained by slicing the target cloud disk to the fifth number of physical slices, where the physical slice includes at least one logical unit; With the constraints that the actual single-machine explosion radius of each cloud server does not exceed the target single-machine explosion radius, and the number of slices belonging to the target cloud disk on each cloud server is at most one, the fifth number of physical slices and the sixth number of idle slices are allocated to multiple cloud servers to obtain the distribution method.
8. The method according to claim 7, characterized in that Before determining the fifth number of physical slices and the sixth number of free slices according to the second number of slices of the target cloud disk and the first number of slices, the method further includes: The number of second slices of the target cloud disk is determined according to the performance parameters of the target cloud disk.
9. The method according to claim 7, characterized in that After the target cloud disk is created on the corresponding cloud server of the distributed storage system, the method further includes: When the cloud server where any physical slice is located crashes, the data on the physical slice is scheduled to the sixth number of idle slices.
10. A device for creating a cloud disk in a distributed storage system, characterized in that: The device comprises: A first determining module is configured to, in response to a request to create a target cloud disk, determine a first number of slices of the target cloud disk based on a first number of cloud disks served by the distributed storage system, a target single-machine explosion radius corresponding to the first number, a second number of cloud servers included in the distributed storage system, and a target storage space of the target cloud disk; A second determining module is configured to determine a distribution method of the multiple slices of the target cloud disk on the distributed storage system based on the first number of slices, the multiple logical units into which the target cloud disk is divided, and the actual single-machine explosion radius of each cloud server, wherein the distribution method is used to indicate a mapping relationship between the logical units and slices of the target cloud disk, and a mapping relationship between the slices of the target cloud disk and cloud servers; A creation module is used to create the target cloud disk on the corresponding cloud server of the distributed storage system according to the distribution method.
11. An electronic device, characterized in that: It includes a processor and a memory; the memory stores at least one program code; the at least one program code is used to be called and executed by the processor to implement the method for creating a cloud disk in a distributed storage system as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, and when the at least one computer program is executed by the processor, it can implement the method for creating a cloud disk in the distributed storage system according to any one of claims 1 to 9.
13. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, it can implement the method for creating a cloud disk in a distributed storage system according to any one of claims 1 to 9.
Citation Information
Patent Citations
Data loading method, device and system
CN110955720A
Volume localization method and device and medium
CN114860166A
Distributed storage system based on fault domain
CN116112512A
Cloud disk scheduling method and system, electronic equipment and storage medium
CN116436934A
Data recovery method and related equipment
CN116841796A