Directory creation and metadata service management method and device, server, medium and program product
By responding to directory creation requests in the file system, determining and mounting metadata services, combining hashing operations and directory depth, the problems of high cost of metadata service migration and unbalanced load are solved, and efficient load balancing and directory operations are achieved.
Patent Information
- Application Number
- CN202411910352.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-06
AI Technical Summary
In a file system, when adding or reducing Metadata Services (MDS) is required, it will lead to large amounts of data migration, which is expensive and difficult to change the initial layout to deal with the problem of load imbalance.
By responding to the directory creation request, the first and second metadata services are determined based on the operation information of all metadata services, and the data of the directory to be created is mounted on these services respectively to achieve data isolation of the same directory. At the same time, the second metadata service is determined through hashing operations to achieve load balancing.
It reduces the cost of metadata service migration, realizes load balancing at the metadata service level, reduces the complexity and resource usage of directory operations, and improves the operability and migration efficiency of directory.
Smart Images

Figure CN119938607A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of storage technology, and in particular relates to a directory creation and metadata service management method, device, server, medium and program product. Background Art
[0002] When the file system is stored in a tree-like hierarchy, the high-level subdirectories near the root directory are divided into multiple subtrees and mounted on multiple metadata services (MDS). Once the layout is determined based on this method, it is difficult to change. When adding or reducing MDSs, a large amount of data will be migrated, and the migration cost is high. Summary of the invention
[0003] Embodiments of the present application provide a directory creation and metadata service management method, device, server, medium and program product.
[0004] The present application embodiment provides a directory creation method, which is applied to a control module of a server in a distributed storage system. The method includes:
[0005] In response to the catalog creation request, determining a first metadata service based on the operation information of all metadata services;
[0006] Determining a second metadata service based on the operation information of all metadata services;
[0007] Mounting the first data of the directory to be created to the first metadata service, and mounting the second data of the directory to be created to the second metadata service;
[0008] Among them, the first metadata service and the second metadata service are different metadata services; the first data is used to describe the storage location of the metadata file in the global directory; the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or subdirectory relationship of the directory to be created; the directory to be created is the root directory or any subdirectory in the global directory.
[0009] In some embodiments, the directory creation request includes the depth of the directory to be created; determining the second metadata service based on the operating information of all metadata services includes: performing a hash operation based on the operating information of all metadata services and the depth of the directory to be created to determine the second metadata service.
[0010] It can be seen that by performing hash operations on the depth of the directory to be created and the running information of all metadata services, the second metadata service corresponding to the directory to be created is determined, and the second data of the directory to be created is mounted to the second metadata service, so that the storage location of the metadata file in the global directory can be reflected in the second metadata service, thereby achieving load balancing of each metadata service in the current state.
[0011] In some embodiments, the probability of the to-be-created directory being broken up is negatively correlated with the depth of the to-be-created directory.
[0012] It can be seen that by setting the probability of the to-be-created directory being scattered, it is negatively correlated with the depth of the to-be-created directory, which is conducive to ensuring the locality of directories with deeper levels.
[0013] In some embodiments, when the directory to be created is any subdirectory in the global directory, the first metadata service is the metadata service where the second data of the parent directory of the directory to be created is located, and the method further includes: obtaining an identifier of the parent directory; performing a hash operation based on the operating information of all metadata services and the depth of the directory to be created to determine the second metadata service, including: performing a hash operation based on the operating information of all metadata services, the depth of the directory to be created, and the identifier of the parent directory to determine the second metadata service.
[0014] It can be seen that this embodiment provides a method for mounting the first data of the directory to be created on the first metadata service where the second data of the parent directory of the directory to be created is located. The second metadata service corresponding to the directory to be created is obtained by performing hash operations on the running information of each metadata service, the depth of the directory to be created, and the identifier of the parent directory. The obtained second metadata service can take into account the influence of the parent directory of the directory to be created, so that the second metadata service is correlated with the first metadata service, and thus the distribution positions of the parent directory and the child directory can be close. When performing metadata operations, cumbersome operations such as distributed locks and distributed transactions can be avoided, which is conducive to processing complex directory relationships and improving directory operability.
[0015] In some embodiments, the method further includes: binding the second data with the second metadata service.
[0016] It can be seen that binding the second data with the second metadata service can make the storage location of the metadata file in the global directory correspond to a unique metadata service, so that when the metadata service cluster is migrated, only the metadata service needs to be migrated, and there is no need to migrate the second data, which is conducive to improving the migration efficiency of the directory and achieving load balancing at the metadata service level.
[0017] The embodiment of the present application further provides a metadata service management method, which is applied to a control module of a server of a distributed storage system, wherein a plurality of metadata services are running on the server, and computing nodes are used to provide computing power for the metadata services, and any metadata service is mounted on a corresponding computing node, and the metadata service is used to store a directory, and the directory in the metadata service is created based on the above-mentioned directory creation method, and the metadata service management method includes:
[0018] Based on the load capacity of the first computing power pool and the load capacity of the second computing power pool, determine the target metadata service to be migrated to the second computing power pool; wherein, before the migration of the target metadata service, the first computing power pool includes all computing nodes mounted by the metadata service; the second computing power pool includes an expansion computing node for receiving the target metadata service;
[0019] Migrate the target metadata service to the corresponding expanded computing node in the second computing power pool.
[0020] In some embodiments, before migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the method also includes: when the target metadata service has pending tasks, instructing the target metadata service to record the pending tasks, obtain record information, and instruct the pending tasks to execute an exit process; after migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the method also includes: restarting each target metadata service migrated to the expanded computing node, and instructing the target metadata service migrated to the expanded computing node to restore the pending tasks according to the record information.
[0021] It can be seen that through the metadata service migration method provided in this embodiment, when there are pending tasks in the target metadata service, the pending tasks can be recorded. After the metadata service migration is completed, the pending tasks in the metadata service can be restored, so that the migration of the metadata service will not affect the processing of the tasks.
[0022] In some embodiments, the instructing the target metadata service migrated to the expanded computing node to restore the pending tasks according to the recorded information includes: instructing the target metadata service migrated to the expanded computing node to obtain the metadata in the storage node according to the recorded information, and restoring the pending tasks according to the metadata.
[0023] It can be seen that by storing the metadata of the tasks to be processed in the storage node, when the metadata service is migrated, there is no need to migrate the complex metadata. The migrated metadata service only needs to retrieve the metadata of the tasks to be processed in the storage node, and the task status before the metadata service migration can be quickly restored.
[0024] The embodiment of the present application further provides a metadata service management method, which is applied to a control module of a server of a distributed storage system, wherein a plurality of metadata services are running on the server, and computing nodes are used to provide computing power for the metadata services, and any metadata service is mounted on a corresponding computing node, and the metadata service is used to store a directory, and the directory in the metadata service is created based on the above-mentioned directory creation method, and the metadata service management method includes:
[0025] Based on the load capacity of each existing computing node in the first computing power pool and the load capacity of the reduced computing node in the first computing power pool, determine the target existing computing node for receiving the target metadata service; wherein, before the target metadata service is migrated, the target metadata service is mounted on the reduced computing node; before the first computing power pool is reduced in capacity, the first computing power pool includes the existing computing nodes and the reduced computing nodes, and after the first computing power pool is reduced in capacity, the first computing power pool includes the existing computing nodes;
[0026] Migrate the target metadata service to the corresponding target inventory computing node.
[0027] The embodiment of the present application also provides a directory creation device, which is applied to a server of a distributed storage system, and the device includes:
[0028] A first determination module, configured to respond to a directory creation request and determine a first metadata service based on operation information of all metadata services;
[0029] A second determination module, configured to determine a second metadata service based on the operation information of all metadata services;
[0030] A processing module, used for mounting first data of the directory to be created to the first metadata service, and mounting second data of the directory to be created to the second metadata service;
[0031] Among them, the first metadata service and the second metadata service are different metadata services; the first data is used to describe the storage location of the metadata file in the global directory; the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or subdirectory relationship of the directory to be created; the directory to be created is the root directory or any subdirectory in the global directory.
[0032] The embodiment of the present application further provides a metadata service management device, which is applied to a server of a distributed storage system, wherein the server includes a computing node and a metadata service, any metadata service is mounted on a corresponding computing node, the computing node is used to provide computing power for the metadata service, the metadata service is used to store a directory, the directory in the metadata service is created based on the above-mentioned directory creation method, and the metadata service management device includes:
[0033] A third determination module is used to determine the target metadata service to be migrated to the second computing power pool based on the load capacity of the first computing power pool and the load capacity of the second computing power pool; wherein, before the target metadata service is migrated, the first computing power pool includes computing nodes mounted by all metadata services; and the second computing power pool includes expansion computing nodes for receiving the target metadata service;
[0034] The first migration module is used to migrate the target metadata service to the corresponding expanded computing node in the second computing power pool. The embodiment of the present application also provides a metadata service management device, which is applied to a server of a distributed storage system, wherein the server includes a computing node and a metadata service, any metadata service is mounted on a corresponding computing node, the computing node is used to provide computing power for the metadata service, the metadata service is used to store a directory, the directory in the metadata service is created based on the above-mentioned directory creation method, and the metadata service management device includes:
[0035] A fourth determination module is used to determine a target existing computing node for receiving a target metadata service based on the load capacity of each existing computing node in the first computing power pool and the load capacity of the reduced computing node in the first computing power pool; wherein, before the target metadata service is migrated, the target metadata service is mounted on the reduced computing node; before the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes and reduced computing nodes, and after the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes;
[0036] The second migration module is used to migrate the target metadata service to the corresponding target stock computing node.
[0037] An embodiment of the present application provides a server of a distributed storage system, the server comprising a communication interface, a control module, a metadata service, and a back-end storage node; the control module is connected to multiple metadata services, the metadata service is connected to multiple back-end storage nodes, the server is used to connect to at least one client through the communication interface, and the control module is used to provide distributed storage services for the client through any of the above-mentioned directory creation methods or any of the above-mentioned metadata service management methods.
[0038] An embodiment of the present application provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the above-mentioned directory creation methods, or implements any of the above-mentioned metadata service management methods.
[0039] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned directory creation methods, or implements any of the above-mentioned metadata service management methods.
[0040] The embodiments of the present application provide a method, device, server, medium and program product for directory creation and metadata service management, wherein the directory creation method provided by the embodiments of the present application realizes isolation of the first data and the second data of the same directory by mounting the first data and the second data of the directory to be created on different metadata services respectively. When one of the first metadata service and the second metadata service is migrated alone, it is not necessary to involve the migration of the data mounted in the other metadata service, thereby reducing the migration cost of the metadata service. The metadata service management method provided by the embodiments of the present application controls the expansion, reduction and creation of the metadata service through the control module of the server, and can quickly realize the creation and migration of the metadata service, which is conducive to realizing the load balancing of the metadata service. When hot spots appear in the metadata of the directory, the metadata hot spot phenomenon can be improved through the creation and migration of the metadata service. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram based on static subtree partitioning provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of metadata partitioning based on hash operation provided in an embodiment of the present application;
[0043] Figure 3 A flowchart of a directory creation method provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of a directory tree structure of a file management system provided in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of an MDS structure provided in an embodiment of the present application;
[0046] Figure 6 A flowchart of a metadata service management method provided in an embodiment of the present application;
[0047] Figure 7 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0048] Figure 8 A flowchart of another metadata service management method provided in an embodiment of the present application;
[0049] Fig. 9 A flowchart of another directory creation method provided in an embodiment of the present application;
[0050] Fig.10 A flow chart of another MDS management method provided in an embodiment of the present application;
[0051] Fig.11 A schematic diagram of the structure of a directory creation device provided in an embodiment of the present application;
[0052] Fig.12 A schematic diagram of the structure of a metadata service management device provided in an embodiment of the present application;
[0053] Fig.13 A schematic diagram of the structure of another metadata service management device provided in an embodiment of the present application;
[0054] Fig.14 A schematic diagram of the composition structure of another server provided in an embodiment of the present application;
[0055] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] Traditional file management systems are limited by the performance bottleneck of a single machine and cannot meet the rapidly growing data processing needs of the business. Through a distributed storage system, the storage resources of multiple servers can be integrated together. When accessing business data, there is no need to know the actual physical location of each server. The distributed storage system itself supports the expansion of any node, so that it can undertake the rapidly growing data processing needs of the business. In the related art, there are generally the following methods for managing data distribution in a distributed storage system.
[0057] Method 1: File management system based on static subtree partitioning, including NFS, Sprite, LOCUS, AFS and Coda.
[0058] like Figure 1 As shown, Figure 1A schematic diagram based on static subtree partitioning is shown, showing a typical implementation structure based on static subtree partitioning. In this architecture, the file management system is a tree-like hierarchical structure. The partitioning method based on static subtree partitioning divides the high-level subdirectories close to the root directory into multiple subtrees, and mounts them to multiple MDS nodes (or one MDS mounts multiple subtrees), forming a metadata management structure that is distributed in the physical view and unified in the logical view. Figure 1 In the example, the file management system is divided into three subtrees: " / etc", " / usr" and " / var", which are mounted on MDS1, MDS2 and MDS3 respectively. For example, the user's access request for the " / etc" subtree will be processed by MDS1, the request for the " / usr" subtree will be processed by MDS2, and the request for the " / var" subtree will be processed by MDS3.
[0059] Once the layout of the static subtree partition is determined, it will not change unless it is manually reconfigured. The partitioning technology is relatively simple to implement, and only requires multiple independent nodes to run the MDS. When querying metadata, the file management system semantics directly locates the MDS that mounts the corresponding subtree according to the request path, and by effectively utilizing the principle of locality of file access, the system performance can be improved to a certain extent. However, the method based on static subtree partitioning is difficult to solve the "hot spot" problem of metadata. When the number of file requests under a subtree suddenly increases sharply, the workload of the MDS that mounts the subtree is extremely large, while other MDSs may be idle, resulting in serious load imbalance. In addition, the scalability of the static subtree-based partitioning method is also relatively poor. When it is necessary to add or reduce MDSs, a large amount of data migration will occur, and during this process, the file management system is inaccessible, which has a great impact on the business.
[0060] Method 2: File management system based on dynamic subtree partitioning.
[0061] A typical application based on dynamic subtree partitioning is Ceph. Currently, mainstream distributed storage system vendors basically use Ceph as a prototype for secondary development. Unlike static subtree partitioning, dynamic subtree partitioning requires metadata to be hierarchically divided into multiple MDS nodes. These MDSs form a shared storage system rather than existing independently. Each MDS will calculate the popularity of metadata and regularly dynamically migrate related subtrees to ensure cluster load balancing.
[0062] The metadata management method based on dynamic subtree division has good load balancing capabilities, can read and write a large amount of hot metadata, can also dynamically expand the MDS cluster, and has good directory operation performance. However, a large number of subtree migrations will also generate a large amount of data migration, which will cause huge system overhead. In order to ensure data consistency, the system will lock the migrated subtree. During the locking period, the business cannot access the migrating subtree, which will have a serious impact on the business.
[0063] Method 3: Metadata partitioning method based on hash operation.
[0064] The systems that use the hash-based metadata partitioning method mainly include ZFS, Lustre, Vesta, etc. Figure 2 As shown in FIG. 1 , this method inputs the file identifier (or file path, etc.) into the designed metadata mapping hash function, obtains a unique hash value through hash operation, and maps it to the executed MDS according to the hash value. When the user needs to access a file, the input file identifier is calculated through a universal hash function to locate the target MDS.
[0065] The metadata divided based on hash operation has a faster query speed and can evenly distribute the metadata to each node. However, this method distributes the files to each MDS in an unordered manner through hash operation, which loses the locality of the metadata and seriously damages the hierarchical structure of the file management system. The directory operation performance is poor, and it is prone to problems such as metadata hotspots and poor system scalability. When the MDS cluster structure changes, all metadata that already exists in the MDS cluster needs to be hashed again, which will cause a large amount of data migration. Therefore, the method of dividing metadata based on hash operation is usually only suitable for massive storage systems with low semantic requirements for file management systems, such as object storage systems.
[0066] In response to the above-mentioned problems, the embodiments of the present application provide a directory creation and metadata service management method, device, server, medium and program product, which can achieve directory-level load balancing and quickly realize the creation and migration of metadata services.
[0067] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the embodiments provided herein are only used to explain the embodiments of the present application and are not intended to limit the embodiments of the present application. In addition, the embodiments provided below are partial embodiments for implementing the present application, rather than providing all embodiments for implementing the present application. In the absence of conflict, the technical solutions recorded in the embodiments of the present application can be implemented in any combination.
[0068] It should be noted that, in the embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or device including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or device. In the absence of further restrictions, an element defined by the sentence "includes..." does not exclude the presence of other related elements (such as steps in the method or units in the device, such as a unit in the device may be a part of a circuit, a part of a processor, a part of a program or software, etc.) in the method or device including the element.
[0069] The directory creation and metadata service management method provided in the embodiment of the present application includes a series of steps, but the directory creation and metadata service management method provided in the embodiment of the present application is not limited to the recorded steps. Similarly, the directory creation and metadata service management device provided in the embodiment of the present application includes a series of modules, but the device provided in the embodiment of the present application is not limited to including the modules explicitly recorded, and can also include modules that need to be set for obtaining relevant information or processing based on information.
[0070] The present application embodiment provides a directory creation method, such as Figure 3 As shown, Figure 3 A flow chart of a directory creation method is shown, which is applied to a control module of a server in a distributed storage system. Figure 3 The directory creation method shown includes:
[0071] Step 301: In response to a directory creation request, determine a first metadata service based on the running information of all metadata services.
[0072] Step 302: Determine a second metadata service based on the operation information of all metadata services.
[0073] Step 303: Mount the first data of the directory to be created to the first metadata service, and mount the second data of the directory to be created to the second metadata service.
[0074] Among them, the first metadata service and the second metadata service are different metadata services; the first data is used to describe the storage location of the metadata file in the global directory; the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or subdirectory relationship of the directory to be created; the directory to be created is the root directory or any subdirectory in the global directory.
[0075] In a distributed storage system, the metadata service may specifically be MDS, or other services responsible for managing and maintaining the metadata of the file management system. These metadata describe the structure, attributes, permissions, and other information of files and directories in the file management system. In the embodiment of the present application, MDS is used as a metadata service as an example. When a user or application requests access to a file or directory in the file management system, the metadata service MDS processes these requests and obtains and provides the necessary metadata. As a stateless service, MDS itself does not store any valid content. It only serves as a cache structure, and all its data modifications rely on another storage engine.
[0076] The directory creation method and metadata service management method involved in the embodiments of the present application are implemented based on the control module of the server of the distributed storage system. The control module of the server of the distributed storage system provides computing power through computing nodes. The control module can specifically be a monitoring node monitor or a main MDS. The embodiments of the present application do not impose any limitation on the specific implementation method of the control module.
[0077] In this embodiment, creating a directory refers to creating a directory in a file management system in an operating system, specifically, creating a directory in a distributed storage system. Most distributed storage systems provide command line tools to interact with the system, and users can use these tools to enter relevant commands to request the creation of a directory. Different systems may have different commands or tools to implement directory creation, so there are many ways to actually create a directory. This embodiment does not limit the implementation method or specific command of the directory creation request.
[0078] The number of metadata services in each distributed storage system may be different. Generally, the number of metadata services depends on the scale, performance, and reliability requirements of the distributed storage system. In order to ensure the load balancing of each metadata service, the present embodiment needs to obtain the operation information of each metadata service in the distributed storage system. Here, the operation information of the metadata service may include the status and performance of the metadata service, the resource consumption during the operation of the metadata service, the information of interaction with other components, etc. The operation information of the metadata service may also be the number of files in the metadata service, the number of directories in the metadata service, the utilization rate of the central processing unit (CPU) of the computing node where the metadata service is mounted, and other information that can reflect the load of the metadata service.
[0079] In response to the directory creation request, the server determines the first metadata service based on the running information of each metadata service. In the embodiment of the present application, the directory creation can be specifically performed based on the monitor deployed in the server of the distributed storage system. When the directory to be created is the root directory in the global directory, the first metadata service can be determined based on the running information of the metadata service. For example, the first metadata service can be determined based on information such as the resource occupancy rate of the metadata service, the number of files in the metadata service, and the number of directories in the metadata service. When the directory to be created is any subdirectory in the global directory, the metadata service where the parent directory of the directory to be created is located can also be used as the first metadata service.
[0080] The second metadata service can also be determined based on the operation information of each metadata service. Specifically, taking the metadata service as an MDS as an example, the second MDS is determined through the known first MDS, for example, any MDS other than the first MDS is used as the second MDS; or, among multiple MDSs other than the first MDS, the second MDS is determined based on the resource occupancy rate of each MDS in the multiple MDSs, the number of files in the MDS, and the number of directories in the MDS, for example, an MDS with a low resource occupancy rate is used as the second MDS, or an MDS with a small number of files or a small number of directories in the MDS is used as the second MDS.
[0081] After determining the first MDS and the second MDS, the first data of the directory to be created is mounted to the first MDS, and the second data of the directory to be created is mounted to the second MDS. Here, the first data is used to describe the storage location of the metadata file in the global directory, and the first data can be a directory entry (Dentry); the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or child directory relationship of the directory to be created, and the second data can be a directory (Directory, Dir) and an index node (Inode).
[0082] In a distributed storage system, directory (Dir), directory entry (Dentry), and index node (Inode) are the three elements of a file management system, and play an important role in the operation and performance of the file management system. A directory is usually used to organize and store files and record the Dentry collection it manages. It has an Inode connected to itself. The directory provides an organizational structure for files and directories, and users can easily access any location in the file management system through the directory in the path; Inode is used to store the meta information of a specific file or directory. The meta information is used to describe the file's attributes, file size, device identifier, user identifier, user group identifier, file mode, extended attributes, etc.; Dentry is used to store the name of the file or directory, and is used to connect Inode and Dir, which can associate the directory and file paths and describe the logical attributes of the file.
[0083] It can be seen that since the directory Dir and Inode are the real structures of data storage, in this step, the second data is deployed in the second MDS so that the directory Dir and the corresponding Inode are located in the same MDS. When the first MDS and the second MDS are different, direct isolation of Dentry and Inode corresponding to the same directory Dir is achieved, so that when one of the first MDS and the second MDS is migrated alone, it does not need to involve the migration of data in the other MDS, reducing the occupation of system resources by MDS migration.
[0084] This embodiment provides a directory creation method, which is applied to a control module of a server in a distributed storage system. It can reduce the metadata service migration cost by mounting the first data and the second data of the directory to be created to different metadata services, which is conducive to achieving metadata service load balancing.
[0085] In practical applications, steps 301 to 303 can be implemented based on a processor, and the processor can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor.
[0086] In some embodiments, the above-mentioned directory creation request includes the depth of the directory to be created; the above-mentioned determining the second metadata service based on the operating information of all metadata services includes: performing a hash operation based on the operating information of all metadata services and the depth of the directory to be created to determine the second metadata service.
[0087] The directory creation request includes the depth of the directory to be created. Here, the depth of the directory to be created refers to the number of directory levels required to reach the specified directory starting from the root directory ( / ). For example, suppose a file is located at " / home / user / documents / project / example.txt". Starting from the root directory ( / ), first enter the home directory (1st level), then enter the user directory (2nd level), then the documents directory (3rd level), then the project directory (4th level), and finally reach the example.txt file (the file itself is not counted in the depth). Therefore, the directory depth of the example.txt file is 4. In addition to the depth of the directory to be created, the directory creation request can also include the path of the directory to be created, the directory name of the directory to be created, the permissions of the directory to be created, etc.
[0088] By taking the operation information of each metadata service and the depth of the directory to be created as the key value of the hash operation, the second metadata service corresponding to the directory to be created is obtained through the hash operation calculation, and the directory to be created is created through the second metadata service.
[0089] Since the depth of the directory can reflect the hierarchical structure of the directory in the file management system, the running status of each metadata service and the depth of the directory to be created are fully considered in the hash operation, so that the second metadata service obtained by the hash operation can also reflect the impact of the running status of each current metadata service and the depth of the directory to be created, so that the directory to be created in the second metadata service can achieve load balancing of each metadata service in the current state.
[0090] This embodiment provides a directory creation method, which can perform hash operations through the depth of the directory to be created and the running information of each metadata service to determine the second metadata service for creating the directory to be created, so that the running status of each metadata service and the number of levels of the directory to be created are taken into account in the process of creating the directory, and by hashing the directory levels, the impact of poor directory operation performance is greatly reduced, and different directory Dirs and the Inodes and Dentry corresponding to the directory Dirs can be evenly distributed to each metadata service, which is conducive to reducing the occurrence of metadata hotspots and ultimately achieving system load balancing.
[0091] In some embodiments, the probability that the directory to be created is broken up is negatively correlated with the depth of the directory to be created.
[0092] In a distributed storage system, creating a scattered directory means that the directory and its data are randomly mounted on various metadata services, usually using a hash function to achieve random distribution of directory data. This phenomenon is a strategy adopted by distributed storage systems to optimize performance, balance data distribution, and improve reliability and fault tolerance.
[0093] Based on the method given in the above embodiment, in the process of determining the second metadata service through hash operation, by setting the probability of the directory to be created being broken up, it is negatively correlated with the depth of the directory to be created (the deeper the depth of the directory to be created, the smaller the probability of being broken up). Compared with the random hash operation in the related art, in the process of creating the directory, it can combine the depth characteristics of the directory, as well as CPU information, Inode quantity information, etc., to create directories with shallower hierarchies mainly for the purpose of load balancing, and in the process of directory creation, retain the locality of directories with deeper hierarchies, and achieve a better balance between system load balancing and user performance requirements: in most scenarios, users will store files of the same type in a parent directory and its multiple subdirectories with a certain directory depth, and access the above multiple files of the same type at a high frequency according to actual needs. If the above parent directory and its multiple subdirectories are mounted on metadata services adjacent to each other in the network topology, the distributed storage system can respond more quickly to high-frequency access to files of the same type. The negative correlation between the depth of the directory to be created and the probability of being scattered can be determined by a static function, by a preset mapping table, or by flexible adjustment through data distribution perception. The embodiment of the present application does not impose any limitation on the specific negative correlation.
[0094] In some embodiments, when the directory to be created is any subdirectory in the global directory, the first metadata service is the metadata service where the second data of the parent directory of the directory to be created is located, and the above method also includes: obtaining an identifier of the parent directory; the above-mentioned hash operation is performed based on the operating information of all metadata services and the depth of the directory to be created to determine the second metadata service, including: performing a hash operation based on the operating information of all metadata services, the depth of the directory to be created, and the identifier of the parent directory to determine the second metadata service.
[0095] In this embodiment, the first metadata service is the metadata service where the second data of the parent directory of the directory to be created is located. Assume that the path of a file is " / home / user / documents / project / example.txt", where the parent directory of " / project" is " / documents", and the parent directory of " / documents" is " / user". Correspondingly, the subdirectory of " / documents" is " / project", and the subdirectory of " / user" is " / documents".
[0096] When the first metadata service is the metadata service where the second data of the parent directory of the directory to be created is located, before creating the directory to be created, it is also necessary to obtain the identifier of the parent directory, where the identifier of the parent directory can be a unique identifier of the parent directory, usually represented by a specific symbol. The identifier of the parent directory is an important navigation tool in the file management system, which can help users organize and manage files effectively. In this embodiment, the identifier of the parent directory obtained, the operating information of each metadata service, and the depth of the directory to be created are used as key values for the hash operation, so that the second metadata service determined by the hash operation is a metadata service that is related to the first metadata service, rather than an arbitrary metadata service.
[0097] Through the method provided in this embodiment, it is possible to ensure that the metadata services where the parent directory and the child directory are located have a certain degree of correlation / locality, and it is possible to avoid that the first metadata service where the second data of the parent directory is located is far away from the second metadata service where the child directory is located. When it is necessary to perform parent and child directory operations at the same time, the essence is to operate the metadata of the parent and child directories, such as rename, unlink, etc., because the metadata services where the parent and child directories themselves are located have correlation / locality, when processing the metadata of the parent and child directories, cumbersome operations such as distributed locks and distributed transactions can be reduced, thereby reducing resource usage, speeding up response speed, and making the directory data relatively evenly distributed on different metadata services.
[0098] It can be seen that this embodiment provides a method for performing hash operations on a directory. By performing hash operations on the directory, the metadata services of the parent and child directories can be made relevant, which is beneficial to improving the operability of the directory. In actual applications, the identifier of the parent directory and the directory name of the directory to be created can also be hashed to determine the second metadata service; the identifier of the parent directory and the depth of the directory to be created can also be hashed to determine the second metadata service. Methods that use different combinations of different attributes of the directory as key values for hash operations and determine the creation of the second metadata service for the directory to be created through hash operations all fall within the scope of protection of this application.
[0099] In some embodiments, the above method further includes: binding the second data with the second metadata service.
[0100] Since the directory Dir and Inode in the file management system are the real structure of data storage, the directory Dir and Inode can be bound to the second metadata service, that is, before actually creating a directory or file, the system has already determined which metadata service it belongs to. When the metadata service cluster changes, a monitoring program can be used to directly perform load balancing based on the metadata service, and the specified metadata service can be pulled up on any computing node at will, thereby achieving load balancing at the metadata service level without causing data migration.
[0101] The directory creation method provided in the embodiment of the present application is calculated according to the load of the system, for example, according to the load of each metadata service, the depth of the current directory to be created, etc. A suitable metadata service is obtained based on these factors, and the metadata service can be adjusted according to actual conditions, and the directory can be created according to different systems and environments.
[0102] Figure 4 A schematic diagram of a directory tree structure of a file management system is shown. Figure 4 As shown, taking the path where "f7" is located as an example, the path of "f7" is " / d1 / d4 / d5 / f7", where the parent directory of " / f7" is " / d5".
[0103] Figure 5 The MDS structure diagram obtained by the directory division method based on the above embodiment is shown. Figure 4 The directory tree structure shown can be seen. Figure 5 Where " / d1", " / d2" and " / d3" are the root directories of the directory tree of the entire file management system. When the directory creation method given in the above embodiment is used to create a directory, when the first MDS and the second MDS are different MDSs, for example, the directory " / d4", and the corresponding Dentry and Inode are respectively distributed in the first MDS and the third MDS.
[0104] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0105] Based on the directory creation method proposed in the above embodiment, the present application embodiment also proposes a metadata service management method, such as Figure 6 As shown, Figure 6The flowchart of the metadata service management method is shown, including:
[0106] Step 601: Based on the load capacity of the first computing power pool and the load capacity of the second computing power pool, determine the target metadata service to be migrated to the second computing power pool; wherein, before the target metadata service is migrated, the first computing power pool includes computing nodes mounted with all metadata services; and the second computing power pool includes expansion computing nodes for receiving the target metadata service.
[0107] The metadata service management method provided in this application is applied to the control module of the server of the distributed storage system, such as Figure 7 As shown, multiple metadata services are running on the server 70 involved in the embodiment of the present application, and computing nodes are used to provide computing power for the metadata services. Any metadata service is mounted on a corresponding computing node; in the embodiment of the present application, the metadata service is used to store directories, and the directories in the metadata service are created based on the directory creation method of the above embodiment. In other words, the embodiment of the present application is a management method for the metadata service in the above embodiment. The server 70 may include multiple computing power pools, and one or more computing nodes are running in each computing power pool.
[0108] The embodiment of the present application introduces a control module in the distributed storage system. Specifically, the metadata service management and scheduling can be achieved through the control module in the server 70, but it will not cause data migration. The control module is used to manage the status of the entire cluster. The control module can be a node set up to manage metadata services, such as a monitoring node Monitor in a distributed storage system. Monitor is mainly used to monitor the status and activities of the file management system, and provides a variety of custom options and notification methods to help users promptly understand and respond to changes that may affect the file management system.
[0109] The management method of the metadata service in this embodiment can be implemented by migrating the metadata service. When the metadata service needs to be expanded, the load capacity of the computing pool corresponding to the current metadata service can be calculated through the monitoring node. The computing pool here includes the first computing pool and the second computing pool, and can also include other computing pools. The first computing pool includes all the computing nodes mounted by the metadata service before the metadata service is migrated, and the second computing pool includes the expanded computing nodes of the metadata service to be migrated.
[0110] Taking the metadata service as MDS as an example, the first computing power pool may include computing nodes corresponding to the MDS where all the first data and second data are located before the MDS is migrated. The second computing power pool includes the expanded computing nodes to be migrated by the MDS. For example, the second computing power pool may be a computing power pool composed of computing nodes predetermined based on the memory conditions of the device, the CPU operating capacity, etc., or it may be a computing power pool composed of computing nodes that need to be newly added obtained by technical personnel based on the current MDS operating information. The computing nodes in the second computing power pool may be one or more. The first computing power pool and the second computing power pool are a collection of computing nodes that manage the MDS. Here, the computing nodes or computing power pools may specifically be server hosts of a distributed storage system, and there may be one or more MDSs in a computing node.
[0111] After obtaining the load capacity of the first computing power pool and the load capacity of the second computing power pool, the target MDS that needs to be migrated in the first computing power pool can be determined according to actual needs or operation information of the MDS.
[0112] In practical applications, the target MDS to be migrated in the first computing power pool may be determined according to the processing capacity of the first computing power pool, or the target MDS to be migrated may be determined according to the operation information of each MDS.
[0113] In practical applications, the load capacity of the computing power pool can be determined based on one or more of the number of computing nodes in the computing power pool, the load capacity of each computing node in the computing power pool, and the computing power of each computing node. The load capacity of each computing node can be determined based on one or more of the resource occupancy information such as the CPU usage rate, memory occupancy rate, disk read and write load rate, network traffic, etc. of the computing node; the computing power of each computing node can be determined based on one or more of the performance parameters such as the processor model, main frequency, memory bandwidth, storage performance, etc. corresponding to each computing node. The embodiments of the present application do not impose any restrictions on the specific evaluation criteria for the load capacity of the computing power pool or computing nodes. The following example takes the number of computing nodes as the load capacity of the computing power pool and the metadata service as the MDS to illustrate the method of determining the target MDS:
[0114] In the method given in this step, it is assumed that the number of first computing nodes in the first computing power pool is 3, the number of MDSs in each first computing node is 4, and the number of second computing nodes in the second computing power pool is 1. Then, according to the number of computing nodes, it can be obtained that the number of target MDSs to be migrated in each first computing node in the first computing power pool is 1. Here, a target MDS can be randomly migrated from each first computing node to the second computing node. When the second computing node has a stronger processing capability, the target MDS that currently occupies more resources can be selected from the first computing node and migrated to the second computing node. In practical applications, the number of second computing nodes can also be multiple.
[0115] Step 602: Migrate the target metadata service to the corresponding expanded computing node in the second computing power pool.
[0116] Based on the example given in step 601, when performing MDS migration, you can wait until the task processing in the MDS is completed before migrating, or you can immediately terminate the running tasks of each MDS to complete the timely migration of the MDS. The above-mentioned second computing node is the expansion computing node in this embodiment, and the above-mentioned first computing node is the computing node mounted by all metadata services in the first computing power pool.
[0117] After the target MDS to be migrated and each expansion computing node are determined by the control module, the control module can instruct each expansion computing node, and each expansion computing node performs the target MDS pull-up operation according to the instruction of the control module, and migrates the target MDS in the first computing node to the corresponding expansion computing node. The target MDS can also be directly migrated by the control module to the corresponding expansion computing node.
[0118] This embodiment provides a metadata service migration method. It can be seen that after the method for creating a directory for the metadata service is provided through the above embodiment, since the metadata service stores the directory Dir, and the Dentry and Inode corresponding to the directory Dir, when performing metadata service migration, only the directory level migration is involved, and the metadata migration is not involved. Therefore, through the method provided in the embodiment of the present application, through the migration of the metadata service, the directory Dir in the metadata service, and the Dentry and Inode corresponding to the directory Dir can be quickly migrated, which is further beneficial to achieve system load balancing.
[0119] In practical applications, steps 601 to 602 may be implemented based on a processor, and the processor may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0120] In some embodiments, before migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the method further includes: when there are pending tasks in the target metadata service, instructing the target metadata service to record the pending tasks, obtain record information, and instruct the pending tasks to execute an exit process; after migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the method further includes: restarting each target metadata service migrated to the expanded computing node, and instructing the target metadata service migrated to the expanded computing node to restore the pending tasks according to the record information.
[0121] This embodiment further provides a method for processing when there are pending tasks in the target metadata service during the metadata service migration process. When there are pending tasks in the target metadata service, or the target metadata service is processing tasks, the control module first instructs the target metadata service to record the pending tasks, and then executes the exit process. After the target metadata service completes the migration, the monitoring node restarts each target metadata service that has completed the migration in the expanded computing node, and instructs the target metadata service migrated to the target computing node to restore the pending tasks based on the recorded information before the migration.
[0122] For example, the above method may specifically be: after the target MDS receives the instruction sent by the control module, it first needs to stop submitting new tasks to the task queue or system, and start the exit process by sending a specific signal, calling a specific application programming interface (Application Programming Interface, API) or modifying the system state, at which time the pending tasks can be suspended. After the exit process is completed and the target MDS completes the migration, the corresponding command or operation can be used to resume the suspended tasks.
[0123] The above method may specifically be: the target MDS stores the configuration and related information of the pending tasks before migration, and after migration, retrieves the configuration and related information of the pending tasks, restores the pending tasks, and continues to process the pending tasks.
[0124] In some embodiments, the target metadata service migrated to the target computing node is instructed to restore pending tasks according to the recorded information, including: instructing the target metadata service migrated to the target computing node to obtain metadata in the storage node according to the recorded information, and restoring pending tasks according to the metadata.
[0125] This embodiment introduces a storage node for storing metadata information. The storage node here may be a specially set database or storage space, or specifically an object storage device OSD (Object Storage Device).
[0126] When the target metadata service suspends pending tasks before migration, after completing the migration, the target metadata service will retrieve the relevant data of the suspended pending tasks in OSD through relevant instructions to restore them and re-process the tasks.
[0127] In some embodiments, the above method also includes: sending a metadata service creation request to any computing node in the first computing power pool and the second computing power pool; wherein the metadata service creation request is used to instruct any computing node to create a metadata service.
[0128] On the basis of the above embodiments, this embodiment also provides a method for expanding the capacity of a metadata service by creating a metadata service. Specifically, the control module can send an MDS creation request to any computing node in the first computing power pool and the second computing power pool according to user instructions or system requirements, and instruct any computing node to complete the creation of the MDS, or the control module can send an MDS creation request to a specified computing node in the first computing node and the second computing node according to user instructions or system requirements, and instruct the specified computing node to complete the creation of the MDS.
[0129] The metadata service management method provided in the embodiment of the present application can realize arbitrary expansion and scheduling of metadata services by introducing control modules and storage nodes (such as OSD) without causing data migration; by introducing a control module to control the expansion of the metadata service cluster, the metadata service can be quickly migrated to any computing node, thereby achieving load balancing of the computing nodes.
[0130] Those skilled in the art will appreciate that, in the above-described specific implementation method, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0131] On the basis of the directory creation method proposed in the above embodiment, the embodiment of the present application also proposes another metadata service management method, which is applied to the control module of the server 70 of the distributed storage system. The server 70 involved in the embodiment of the present application runs multiple metadata services, and provides computing power for the metadata service through computing nodes. Any metadata service is mounted on a corresponding computing node; the metadata service in the embodiment of the present application is used to store the directory, and the directory in the metadata service is created based on the directory creation method of the above embodiment. In other words, the embodiment of the present application is a management method for the metadata service in the above embodiment.
[0132] like Figure 8 As shown, Figure 8 Another metadata service management method flow chart is shown, including:
[0133] Step 801: Based on the load capacity of each existing computing node in the first computing power pool and the load capacity of the reduced computing node in the first computing power pool, determine the target existing computing node for receiving the target metadata service; wherein, before the target metadata service is migrated, the target metadata service is mounted on the reduced computing node; before the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes and reduced computing nodes, and after the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes.
[0134] In this embodiment, the management method for metadata services may be to reduce the capacity of computing nodes in the computing power pool. The above embodiment provides a method for expanding the capacity of metadata services. In practical applications, the capacity reduction of metadata services can also be achieved based on the above method. The existing computing nodes in this step correspond to the above-mentioned first computing nodes, indicating the computing nodes before the metadata service is managed. The control module of this step is the same as the control module in step 601. When computing node deletion is required, it can be achieved by the method in this embodiment.
[0135] The load capacity of the target stock computing node can be determined by the load capacity of the stock computing node and the load capacity of the reduced computing node. Specifically, the load capacity of the target stock computing node is equal to the load capacity of the stock computing node minus the load capacity of the reduced computing node. The total load capacity of the metadata service in the stock computing node can be obtained by the load capacity of each metadata service in the stock computing node. The target metadata service that needs to be migrated to the target stock computing node can be obtained by the difference between the load capacity of the metadata service in the stock computing node and the load capacity of the target stock computing node. Specifically, if the number of computing nodes is used as the load capacity of the computing node, the number of MDSs that need to be migrated to each target stock computing node can be obtained by dividing the total number of MDSs in the reduced computing node by the number of target stock computing nodes.
[0136] For example, assuming that the current number of existing computing nodes is 4, and the number of MDSs in each existing computing node is 3, when the number of existing computing nodes needs to be reduced from 4 to 3, that is, the number of computing nodes to be scaled down is 1, the 3 target MDSs in the scaled-down computing node can be evenly migrated to the other 3 target existing computing nodes, so that the number of MDSs in each target existing computing node after scaling down is 4. In actual applications, the 3 target MDSs in the scaled-down computing node can also be placed in the specified target existing computing node according to actual needs.
[0137] In practical applications, the load capacity of the computing power pool can be determined based on one or more of the number of computing nodes in the computing power pool, the load capacity of each computing node in the computing power pool, and the computing power of each computing node. The load capacity of each computing node can be determined based on one or more of the resource occupancy information such as the CPU usage rate, memory occupancy rate, disk read and write load rate, network traffic, etc. of the computing node; the computing power of each computing node can be determined based on one or more of the performance parameters such as the processor model, main frequency, memory bandwidth, storage performance, etc. corresponding to each computing node. The embodiments of the present application do not impose any restrictions on the specific evaluation criteria for the load capacity of the computing power pool or computing nodes.
[0138] Step 802: Migrate the target metadata service to the corresponding target inventory computing node.
[0139] The above steps provide a method for reducing the capacity of computing nodes. When there are fewer requests for directories in the current file management system, or when a computing node is not needed to continue working, the above method can be used to quickly reduce the capacity of computing nodes, reduce the occupancy rate of system resources, improve system efficiency, and achieve load balancing of computing nodes.
[0140] In actual applications, you can also directly delete the MDS in the existing computing nodes. Assume that there are 4 existing computing nodes and each of them has 3 MDSs. When you need to reduce the capacity of the MDS, for example, if you need to reduce 3 MDSs, you can select 3 existing computing nodes and directly remove one MDS from each of the 3 selected existing computing nodes to reduce the capacity of the computing nodes.
[0141] The method of this embodiment is applied to migrate metadata services. When there are tasks to be processed in the metadata service to be migrated, the method given in the above embodiment can also be used to suspend the tasks in the metadata service to be migrated, and then migrate the metadata service.
[0142] In practical applications, steps 801 to 802 may be implemented based on a processor, and the processor may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0143] Through the directory creation method and metadata service management method provided in the embodiment of the present application, compared with the file management system implemented by static subtree partitioning in the prior art, when expanding or shrinking the metadata service, because the first data and the second data are isolated, the cost of migration such as expansion or shrinking of the metadata service is smaller; compared with the file management system based on dynamic subtree partitioning in the prior art, by binding the metadata service to the fixed second data, dynamic migration of the subtree will not occur during the metadata service migration process; by combining the hash partitioning of the directory, the directory is evenly distributed in each metadata service; compared with the metadata partitioning method based on hash operation in the prior art, the embodiment of the present application takes into account the depth of the directory when performing hash partitioning, so that the metadata of the directory has better locality.
[0144] like Fig. 9 As shown, taking the Linux system as an example, the following is a flowchart of another directory creation method combined with a specific application scenario.
[0145] Step 901: Execute the mkdir command and pre-check.
[0146] mkdir is a command used to create directories (or "folders") in Unix and Unix-like systems (such as Linux). The mkdir command can be used to create a new directory under the current directory.
[0147] The pre-check in this step refers to the process of performing necessary checks, tests or audits before creating a directory. For example, the pre-check may include checking whether the directory to be created already exists, checking whether the parent directory of the directory to be created exists, and auditing whether the current operation has the directory creation permission.
[0148] Step 902: Calculate and obtain the MDS where the parent directory of the directory to be created is located.
[0149] Here, you can first determine the parent directory of the directory to be created, perform a hash operation on the parent directory, and obtain the MDS where the parent directory of the directory to be created is located. Alternatively, you can search a preset directory and MDS relationship lookup table to find the MDS corresponding to the parent directory through the table.
[0150] Step 903: Send a directory creation request to the calculated MDS.
[0151] After obtaining the MDS (for example, the first MDS) corresponding to the parent directory, the client sends a directory creation request to the first MDS.
[0152] Step 904: Create a Dentry corresponding to the directory to be created.
[0153] After receiving the directory creation request sent by the client, the first MDS creates a Dentry corresponding to the directory to be created in the first MDS.
[0154] Step 905: Perform a hash operation on the unique identifier of the parent directory and the directory to be created, and obtain the MDS corresponding to the Inode as the second MDS.
[0155] For example, the unique identifier of the parent directory can be a unique mark for the parent directory. For example, the unique identifier of the parent directory can be set as a 64-bit mark, where the upper 10 bits of the 64-bit mark are the MDS identifier, supporting 0-1023, and the following 40 bits are the monotonically increasing count in a single MDS, that is, each time a file or directory is created, the identifier assigned to it will be increased by 1 on the original basis, and the remaining bits are temporarily reserved.
[0156] In this step, the unique identifier of the parent directory and the directory to be created are used as key values for hash operation input, and the second MDS corresponding to the Inode is obtained through hash operation.
[0157] Step 906: Send a message for creating an Inode to the second MDS.
[0158] The first MDS sends a message to the second MDS, where the message is used to instruct the second MDS to create a directory.
[0159] Step 907: Create a directory and corresponding Inode.
[0160] After receiving the message sent by the first MDS, the second MDS creates the directory to be created and its corresponding Inode.
[0161] Step 908: Send a creation success message to the first MDS.
[0162] After the second MDS completes the creation of the directory and its corresponding Inode, it sends a message of successful creation to the first MDS.
[0163] Step 909: The entire directory creation operation has been completed.
[0164] Step 910: The client receives a response message from the first MDS and considers that the entire directory creation operation is completed.
[0165] Fig. 9 The MDS shown in the figure is for exemplary purposes only. In actual applications, the distributed storage system may also include other MDSs in addition to the first MDS and the second MDS. Therefore, directory creation may also be performed in other MDSs.
[0166] The directory creation method given in the above steps corresponds to the directory creation method given in the above embodiment. It can be seen that before creating a new directory, it has been determined to which MDS the directory to be created and its corresponding Inode should belong. Therefore, the Inode and directory can be bound to the MDS. Based on this method, when the MDS cluster changes, load balancing can be performed directly on the MDS unit through a monitoring program. The specified MDS service can be pulled up on any computing node at will, thereby achieving MDS-level load balancing without causing data migration.
[0167] Based on the above Fig. 9 Middle method, Fig.10 Another MDS management method flow chart is given, which specifically includes:
[0168] Step 1001: Perform a pre-check.
[0169] The pre-check in this step refers to the process of performing necessary checks, tests or audits before MDS expansion. For example, the pre-check before MDS expansion can be a check on the current status of each server, a check on the current operating status of each MDS, or an audit of the second computing node to be migrated, etc.
[0170] Step 1002: Send a request to the control module.
[0171] The control module here may be a system monitor Monitor, and specifically here the user may send an MDS expansion request to the Monitor through a client.
[0172] Step 1003: Calculate that the MDS nodes that need to be migrated are MDS A and MDS C.
[0173] According to the method given in the above embodiment, the control module determines that the MDSs to be migrated are MDS A and MDS C through the number of nodes 1 and 2. Node 1 here can be the computing node mounted by all metadata services in the first computing power pool in the above embodiment, and node 2 can be the expansion computing node in the second computing power pool in the above embodiment.
[0174] Step 1004: Send a termination instruction to MDS A and MDS C of node 1.
[0175] The control module sends a termination instruction to MDS A and MDS C, and MDS A and MDS C suspend the pending tasks.
[0176] Step 1005: Send a migration instruction to node 2.
[0177] The control module sends a migration command to Node 2, and MDS A and MDS C can be started through Node 2. After MDS A and MDS C are migrated to Node 2, they are restarted and the running status of MDS A and MDS C before migration can be restored by loading OSD data.
[0178] Step 1006: Send creation instructions to Node 1 and Node 2.
[0179] like Fig.10 As shown, after completing the migration of MDS A and MDS C, the control module sends a creation instruction to node 1 to create MDS E and MDS F, and sends a creation instruction to node 2 to create MDS G and MDS H. Node 1 creates MDS E and MDS F based on the creation instruction, and node 2 creates MDS G and MDS H based on the creation instruction.
[0180] Step 1007: The capacity expansion operation is completed.
[0181] like Fig.10 As shown, after completing the above steps, the MDS in node one includes MDS B, MDSD, MDS E and MDS F, and the MDS in node two includes MDS A, MDS C, MDS G and MDS H, thereby realizing the expansion of the MDS in the computing node.
[0182] Fig.10 The nodes and the MDSs in the nodes shown are exemplary. In actual applications, other computing nodes besides node 1 and node 2 may be included, and the number of MDSs included in the nodes may also be one or more.
[0183] Through the MDS management method given in the above steps, by introducing a control module to control the MDS expansion, the MDS can be quickly moved to any node to achieve balance among the nodes.
[0184] Based on the directory creation method proposed in the above-mentioned embodiment, the embodiment of the present application also proposes a directory creation device, which is applied to the server 70 of the distributed storage system.
[0185] like Fig.11 As shown, Fig.11 A schematic diagram of the structure of a directory creation device is shown, which is applied to a server 70 of a distributed storage system, wherein the device includes:
[0186] The first determination module 1101 responds to the directory creation request and determines a first metadata service based on the operation information of all metadata services.
[0187] The second determining module 1102 is configured to determine a second metadata service based on the operation information of all metadata services.
[0188] The processing module 1103 is used to mount the first data of the directory to be created to the first metadata service, and to mount the second data of the directory to be created to the second metadata service.
[0189] Among them, the first metadata service and the second metadata service are different metadata services; the first data is used to describe the storage location of the metadata file in the global directory; the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or subdirectory relationship of the directory to be created; the directory to be created is the root directory or any subdirectory in the global directory.
[0190] In practical applications, the first determination module 1101, the second determination module 1102, and the processing module 1103 may be implemented based on a processor and a communication device.
[0191] In some embodiments, the directory creation request includes the depth of the directory to be created; the second determination module 1102 is specifically used to perform a hash operation based on the operation information of all metadata services and the depth of the directory to be created to determine the second metadata service.
[0192] In some embodiments, when the directory to be created is any subdirectory in the global directory, the first metadata service is the metadata service where the second data of the parent directory of the directory to be created is located; the second determination module 1102 is also used to obtain the identifier of the parent directory; the second determination module 1102 is specifically used to perform hash operations based on the running information of all metadata services, the depth of the directory to be created, and the identifier of the parent directory to determine the second all metadata services.
[0193] In some embodiments, the processing module 1103 is further configured to bind the second data to the second MDS.
[0194] Based on the metadata service management method proposed in the above embodiment, the embodiment of the present application also proposes a metadata service management device, such as Fig.12 As shown, Fig.12 A schematic diagram of the structure of a metadata service management device is shown, which is applied to a server 70 of a distributed storage system, wherein the server 70 includes a computing node and a metadata service, any metadata service is mounted on a corresponding computing node, the computing node is used to provide computing power for the metadata service, the metadata service is used to store a directory, the directory in the metadata service is created based on the directory creation method in the above embodiment, and the metadata service management device includes:
[0195] The third determination module 1201 is used to determine the target metadata service to be migrated to the second computing power pool based on the load capacity of the first computing power pool and the load capacity of the second computing power pool; wherein, before the target metadata service is migrated, the first computing power pool includes computing nodes mounted with all metadata services; and the second computing power pool includes expansion computing nodes for receiving the target metadata service.
[0196] The first migration module 1202 is used to migrate the target metadata service to the corresponding expanded computing node in the second computing power pool.
[0197] In practical applications, the third determination module 1201 and the first migration module 1202 can be implemented based on a processor and a communication device.
[0198] In some embodiments, before migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the first migration module 1202 is also used to, when there are pending tasks for the target metadata service, instruct the target metadata service to record the pending tasks, obtain the record information, and instruct the pending tasks to execute the exit process; after migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the first migration module 1202 is also used to restart each target metadata service migrated to the expanded computing node, and instruct the target metadata service migrated to the expanded computing node to restore the pending tasks according to the record information.
[0199] In some embodiments, the first migration module 1202 is specifically used to instruct the target metadata service migrated to the expanded computing node to obtain metadata in the storage node according to the record information, and to restore the pending tasks according to the metadata.
[0200] Based on the metadata service management method proposed in the above embodiment, the embodiment of the present application also proposes another metadata service management device, such as Fig.13 As shown, Fig.13 A schematic diagram of the structure of a metadata service management device is shown, which is applied to a server 70 of a distributed storage system, wherein multiple metadata services are run on the server 70, and computing nodes are used to provide computing power for the metadata services. Any metadata service is mounted on a corresponding computing node. The metadata service is used to store directories. The directories in the metadata service are created based on the directory creation method in the above embodiment. The metadata service management device includes:
[0201] The fourth determination module 1301 is used to determine the target existing computing node for receiving the target metadata service based on the load capacity of each existing computing node in the first computing power pool and the load capacity of the reduced computing node in the first computing power pool; wherein, before the target metadata service is migrated, the target metadata service is mounted on the reduced computing node; before the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes and reduced computing nodes, and after the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes.
[0202] The second migration module 1302 is used to migrate the target metadata service to the corresponding target stock computing node.
[0203] The device of this embodiment is used to migrate metadata services. When there are tasks to be processed in the metadata service to be migrated, the method given in the above embodiment can also be used to suspend the tasks in the metadata service to be migrated, and then migrate the metadata service.
[0204] In practical applications, the fourth determination module 1301 and the second migration module 1302 can be implemented based on a processor and a communication device.
[0205] It should be noted that the description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the same method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0206] It should be noted that in the embodiments of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a terminal, a server, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0207] An embodiment of the present application also provides a server of a distributed storage system. Fig.14 A schematic diagram of the composition structure of a server of a distributed storage system provided in an embodiment of the present application is shown in FIG. Fig.14 As shown, the server 70 may include: a communication interface, a control module, a metadata service, and a backend storage node; the control module is connected to multiple metadata services, and the metadata service is connected to multiple backend storage nodes. The server 70 is used to connect to at least one client through the communication interface, and the server 70 is used to provide distributed storage services to the client through any of the above-mentioned directory creation methods, or any of the above-mentioned metadata service management methods.
[0208] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.15 As shown, the electronic device 150 may include:
[0209] The memory 1501 is used to store executable instructions.
[0210] The processor 1502 is used to implement any one of the above-mentioned directory creation methods or any one of the above-mentioned metadata service management methods when executing the executable instructions stored in the memory 1501.
[0211] The processor 1502 may be at least one of an ASIC, a DSP, a DSPD, a PLD, a FPGA, a CPU, a controller, a microcontroller, and a microprocessor.
[0212] The above-mentioned computer-readable storage medium or memory 1501 can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0213] Correspondingly, an embodiment of the present application further provides a computer storage medium, on which computer executable instructions are stored, and the computer executable instructions are used to implement any one of the directory creation methods provided in the above embodiments, or to implement any one of the above metadata service management methods.
[0214] Correspondingly, an embodiment of the present application further provides a computer program product, which includes computer executable instructions, and the computer executable instructions are used to implement any one of the directory creation methods provided in the above embodiments, or implement any one of the above metadata service management methods.
[0215] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0216] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0217] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0218] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0219] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0220] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0221] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A directory creation method, characterized in that: A control module applied to a server of a distributed storage system, the method comprising: In response to the catalog creation request, determining a first metadata service based on the operation information of all metadata services; Determining a second metadata service based on the operation information of all metadata services; Mounting the first data of the directory to be created to the first metadata service, and mounting the second data of the directory to be created to the second metadata service; Among them, the first metadata service and the second metadata service are different metadata services; the first data is used to describe the storage location of the metadata file in the global directory; the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or subdirectory relationship of the directory to be created; the directory to be created is the root directory or any subdirectory in the global directory.
2. The method according to claim 1, characterized in that The directory creation request includes the depth of the directory to be created; The determining the second metadata service based on the operation information of all metadata services includes: A hash operation is performed based on the operation information of all metadata services and the depth of the directory to be created to determine the second metadata service.
3. The method according to claim 2, characterized in that The probability that the directory to be created is broken up is negatively correlated with the depth of the directory to be created.
4. The method according to claim 2, characterized in that: In the case where the directory to be created is any subdirectory in the global directory, the first metadata service is a metadata service where the second data of the parent directory of the directory to be created is located, and the method further includes: Obtaining an identifier for the parent directory; The performing hash operation based on the operation information of all metadata services and the depth of the directory to be created to determine the second metadata service includes: A hash operation is performed based on the operation information of all metadata services, the depth of the directory to be created, and the identifier of the parent directory to determine the second metadata service.
5. The method according to claim 1, characterized in that The method further comprises: Bind the second data to the second metadata service.
6. A metadata service management method, characterized in that: A control module applied to a server of a distributed storage system, wherein a plurality of metadata services are running on the server, and computing nodes are used to provide computing power for the metadata services, any metadata service is mounted on a corresponding computing node, the metadata service is used to store a directory, the directory in the metadata service is created based on the method in any one of claims 1 to 5, and the management method of the metadata service comprises: Based on the load capacity of the first computing power pool and the load capacity of the second computing power pool, determine the target metadata service to be migrated to the second computing power pool; wherein, before the migration of the target metadata service, the first computing power pool includes all computing nodes mounted by the metadata service; the second computing power pool includes an expansion computing node for receiving the target metadata service; Migrate the target metadata service to the corresponding expanded computing node in the second computing power pool.
7. The method according to claim 6, characterized in that Before migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the method further includes: When there is a pending task in the target metadata service, instruct the target metadata service to record the pending task, obtain record information, and instruct the pending task to execute an exit process; After migrating the target metadata service to the corresponding expanded computing node in the second computing power pool, the method further includes: Restart each target metadata service migrated to the expanded computing node, and instruct the target metadata service migrated to the expanded computing node to resume the pending tasks according to the recorded information.
8. The method according to claim 7, characterized in that The instructing the target metadata service migrated to the expanded computing node to resume the pending task according to the record information includes: The target metadata service migrated to the expanded computing node is instructed to obtain metadata in the storage node according to the record information, and to resume the pending tasks according to the metadata.
9. A metadata service management method, characterized in that: A control module applied to a server of a distributed storage system, wherein a plurality of metadata services are running on the server, and computing nodes are used to provide computing power for the metadata services, any metadata service is mounted on a corresponding computing node, the metadata service is used to store a directory, the directory in the metadata service is created based on the method in any one of claims 1 to 5, and the management method of the metadata service comprises: Based on the load capacity of each existing computing node in the first computing power pool and the load capacity of the reduced computing node in the first computing power pool, determine the target existing computing node for receiving the target metadata service; wherein, before the target metadata service is migrated, the target metadata service is mounted on the reduced computing node; before the first computing power pool is reduced in capacity, the first computing power pool includes the existing computing nodes and the reduced computing nodes, and after the first computing power pool is reduced in capacity, the first computing power pool includes the existing computing nodes; Migrate the target metadata service to the corresponding target inventory computing node.
10. A directory creation device, characterized in that: A server applied to a distributed storage system, the device comprising: A first determination module, configured to respond to a directory creation request and determine a first metadata service based on operation information of all metadata services; A second determination module, configured to determine a second metadata service based on the operation information of all metadata services; A processing module, used for mounting first data of the directory to be created to the first metadata service, and mounting second data of the directory to be created to the second metadata service; Among them, the first metadata service and the second metadata service are different metadata services; the first data is used to describe the storage location of the metadata file in the global directory; the second data is used to describe the metadata file, the file distribution of the directory to be created, and the parent directory relationship and / or subdirectory relationship of the directory to be created; the directory to be created is the root directory or any subdirectory in the global directory.
11. A metadata service management device, characterized in that: A server applied to a distributed storage system, wherein the server includes a computing node and a metadata service, any metadata service is mounted on a corresponding computing node, the computing node is used to provide computing power for the metadata service, the metadata service is used to store a directory, the directory in the metadata service is created based on the method in any one of claims 1 to 5, and the management device of the metadata service includes: A third determination module is used to determine the target metadata service to be migrated to the second computing power pool based on the load capacity of the first computing power pool and the load capacity of the second computing power pool; wherein, before the target metadata service is migrated, the first computing power pool includes computing nodes mounted by all metadata services; and the second computing power pool includes expansion computing nodes for receiving the target metadata service; The first migration module is used to migrate the target metadata service to the corresponding expanded computing node in the second computing power pool.
12. A metadata service management device, characterized in that: A server applied to a distributed storage system, wherein the server includes a computing node and a metadata service, any metadata service is mounted on a corresponding computing node, the computing node is used to provide computing power for the metadata service, the metadata service is used to store a directory, the directory in the metadata service is created based on the method in any one of claims 1 to 5, and the management device of the metadata service includes: A fourth determination module is used to determine a target existing computing node for receiving a target metadata service based on the load capacity of each existing computing node in the first computing power pool and the load capacity of the reduced computing node in the first computing power pool; wherein, before the target metadata service is migrated, the target metadata service is mounted on the reduced computing node; before the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes and reduced computing nodes, and after the first computing power pool is reduced in capacity, the first computing power pool includes existing computing nodes; The second migration module is used to migrate the target metadata service to the corresponding target stock computing node.
13. A server of a distributed storage system, characterized in that: The server includes a communication interface, a control module, a metadata service, and a backend storage node; the control module is connected to multiple metadata services, and the metadata service is connected to multiple backend storage nodes. The server is used to connect to at least one client through the communication interface, and the control module is used to provide distributed storage services for the client through the method described in any one of claims 1 to 5, or the method described in any one of claims 6 to 8, or the method described in claim 9.
14. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 5, or implements the method described in any one of claims 6 to 8, or implements the method described in claim 9.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 5, or implements the method according to any one of claims 6 to 8, or implements the method according to claim 9.