Cache pool management method and device, electronic equipment and storage medium
By automating the management of cache pools in the OpenStack+ceph edge cloud environment, the problem of low cache pool management efficiency is solved, and the creation and deletion of cache pools are automated, thereby improving management efficiency.
Patent Information
- Application Number
- CN202210843816.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-07-18
AI Technical Summary
In a containerized OpenStack+ceph edge cloud environment, existing technologies for managing cache pools are inefficient and require manual command-line input to create and configure cache pools.
A cache pool management method is provided, which automatically retrieves and executes preset instructions after the target component data pool of OpenStack is created, creates and configures the cache pool according to the ceph cluster conditions, including obtaining object storage process grouping information, determining the storage disk type, creating the cache pool using the CRUSH algorithm, and automatically deleting the cache pool when needed.
It improves the management efficiency of cache pools, reduces manual operation steps, and realizes the automated creation and deletion of cache pools, making it convenient for operation and maintenance personnel to quickly deploy and manage them.
Smart Images

Figure CN115357184B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of distributed system storage, and particularly relates to a cache pool management method and device, electronic equipment and a storage medium. BACKGROUND
[0002] Ceph is a distributed file system, and with the continuous updating of the version of ceph, the cache pool technology of ceph is also continuously improved and mature. The so-called cache pool technology is actually to create a storage pool on a faster disk, and then place the storage pool in front of a conventional data pool to serve as a cache. Such a storage pool is a cache pool. In this way, all client I / O operations are first handled by the cache pool, and then the data is written back to the existing data pool, so that the client can enjoy better performance on the cache pool, and the final data is still written back to the data pool.
[0003] OpenStack is an open source cloud computing management platform project, which is a combination of a series of open source software projects. OpenStack provides scalable and elastic cloud computing services for private clouds and public clouds. The project goal is to provide a cloud computing management platform that is easy to implement, scalable, rich, and standard unified.
[0004] Although the cache pool technology of ceph is very mature at present, in the containerized deployment of OpenStack+ceph edge cloud environment, the management scheme of the cache pool provided by the ceph community can only create and configure the cache pool of ceph through manual input of command line, and the management efficiency is low. SUMMARY
[0005] The present application provides a cache pool management method, device, electronic equipment and storage medium to solve the defects in the prior art.
[0006] In a first aspect, the present application provides a cache pool management method, comprising: after determining that the creation of a data pool of a target component of OpenStack is completed, invoking a first preset instruction; executing the first preset instruction to create and configure a cache pool of the data pool.
[0007] According to the cache pool management method provided by the present application, the execution of the first preset instruction to create and configure the cache pool of the data pool comprises: in the case that the ceph cluster meets the condition of creating the cache pool, creating the cache pool; establishing a mapping relationship between the cache pool and the data pool; setting configuration parameters of the cache pool to complete the configuration task of the cache pool.
[0008] According to the cache pool management method provided by the application, in the case that the ceph cluster meets the condition of creating a cache pool, the cache pool is created, including: obtaining object storage process grouping information under a target root in the ceph cluster; determining the number of host groups containing the target object storage process according to the object storage process grouping information; the type of the storage hard disk corresponding to the target object storage process is a solid state disk; in the case that the number is greater than 0, the storage capacity of the solid state disk corresponding to the target object storage process is obtained; the target storage capacity is determined according to the sum of the storage capacity and the number; in the case that the target storage capacity is greater than a preset capacity value, the state of all placement policy groups in the ceph cluster is obtained; in the case that the state is a healthy state, the cache pool is created based on the crush algorithm.
[0009] According to the cache pool management method provided by the application, after the mapping relationship between the cache pool and the data pool is established, the method further includes: in the case that the number is less than a preset value, setting the number of replicas of the cache pool as the number; in the case that the number is greater than or equal to the preset value, setting the number of replicas of the cache pool as the preset value.
[0010] According to the cache pool management method provided by the application, the method further includes: in response to a first operation instruction of a user, invoking a second preset instruction; executing the second preset instruction to delete the cache pool.
[0011] According to the cache pool management method provided by the application, the method further includes: in the case that the ceph cluster exists a pre-created cache pool, obtaining the state of all placement policy groups; in the case that the state is a healthy state and the data in the cache pool is executed to complete the flushing operation and the eviction operation; the mapping relationship between the cache pool and the data pool is removed to delete the cache pool.
[0012] According to the cache pool management method provided by the application, in the case that the ceph cluster exists a pre-created cache pool, the state of all placement policy groups is obtained, including: obtaining the name of each resource pool in the ceph cluster; in the case that a target name is one of all names, obtaining the state of all placement policy groups; the target name is the name of the pre-set cache pool.
[0013] In a second aspect, the application further provides a cache pool management device, including:
[0014] The invoking module is configured to invoke a first preset instruction after determining that the creation of the data pool of the target component of OpenStack is completed.
[0015] The execution module is configured to execute a first preset instruction to create and configure the cache pool of the data pool.
[0016] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the cache pool management method according to any one of the above aspects.
[0017] In a fourth aspect, the present application further provides a non-transitory computer readable storage medium, which stores a computer program executable by a processor to implement the steps of the cache pool management method according to any one of the above aspects.
[0018] The cache pool management method, device and electronic device provided by the present application automatically call a first preset instruction to create and configure the cache pool of the data pool after the creation of the data pool of the target component is completed, without the need to manually input a command line to create and configure the cache pool, thereby improving the management efficiency of the ceph cache pool. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0020] Figure 1 is a flowchart of the cache pool management method provided by the present application;
[0021] Figure 2 is a flowchart of creating a cache pool provided by the present application;
[0022] Figure 3 is a structure diagram of a tree structure provided by the present application;
[0023] Figure 4 is a structure diagram of the cache pool management device provided by the present application;
[0024] Figure 5 is a structure diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] It should be noted that in the description of the embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Unless otherwise expressly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly, for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two elements. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0027] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more.
[0028] The following is combined with Figures 1-5 This invention describes the cache pool management method, apparatus, electronic device, and storage device provided in embodiments of the present invention.
[0029] Figure 1 This is a flowchart illustrating the cache pool management method provided by the present invention, as follows: Figure 1 As shown, including but not limited to the following steps:
[0030] Step 101: After confirming the completion of the creation of the data pool for the target component of the OpenStack cloud platform, retrieve the first preset instruction.
[0031] Step 102: Execute the first preset instruction to create and configure the cache pool of the data pool.
[0032] In a containerized OpenStack+Ceph edge cloud environment, existing methods for creating cache pools involve manually entering command lines. This invention reduces the tedious manual steps by invoking and executing a first preset instruction to create and configure the cache pool for the data pool.
[0033] This invention primarily targets the data pool of a target component created in a Ceph cluster, and creates a corresponding cache pool.
[0034] Optionally, the target component is the OpenStack Cinder component, and the data pool of the Cinder component is the Cinder-volumes pool.
[0035] Specifically, during the system deployment phase, this invention can pre-copy the ceph_cache_pool_create.sh and ceph_cache_pool_create.py files to the / usr / bin directory of each control node in the edge cloud environment using the Ansible tool on the deployment node, and set the permissions to 755.
[0036] Among them, ceph_cache_pool_create.sh is the first calling script. By executing the first calling script, the first preset instruction ceph_cache_pool_create.py is invoked.
[0037] When the deployment in the edge cloud environment is nearing completion, and after the OpenStack Cinder component has created the data pool in the Ceph cluster, the first script ceph_cache_pool_create.sh is automatically executed to retrieve and execute the first preset instruction. This execution of the first preset instruction automatically completes the creation and configuration of the cinder-volumes cache pool.
[0038] Optionally, a switch flag, ceph_ssd_cache, can be set in the deployed code to determine whether the first preset instruction is automatically invoked. If ceph_ssd_cache is set to false, the first preset instruction will not be invoked automatically; if ceph_ssd_cache is set to true, the first preset instruction will be invoked automatically.
[0039] Optionally, if the user configures the deployed code not to automatically call the first preset instruction, during the system's operation and maintenance phase, the operation and maintenance personnel can execute the first invocation script ceph_cache_pool_create.sh through the control node to call the first preset instruction to complete the creation and configuration of the cache pool.
[0040] Optionally, in order to improve the efficiency of deleting the cache pool, the cache pool management method provided by the present invention further includes: responding to a first operation instruction from a user to retrieve a second preset instruction; and executing the second preset instruction to delete the cache pool.
[0041] During the system deployment phase, this invention pre-copys the ceph_cache_pool_remove.py and ceph_cache_pool_remove.sh files to the / usr / bin directory of each control node in the edge cloud environment using the Ansible tool on the deployment node, and sets the permissions to 755.
[0042] During system operation and maintenance, if it is necessary to delete the cache pool, the user can execute the second script ceph_cache_pool_remove.sh on the control node to invoke and execute the second preset instruction ceph_cache_pool_remove.py to delete the cache pool.
[0043] The present invention provides a cache pool management method that, after the creation of the data pool of the target component is completed, automatically calls a first preset instruction to complete the creation and configuration of the cache pool of the data pool, without having to manually enter command lines to create and configure the cache pool, thereby improving the management efficiency of the Ceph cache pool.
[0044] Based on the above embodiments, as an optional embodiment, the present invention provides a cache pool management method, wherein executing a first preset instruction to create and configure a cache pool for the data pool includes: creating the cache pool when it is determined that the Ceph cluster meets the conditions for creating a cache pool; establishing a mapping relationship between the cache pool and the data pool; and setting the configuration parameters of the cache pool to complete the configuration task of the cache pool.
[0045] Figure 2 This is a schematic diagram of the process for creating a cache pool provided by the present invention, as follows: Figure 2 As shown, if the Ceph cluster meets the conditions for creating a cache pool, the cache pool is created, including but not limited to the following steps:
[0046] Step 201: Obtain the object storage process grouping information under the target root in the Ceph cluster.
[0047] A Ceph cluster consists of several object storage daemons (OSDs). Ceph introduces the concept of OSDs when managing storage disks; each disk has its own dedicated OSD process. In short, a Ceph cluster manages physical disks by managing OSDs.
[0048] The storage structure of OSDs can be viewed using the `ceph osd tree` command. Its storage structure is a tree structure. In this invention, the target root is `root default`, where `root` is the root node and `default` is the name of this root. Under `root default` are the host groups, and `osd` nodes are the leaf nodes of the host groups.
[0049] The object storage process grouping information is the information of the host group to which each OSD belongs under the root default.
[0050] Figure 3 This is a schematic diagram of a tree structure provided by the present invention, such as... Figure 3 As shown, the topmost layer is rootdefault, where default is the name of the root. The middle layer includes two host groups: host foo and host bar. host means host, and foo and bar are the host names.
[0051] The bottom ones are the leaf nodes, specifically pointing to osd.0, osd.1, osd.2, and osd.3.
[0052] Step 202: Determine the number of host groups containing the target object storage process based on the object storage process grouping information; the type of storage hard disk corresponding to the target object storage process is a solid-state drive.
[0053] Based on the above embodiments, if the storage hard disk corresponding to osd.0 is a solid-state drive (SSD), and the storage hard disks corresponding to osd.1, osd.2, and osd.3 are mechanical hard drives (HDDs), then the target object storage process is osd.0, and the number of host groups containing the target object storage process is 1.
[0054] In another embodiment, there are a total of 3 host groups under root default. The first host group includes 1 target object storage process, the second host group includes 2 target object storage processes, and the third host group has no target object storage process. Therefore, the number of host groups containing target object storage processes is 2.
[0055] Step 203: If the number is greater than 0, obtain the storage capacity of the solid-state drive corresponding to the target object storage process.
[0056] A cache pool can only be established if there is a host group that includes the target object storage process.
[0057] Step 204: Determine the target storage capacity based on the sum of the storage capacities and the number of storage units.
[0058] Specifically, let the target storage capacity be ssd_total_size, the number of host groups including the target object storage process be ssd_number, and the sum of the storage capacities be total_size, where total_size is the sum of the storage capacities of all solid-state drives.
[0059] Specifically, when ssd_number is less than a preset value (which can be c):
[0060] ssd_total_size=total_size / ssd_number;
[0061] When ssd_number is greater than or equal to the preset value c:
[0062] ssd_total_size = total_size / c; where c can be 3.
[0063] Step 205: If the target storage capacity is greater than the preset capacity value, obtain the status of all placement strategy groups in the Ceph cluster.
[0064] The preset capacity value can be set to 30GB.
[0065] Placement groups (pg) are the basic units that make up storage pools. A cache pool can only be created when a pg is in a healthy state, i.e., active + clean.
[0066] Step 206: If the state is healthy, create the cache pool based on the CRUSH algorithm.
[0067] This invention defines a set of rules for creating a cache pool using the CRUSH algorithm, and establishes the cache pool using these rules. In the first preset instruction, a set of rules is defined as `ssd_rule`, and the cache pool is defined as `ssd_cache`.
[0068] Optionally, it can be determined whether a resource pool named ssd_cache (referred to as pool) already exists. If it does not exist, the task of creating the ssd_cache pool is executed. If the creation is successful, it returns 1; if the creation fails, it returns 0. If the pool named ssd_cache already exists, it means that there is no need to create the cache pool, indicating that the creation task has failed, and 0 is returned.
[0069] After the ssd_cache pool creation task is successful, the mapping relationship between the cache pool ssd_cache and the data pool cinder-volumes is set.
[0070] Set the number of replicas for the ssd_cache cache pool. The setting method is as follows: if the number of replicas is less than a preset value, set the number of replicas in the cache pool to that number; if the number of replicas is greater than or equal to the preset value, set the number of replicas in the cache pool to the preset value.
[0071] Specifically, when the preset value is 3, the maximum number of replicas is 3. When ssd_number is 1, the number of replicas is 1; when ssd_number is 2, the number of replicas is 2; when ssd_number is greater than or equal to 3, the number of replicas is 3.
[0072] After the mapping relationship is successfully set, the cache pool parameter setting task is executed. The configuration parameters for the cache pool that need to be set include: target_max_bytes, target_max_objects, cache_min_flush_age, cache_min_evict_age, cache_target_dirty_ratio, cache_target_dirty_high_ratio, and cache_target_full_ratio. These parameters are all common parameters when configuring a cache pool, and their meanings are briefly explained below.
[0073] `cache_target_dirty_ratio` indicates the percentage of modified (dirty) objects in the cache pool that should be written back to the backend storage pool. The default value is 0.4.
[0074] `cache_target_dirty_high_ratio` indicates that when the proportion of modified (dirty) objects in the cache pool reaches this value, the cache layer proxy will flush the dirty objects back to the backend storage pool more quickly. The default value is 0.6.
[0075] `cache_target_full_ratio` specifies the percentage of clean objects that the cache pool should contain before the cache proxy removes them from the cache pool. The default value is 0.8.
[0076] When the target_max_bytes threshold is reached, Ceph will write back or evict the object. The maximum value of this value is 1TB, and the actual size is calculated based on the size of the SSD disk under the root default group in the actual environment.
[0077] target_max_objects: Ceph will write back or evict objects when the target_max_objects threshold is reached. Default: 1000000.
[0078] `cache_min_flush_age` is the time (in seconds) at which the cache proxy flushes certain objects from the cache pool back to the storage pool. The default value is 600 seconds.
[0079] `cache_min_evict_age` is the time (in seconds) at which the cache proxy evicts certain objects from the cache pool. The default value is 600 seconds.
[0080] Based on the above embodiments, as an optional embodiment, the present invention provides a cache pool management method, which executes the second preset instruction to delete the cache pool, including: when it is determined that a pre-created cache pool exists in the Ceph cluster, obtaining the status of all placement policy groups; when the status is healthy and the data in the cache pool has completed the disk flushing and eviction operations; and deleting the mapping relationship between the cache pool and the data pool to delete the cache pool.
[0081] Optionally, if it is determined that a pre-created cache pool exists in the Ceph cluster, the status of all placement policy groups is obtained; if the status is healthy, this includes: obtaining the name of each resource pool in the Ceph cluster; if a target name exists among all the names, the status of all placement policy groups is obtained; the target name is the pre-set name of the cache pool.
[0082] Specifically, the target name of the cache pool is ssd_cache. By checking whether a resource pool named ssd_cache already exists, it can be determined whether a pre-created cache pool exists. If ssd_cache does not exist in any of the pool names, it means that no cache pool exists, and there is no need to execute the task of deleting the cache pool; if a pool named ssd_cache already exists, then the task of deleting the cache pool is executed.
[0083] Optionally, the present invention can also determine whether a cache pool exists by calculating the ssd_number under the root default. If the ssd_number is 0, then no cache pool exists. For the calculation method of ssd_number, please refer to the above embodiments, which will not be repeated here.
[0084] If it is confirmed that a pre-created cache pool exists in the Ceph cluster, the next step is to determine whether all PGs in the Ceph storage cluster are in an active + clean state. Only when all PGs are in an active + clean state can the condition for deleting the Ceph cache pool be met.
[0085] Furthermore, check whether the data in the Ceph cache pool has been flushed and evicted to the Cinder-volumes data pool. If the flushing and evict operations have not yet been completed for the data in the cache pool, you can execute the following command remotely:
[0086] rados -p%(cache_pool_name)s cache-flush-evict-all
[0087] Flush and evict the data to the cinder-volumes data pool.
[0088] Once all data in the cache pool has been flushed and evicted to the cinder-volumes pool, the mapping between the ceph cache pool ssd_cache and the data pool cinder-volumes is removed.
[0089] Further, check if ssd_cache exists; if it does, delete the cache pool ssd_cache.
[0090] Finally, it checks if the Ceph Crush rule ssd_rule exists. If it does, it deletes the rule ssd_rule, and the task of automatically deleting the Ceph cache pool is completed.
[0091] In summary, the cache pool management method provided by this invention offers an automated solution for creating and deleting Ceph cache pools in a containerized OpenStack+ceph edge cloud environment. This allows operations and maintenance personnel and implementation personnel to quickly and easily deploy and delete Ceph cache pools, eliminating tedious manual operations and improving the efficiency of Ceph cache pool installation, configuration, and deletion, thereby enhancing the management efficiency of Ceph cache pools.
[0092] Figure 4This is a schematic diagram of the cache pool management device provided by the present invention, as shown below. Figure 4 As shown, the device includes: a retrieval module 401 and an execution module 402.
[0093] The retrieval module 401 is used to retrieve a first preset instruction after determining that the creation of the data pool of the target component of the OpenStack cloud platform has been completed.
[0094] The execution module 402 is used to execute a first preset instruction to create and configure the cache pool of the data pool.
[0095] It should be noted that the cache pool management device provided in this embodiment of the invention can execute the cache pool management method described in any of the above embodiments during actual operation, and this embodiment will not elaborate on this.
[0096] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can retrieve logical instructions from the memory 530 to execute a cache pool management method. This method includes: after determining that the creation of a data pool for a target component of the OpenStack cloud platform has been completed, retrieving a first preset instruction; and executing the first preset instruction to create and configure a cache pool for the data pool.
[0097] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0098] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer is able to execute the cache pool management method provided in the above embodiments, the method including: after determining that the creation of the data pool of the target component of the cloud platform OpenStack has been completed, retrieving a first preset instruction; executing the first preset instruction to create and configure the cache pool of the data pool.
[0099] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to perform the cache pool management method provided in the above embodiments. The method includes: after determining that the creation of a data pool for a target component of the cloud platform OpenStack has been completed, retrieving a first preset instruction; and executing the first preset instruction to create and configure a cache pool for the data pool.
[0100] 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.
[0101] Through the above description of the 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 part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes 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 some parts of the embodiments.
[0102] 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 cache pool management method, characterized in that, include: After the creation of the data pool for the target component of the OpenStack cloud platform is completed, the first invocation script is automatically executed to retrieve the first preset instruction; Execute the first preset instruction to create and configure the cache pool of the data pool; The step of executing the first preset instruction to create and configure the cache pool of the data pool includes: If the Ceph cluster meets the conditions for creating a cache pool, then create the cache pool. Establish the mapping relationship between the cache pool and the data pool; Set the configuration parameters of the cache pool to complete the configuration task of the cache pool; If the Ceph cluster meets the conditions for creating a cache pool, then create the cache pool, including: Retrieve object storage process grouping information under the target root in the Ceph cluster; Based on the object storage process grouping information, determine the number of host groups containing the target object storage process; the type of storage hard disk corresponding to the target object storage process is a solid-state drive (SSD). If the number is greater than 0, obtain the storage capacity of the solid-state drive corresponding to the target object storage process; The target storage capacity is determined based on the sum of the storage capacities and the number of storage units. If the target storage capacity is greater than the preset capacity value, obtain the status of all placement policy groups in the Ceph cluster; If the state is healthy, the cache pool is created based on the CRUSH algorithm.
2. The cache pool management method according to claim 1, characterized in that, After establishing the mapping relationship between the cache pool and the data pool, the following is also included: If the number is less than a preset value, the number of replicas in the cache pool is set to the number. If the number is greater than or equal to a preset value, the number of replicas in the cache pool is set to the preset value.
3. The cache pool management method according to claim 1, characterized in that, Also includes: Retrieve a second preset instruction in response to the user's first operation command; Execute the second preset instruction to delete the cache pool.
4. The cache pool management method according to claim 3, characterized in that, Executing the second preset instruction to delete the cache pool includes: If it is confirmed that a pre-created cache pool exists in the Ceph cluster, obtain the status of all placement policy groups; If the state is healthy, and the data in the cache pool has been flushed to disk and evicted; Remove the mapping relationship between the cache pool and the data pool to delete the cache pool.
5. The cache pool management method according to claim 4, characterized in that, Assuming a pre-created cache pool exists in the Ceph cluster, retrieve the status of all placement policy groups, including: Get the name of each resource pool in the Ceph cluster; If the target name is one of all names, retrieve the status of all placement strategy groups; The target name is the name of the cache pool that has been set in advance.
6. A cache pool management device, characterized in that, include: The invocation module is used to automatically execute the first invocation script and invoke the first preset instruction after the creation of the data pool of the target component of OpenStack is completed. An execution module is used to execute a first preset instruction to create and configure a cache pool for the data pool; The step of executing the first preset instruction to create and configure the cache pool of the data pool includes: If the Ceph cluster meets the conditions for creating a cache pool, then create the cache pool. Establish the mapping relationship between the cache pool and the data pool; Set the configuration parameters of the cache pool to complete the configuration task of the cache pool; If the Ceph cluster meets the conditions for creating a cache pool, then create the cache pool, including: Retrieve object storage process grouping information under the target root in the Ceph cluster; Based on the object storage process grouping information, determine the number of host groups containing the target object storage process; the type of storage hard disk corresponding to the target object storage process is a solid-state drive (SSD). If the number is greater than 0, obtain the storage capacity of the solid-state drive corresponding to the target object storage process; The target storage capacity is determined based on the sum of the storage capacities and the number of storage units. If the target storage capacity is greater than the preset capacity value, obtain the status of all placement policy groups in the Ceph cluster; If the state is healthy, the cache pool is created based on the CRUSH algorithm.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the cache pool management method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the cache pool management method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Storage pool detection method and device, electronic equipment and storage medium
CN114443332A