Distributed storage metadata management method and device
By using the first bus and the first bus memory device to share metadata processing records in the metadata server cluster, and dynamically determine the migration and migration to the server, the problems of low efficiency of static metadata management and unbalanced load are solved, and efficient metadata management and load balancing are achieved.
Patent Information
- Application Number
- CN202510111390.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-23
AI Technical Summary
In the prior art, the management efficiency of static metadata is low, and it is impossible to dynamically adjust the load of the metadata server according to the real-time workload of the server, resulting in load imbalance.
By introducing the first bus and the first bus memory device into the metadata server cluster, the metadata processing records of each server for static metadata are shared, and the metadata migration and migration to the server dynamically determine the metadata migration and migration to the server based on these records, thereby realizing the load balancing transfer of metadata.
It reduces the time required to obtain metadata processing records, improves the management efficiency of static metadata, solves the problem of low static metadata management efficiency, and realizes dynamic adjustment of load balancing.
Smart Images

Figure CN119557107B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and more specifically, to a distributed storage metadata management method and device. Background Art
[0002] In the related art, for static metadata management, the load of the metadata server cannot be dynamically adjusted according to the real-time workload of the server, which easily causes load imbalance in the metadata server cluster. If the static metadata is managed directly using a dynamic management method, each server must initiate a data request to other servers in the cluster to obtain the processing record of the static metadata, which takes a long time, resulting in low management efficiency of static metadata. Therefore, there is a problem of low management efficiency of static metadata.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a distributed storage metadata management method and device to at least solve the problem of low management efficiency of static metadata in the related art.
[0005] According to an embodiment of the present application, a metadata management method for distributed storage is provided, which is applied to metadata servers in a metadata server cluster, wherein the static metadata in the metadata server cluster is distributed to the servers in the metadata server cluster in turn for management, wherein the servers are interconnected with a first bus memory device via a first bus, and the first bus memory device is used to share metadata processing records of the static metadata by the servers, including: reading the metadata processing record from the first bus memory device; obtaining a hotspot attribute of the metadata server according to the metadata processing record, wherein the hotspot attribute is used to measure the load of the metadata server; determining a metadata migration server from the metadata server cluster, wherein the hotspot attribute of the metadata migration server meets the attribute condition of a hot-frequency metadata server; determining a metadata migration server from the metadata server cluster, wherein the hotspot attribute of the metadata migration server meets the attribute condition of a cold-frequency metadata server; and transferring all or part of the metadata in the metadata migration server to the metadata migration server.
[0006] According to another embodiment of the present application, a metadata management device for distributed storage is provided, which is applied to a metadata server in a metadata server cluster, wherein the static metadata in the metadata server cluster is sequentially distributed to each server in the metadata server cluster for management, wherein each server is interconnected with a first bus memory device via a first bus, and the first bus memory device is used to share metadata processing records of the static metadata by each server, including: a first reading unit, used to read the metadata processing record from the first bus memory device; a first obtaining unit, used to obtain a hotspot attribute of the metadata server according to the metadata processing record, wherein the hotspot attribute is used to measure the load of the metadata server; a first determining unit, used to determine a metadata migration server from the metadata server cluster, wherein the hotspot attribute of the metadata migration server meets the attribute condition of a hot-frequency metadata server; a second determining unit, used to determine a metadata migration server from the metadata server cluster, wherein the hotspot attribute of the metadata migration server meets the attribute condition of a cold-frequency metadata server; and a first transferring unit, used to transfer all or part of the metadata in the metadata migration server to the metadata migration server.
[0007] As an optional solution, the above-mentioned first determination unit includes: a first screening module, which is used to screen the above-mentioned metadata servers based on the hot spot attributes of the above-mentioned metadata servers to obtain N candidate migration servers, where N is a positive integer; the first determination module, which is used to determine the above-mentioned N candidate migration servers as the above-mentioned metadata migration servers when N is 1; and a second screening module, which is used to perform a second screening on the above-mentioned N candidate migration servers based on the hot spot attributes of the above-mentioned metadata servers to obtain the above-mentioned metadata migration server when N is greater than 1.
[0008] As an optional solution, the above-mentioned first screening module includes: a first acquisition sub-module, used to obtain the request records of the above-mentioned each metadata server for each metadata; a second acquisition sub-module, used to use the above-mentioned request records to obtain the number of metadata requests of the above-mentioned each metadata server within a preset period, and use the above-mentioned request records to obtain the average request response time of metadata requests of the above-mentioned metadata server cluster within the above-mentioned preset period, wherein the above-mentioned hot spot attributes include the above-mentioned metadata request number and the above-mentioned average request response time.
[0009] As an optional solution, the second acquisition submodule includes: a first acquisition subunit, used to use the request record to obtain a first value, wherein the first value is the sum of the average response time of requests from the above-mentioned metadata servers within the preset period and the number of metadata requests; a second acquisition subunit, used to use the request record to obtain a second value, wherein the second value is the sum of the number of metadata requests from the above-mentioned metadata servers within the preset period; a third acquisition subunit, used to obtain the average request response time based on the first value and the second value, wherein the average request response time is the quotient of the first value and the second value.
[0010] As an optional scheme, the above-mentioned first screening module includes: a third acquisition submodule, used to use the above-mentioned request record to obtain the third value corresponding to the above-mentioned each metadata server, wherein the above-mentioned third value is the difference between the average response time of the requests of the above-mentioned each metadata server within the above-mentioned preset period and the above-mentioned average request response time; a first determination submodule, used to determine the above-mentioned N candidate migration servers from the above-mentioned metadata server cluster based on the above-mentioned third value, wherein the third value corresponding to the above-mentioned candidate migration server is greater than or equal to the preset threshold.
[0011] As an optional solution, the second screening module includes: a fourth acquisition submodule, which is used to obtain the load hotspot value corresponding to each candidate migration server in the N candidate migration servers according to the load hotspot formula; the load hotspot formula includes:
[0012] ,
[0013] Among them, Load ij Meta_load is the load hotspot value of the i-th metadata server in the j-th period. ij is the number of metadata requests from the ith metadata server in the jth period, D i(j-1) Meta_load is the difference between the average request response time of the ith metadata server in the j-1th period and the average request response time of the metadata server cluster. i(j-1) is the number of metadata requests of the i-th metadata server in the j-1-th period; the second determination submodule is used to use the above-mentioned load hotspot value to determine the above-mentioned metadata migration server from the above-mentioned metadata server cluster, wherein the load hotspot value corresponding to the above-mentioned metadata migration server is the largest in the above-mentioned metadata server cluster.
[0014] As an optional solution, the above-mentioned first transfer unit includes: an acquisition module, used to obtain the target directory set of the above-mentioned metadata migration server, wherein the above-mentioned target directory set is a set of all top-level subdirectories managed by the above-mentioned metadata migration server; a second determination module, used to determine the directory to be migrated from the above-mentioned target directory set, wherein the metadata in the above-mentioned directory to be migrated is set to be transferred to the above-mentioned metadata migration server.
[0015] As an optional solution, the above-mentioned second determination module includes: a fifth acquisition sub-module, used to obtain the sum of weighted voting values corresponding to each directory in the above-mentioned target directory set, wherein the above-mentioned weighted voting value is a value obtained by weighted calculation based on each metadata access record in the above-mentioned directory and the difference between the time when the metadata access occurs and the current time.
[0016] As an optional scheme, the above-mentioned second determination unit includes: a third determination module, which is used to use the above-mentioned load hotspot value to determine the above-mentioned metadata migration server from the above-mentioned metadata server cluster, wherein the load hotspot value corresponding to the above-mentioned metadata migration server is the smallest in the above-mentioned metadata server cluster.
[0017] As an optional solution, the above-mentioned first reading unit includes: a splitting module, used to split the directory structure of the file system into multiple directory subtrees; a distribution module, used to distribute the above-mentioned multiple directory subtrees in sequence to the above-mentioned metadata servers, so that the subdirectory and file metadata information in the same directory are maintained by the same metadata server, wherein the above-mentioned file metadata information includes the above-mentioned static metadata.
[0018] As an optional solution, the above-mentioned distribution module includes: a calculation submodule, which is used to perform hash calculation according to the file path name to obtain a hash value; a modulus operation module, which is used to use the above-mentioned hash value to perform a modulus operation on the number of metadata service instances to determine the metadata service instance number corresponding to the above-mentioned file path name; a distribution submodule, which is used to randomly distribute the above-mentioned multiple directory subtrees to the metadata service instances configured inside the above-mentioned each metadata server according to the above-mentioned metadata service instance number.
[0019] As an optional solution, the above-mentioned distribution module includes: a creation sub-module, which is used to create a metadata mapping table based on the mapping relationship between the directory names corresponding to different directory subtrees in the above-mentioned multiple directory subtrees and the above-mentioned metadata servers, wherein the above-mentioned metadata mapping table is used to locate and access the required static metadata.
[0020] As an optional solution, the first reading unit includes: a connection module, used to connect the above-mentioned metadata servers to a first bus memory device, wherein the first bus memory device is used to provide a shared memory space for the above-mentioned metadata servers.
[0021] As an optional solution, the connection module includes: a storage submodule, which is used to store a global metadata mapping table through the first value memory slice in the first bus memory device, wherein the global metadata mapping table records the correspondence between the static metadata and the metadata servers; a first allocation submodule, which is used to allocate the corresponding second value memory slice to each of the metadata servers through the first bus memory device as the metadata cache space of the corresponding metadata server, wherein the data in the second value memory slice is set to allow the corresponding metadata server to read and write access, while prohibiting other metadata servers from modifying it; a second allocation submodule, which is used to allocate the corresponding third value memory slice to each of the metadata servers through the first bus memory device, wherein the third value memory slice is used to store the metadata request information of the corresponding metadata server, and the metadata The data request information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it; the third allocation submodule is used to allocate the corresponding fourth value memory slices to each of the above-mentioned metadata servers through the above-mentioned first bus memory device, wherein the above-mentioned fourth value memory slices are used to store the metadata reply information of the corresponding metadata server, and the above-mentioned metadata reply information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it; the fourth allocation submodule is used to allocate the corresponding fifth value memory slices to each of the above-mentioned metadata servers through the above-mentioned first bus memory device as the first bus memory metadata request history record circular buffer and load statistics area of the corresponding metadata server, wherein the data in the above-mentioned fifth value memory slices is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it.
[0022] As an optional solution, the above-mentioned first reading unit includes: a configuration module, used to configure a smart network card for the above-mentioned each metadata server, wherein the above-mentioned smart network card is used to capture metadata requests and metadata replies of the above-mentioned each metadata server, and the metadata requests and metadata replies captured by the above-mentioned smart network card are set to be stored in the shared memory of the above-mentioned first bus.
[0023] As an optional solution, the above-mentioned device includes: a second reading unit, used to read the above-mentioned other metadata processing records from the above-mentioned second bus memory device; a second acquisition unit, used to acquire the hotspot attributes of each server of the above-mentioned other metadata server cluster according to the above-mentioned other metadata processing records; a third determination unit, used to determine other metadata migration-out servers from the above-mentioned other metadata server cluster based on the hotspot attributes of each server of the above-mentioned other metadata server cluster; a fourth determination unit, used to determine other metadata migration-in servers from the above-mentioned other metadata server cluster based on the hotspot attributes of each server of the above-mentioned other metadata server cluster; a second transfer unit, used to transfer all or part of the metadata in the above-mentioned other metadata migration-out server to the above-mentioned other metadata migration-in server.
[0024] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0025] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0026] Through the present application, the static metadata in the server cluster is distributed to each server of the meta server cluster in sequence, and each server is connected to each other through the first bus and the first bus memory device, and the first bus memory device is used to share the metadata processing records of each server for the static metadata, so that when performing dynamic management of static metadata, the processing records of the static metadata can be directly read from the uprising bus memory device, without having to request data from each server separately, reducing the time required to obtain the metadata processing record, thereby improving the management efficiency of static metadata. Since the time required to obtain the metadata processing record is reduced, the problem of low management efficiency of static metadata can be solved, thereby achieving the technical effect of improving the management efficiency of static metadata. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a schematic diagram of an application environment of a metadata management method for distributed storage according to an embodiment of the present application;
[0028] Figure 2 is a flowchart of a metadata management method for distributed storage according to an embodiment of the present application;
[0029] Figure 3is a schematic diagram of a metadata management method for distributed storage according to an embodiment of the present application;
[0030] Figure 4 is a schematic diagram of a metadata management method for distributed storage according to an embodiment of the present application;
[0031] Figure 5 is a schematic diagram of a metadata management method for distributed storage according to an embodiment of the present application;
[0032] Figure 6 is a schematic diagram of a metadata management method for distributed storage according to an embodiment of the present application;
[0033] Figure 7 is a schematic diagram of a metadata management method for distributed storage according to an embodiment of the present application;
[0034] Figure 8 It is a structural block diagram of a metadata management device for distributed storage according to an embodiment of the present application. DETAILED DESCRIPTION
[0035] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0037] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a distributed storage metadata management method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0038] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the metadata management method of distributed storage in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0039] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0040] In this embodiment, a distributed storage metadata management method is provided, which is applied to metadata servers in a metadata server cluster. Static metadata in the metadata server cluster is distributed to each server in the metadata server cluster in turn for management. Each server is connected to a first bus memory device through a first bus. The first bus memory device is used to share metadata processing records of each server on the static metadata. Figure 2 is a flowchart of a metadata management method for distributed storage according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0041] Step S202, reading metadata processing records from the first bus memory device;
[0042] In an optional embodiment, static metadata may be understood as, but is not limited to, metadata that rarely changes during a life cycle.
[0043] In an optional embodiment, the first bus may be, but is not limited to, a high-speed data transmission network used to connect various servers in the metadata server cluster so that each server in the metadata server cluster can quickly exchange data and information.
[0044] In an optional embodiment, the metadata service cluster can be understood as, but not limited to, a group of servers that are jointly responsible for managing, storing and distributing static metadata. The metadata servers in the metadata server cluster can be, but not limited to, interconnected via a first bus and share memory.
[0045] It should be noted that metadata that is not frequently modified, i.e. static metadata, is evenly distributed to each metadata server in the cluster for processing and storage. This can prevent a server from being overloaded due to storing too much metadata, while utilizing the multi-server resources of the cluster to improve the overall processing capacity and response speed.
[0046] It should be noted that connecting each server in the metadata server cluster with a high-speed link allows these servers to share data with lower latency and higher bandwidth. At the same time, they are all connected to a shared memory area for storing metadata or other key information, making data exchange and access between servers more efficient, reducing data transmission delays, and improving the system's concurrent processing capabilities and data consistency.
[0047] Step S204: acquiring the hotspot attribute of the metadata server according to the metadata processing record, wherein the hotspot attribute is used to measure the load condition of the metadata server.
[0048] In an optional embodiment, the hotspot attribute may be, but is not limited to, a characteristic used to quantify the load of the metadata server, and may be, but is not limited to, the number of metadata requests, the average request response time, etc. It may be, but is not limited to, determining the load by identifying the number of requests processed by the server.
[0049] In an optional embodiment, the dynamic adjustment may be, but is not limited to, automatically adjusting the distribution of static metadata according to the system runtime conditions to achieve load balancing and improve the overall system performance.
[0050] In an optional embodiment, the load condition of the metadata server may be understood as, but not limited to, data used to describe the metadata server's ability to process requests and its current workload.
[0051] It should be noted that the system will decide when and how to redistribute static metadata based on the load of each metadata server, i.e., the dynamic adjustment mechanism, to ensure that no server becomes a bottleneck due to high load. The dynamic adjustment mechanism enables the system to automatically optimize the distribution of metadata at runtime to avoid uneven server load, thereby improving the overall performance and stability of the system.
[0052] S206, determining a metadata migration server from the metadata server cluster, wherein the hotspot attribute of the metadata migration server meets the attribute condition of the hotspot metadata server;
[0053] In an optional embodiment, the metadata migration server can be understood as, but not limited to, a server in the metadata server cluster that needs to reduce metadata storage burden according to hotspot attributes, that is, metadata is migrated from the metadata server to balance the load. Hotspot attributes can be understood as, but not limited to, the number or frequency of user reading within a certain period of time.
[0054] In an optional embodiment, the attribute condition of the hot metadata server may be understood as, but not limited to, the number of times or frequency of users reading metadata within a specific time threshold is higher than a specific threshold. The hot attribute of the metadata migration server meets the attribute condition of the hot server, but not limited to, the number of times or frequency of users reading metadata from the metadata migration server within a specific time is higher than a specific threshold.
[0055] To further illustrate, assuming that the attribute condition of a hot server is that it is accessed more than 100 times in a day, if all metadata of a server is accessed 130 times in a day, it can be understood that the hot attribute of the server meets the attribute condition of a hot metadata server and can be determined as a metadata migration server.
[0056] S208, determining a metadata migration server from the metadata server cluster, wherein the hot attribute of the metadata migration server meets the attribute condition of the cold metadata server;
[0057] In an optional embodiment, the metadata migration server may be, but is not limited to, a server in a metadata server cluster that is used to receive metadata based on hotspot attributes, and may be, but is not limited to, be used to receive and store metadata from a metadata migration server.
[0058] In an optional embodiment, the attribute condition of the cold-frequency metadata server may be understood, but not limited to, as follows: within a specific time threshold, the number of times or frequency of users reading metadata is lower than a specific threshold. The hot attribute of the metadata migration server meets the attribute condition of the cold-frequency server, but not limited to, as follows: within a specific time, the number of times or frequency of users reading metadata from the metadata migration server is lower than a specific threshold.
[0059] To further illustrate, assuming that the attribute condition of a cold-frequency server is that it is accessed less than 30 times a day, if all the metadata of a server is accessed 20 times a day, it can be understood that the hotspot attribute of the server meets the attribute condition of a cold-frequency metadata server and can be determined as a metadata migration server.
[0060] It should be noted that there is no specific execution order for the above steps S206 and S208 , that is, S206 may be executed first and then S208 , or S208 may be executed first and then S206 .
[0061] S210, transferring all or part of the metadata in the metadata-migrating server to the metadata-migrating server.
[0062] It should be noted that the system analyzes the hotspot attributes of each metadata server, identifies servers with excessive load as servers to be migrated out, and identifies servers with low load as servers to be migrated in, in preparation for metadata migration. That is, through analysis based on hotspot attributes, it is possible to identify servers with excessive load that need to migrate metadata out, and servers with low load that can bear more metadata, which helps to dynamically optimize resource allocation and improve the overall efficiency and stability of the system.
[0063] In addition, in static metadata management, there is a problem that metadata storage cannot be dynamically adjusted according to the real-time load conditions and metadata access popularity, which can easily cause the problem of load imbalance in the metadata server cluster. If it is directly combined with dynamic management, then for each server, it is necessary to first initiate a data collection request to other servers in the cluster, and then obtain the metadata processing records of other servers. This is time-consuming. The status of each server may have changed during the data collection period, and the accuracy of dynamic management cannot be guaranteed.
[0064] In the embodiment of the present application, during dynamic management, the metadata processing records of each server for static metadata are directly read from the first bus memory device without separately requesting data acquisition from each server. This reduces the time required for collecting data on the one hand, and on the other hand, even if the server changes, it can ensure that the collected data is correct, thereby taking into account both the management efficiency and accuracy of static metadata.
[0065] Through the present application, the static metadata in the server cluster is distributed to each server of the meta server cluster in sequence, and each server is connected to each other through the first bus and the first bus memory device, and the first bus memory device is used to share the metadata processing records of each server for the static metadata, so that when performing dynamic management of static metadata, the processing records of the static metadata can be directly read from the uprising bus memory device, without having to request data from each server separately, reducing the time required to obtain the metadata processing record, thereby improving the management efficiency of static metadata. Since the time required to obtain the metadata processing record is reduced, the problem of low management efficiency of static metadata can be solved, thereby achieving the technical effect of improving the management efficiency of static metadata.
[0066] The execution subject of the above steps may be a server, a terminal, etc., but is not limited thereto.
[0067] As an optional solution, based on the hotspot attributes of each metadata server, a metadata migration server is determined from the metadata server cluster, including:
[0068] S1-1, based on the hotspot attributes of each metadata server, each metadata server is screened to obtain N candidate migration servers, where N is a positive integer;
[0069] S1-2, when N is 1, N candidate migration servers are determined as metadata migration servers;
[0070] S1-3, when N is greater than 1, based on the hotspot attributes of each metadata server, N candidate migration servers are screened for the second time to obtain the metadata migration server.
[0071] In an optional embodiment, the candidate migration-out server may be, but is not limited to, a set of servers preliminarily screened out from the metadata server cluster that may need to migrate metadata, and may be, but is not limited to, have a higher hotspot attribute value.
[0072] It should be noted that the metadata servers with higher hotspot attribute values are found through a primary screening, and then a secondary screening is performed based on the number of screening results to more accurately determine the servers that most need metadata migration. By screening and determining the servers to be migrated in stages, the problem of uneven load in the metadata server cluster can be flexibly dealt with, and servers with higher loads can be quickly identified, and metadata migration is performed only on servers that need to be unloaded.
[0073] Through the embodiment of the present application, based on the hotspot attributes of each metadata server, each metadata server is screened once to obtain N candidate migration servers, where N is a positive integer; when N is 1, the N candidate migration servers are determined as metadata migration servers; when N is greater than 1, based on the hotspot attributes of each metadata server, the N candidate migration servers are screened twice to obtain metadata migration servers. Thus, the technical purpose of screening migration servers by hotspot attributes is achieved, and the technical effect of quickly identifying servers with higher loads is achieved.
[0074] As an optional solution, before screening each metadata server based on the hotspot attribute of each metadata server, the method further includes:
[0075] S2-1, obtaining the request record of each metadata server for each metadata;
[0076] S2-2, using request records to obtain the number of metadata requests for each metadata server within a preset period, and using request records to obtain the average request response time of metadata requests for the metadata server cluster within a preset period, wherein hotspot attributes include the number of metadata requests and the average request response time.
[0077] In an optional embodiment, the request record may be, but is not limited to, detailed information about each metadata request retained in the system, and may include, but is not limited to, the timestamp of the request, the metadata identifier of the request, the type of request operation, etc., and may be, but is not limited to, used to analyze the load situation and request pattern of the metadata server.
[0078] It should be noted that by collecting all request records generated by each metadata server when processing metadata requests, these records provide raw data on server load conditions. By saving detailed information on each request, the system can perform historical data analysis and provide basic data support for subsequent load assessment and adjustment.
[0079] In an optional embodiment, the preset period may be, but is not limited to, a time window set by the system, may be, but is not limited to, used to count the number of requests to the metadata server and calculate the average request response time, and may be, but is not limited to, a fixed time interval.
[0080] In an optional embodiment, the average request response time may be, but is not limited to, the average time for the metadata server cluster to process all metadata requests within a preset period, and may be, but is not limited to, used to reflect the processing efficiency and response speed of the server cluster.
[0081] It should be noted that by collecting and analyzing the request records of the metadata server, the number of metadata requests within a preset period and the average request response time of the metadata server cluster are calculated as a way to determine the hotspot attributes, thereby ensuring that the system can make analysis based on real-time and historical load data when making metadata migration decisions, thereby more accurately selecting the servers to be migrated out and the servers to be migrated in, effectively avoiding server overload and improving the efficiency of metadata management.
[0082] Through the embodiment of the present application, the request records of each metadata server for each metadata are obtained; the number of metadata requests of each metadata server within a preset period is obtained by using the request records, and the average request response time of metadata requests of the metadata server cluster within the preset period is obtained by using the request records, wherein the hotspot attributes include the number of metadata requests and the average request response time. Thus, the technical purpose of obtaining the request records of the metadata server is achieved, and the technical effect of obtaining the average request response time is achieved.
[0083] As an optional solution, the average request response time of metadata requests of the metadata server cluster within a preset period is obtained, including:
[0084] S3-1, using the request record, obtaining a first value, wherein the first value is the sum of an average response time of requests from each metadata server within a preset period and the number of metadata requests;
[0085] S3-2, using the request record to obtain a second value, wherein the second value is the sum of the number of metadata requests of each metadata server within a preset period;
[0086] S3-3, based on the first value and the second value, obtain an average request response time, wherein the average request response time is the quotient of the first value and the second value.
[0087] In an optional embodiment, the first value may be, but is not limited to, the sum of the average response time of requests from each metadata server within a preset period and the number of metadata requests. The second value may be, but is not limited to, the sum of the number of metadata requests from each metadata server within a preset period.
[0088] It should be noted that by obtaining the first value and the second value, the average request response time is calculated, which provides a quantitative standard for evaluating the performance and load of the metadata server cluster. The calculation result of the average request response time can be used as an important basis for dynamically adjusting the metadata distribution strategy, and can also be used as a basis for starting dynamic load balancing to improve the overall response speed and processing efficiency.
[0089] Through the embodiment of the present application, the first value is obtained by using the request record, wherein the first value is the sum of the average response time of the requests of each metadata server within a preset period and the number of metadata requests; the second value is obtained by using the request record, wherein the second value is the sum of the number of metadata requests of each metadata server within a preset period; based on the first value and the second value, the average request response time is obtained, wherein the average request response time is the quotient of the first value and the second value. Thus, the technical purpose of obtaining the first value and the second value by using the request record is achieved, and the technical effect of obtaining the average request response time is realized.
[0090] As an optional solution, based on the hotspot attributes of each metadata server, each metadata server is screened to obtain N candidate migration servers, including:
[0091] S4-1, using the request record, obtaining a third value corresponding to each metadata server, wherein the third value is the difference between an average response time of requests to each metadata server within a preset period and an average request response time;
[0092] S4-2, based on the third value, determine N candidate migration servers from the metadata server cluster, wherein the third value corresponding to the candidate migration server is greater than or equal to a preset threshold.
[0093] In an optional embodiment, the third value may be, but is not limited to, the difference between the average response time of requests from each metadata server within a preset period and the average request response time, and may be, but is not limited to, used to reflect that the response time of a single metadata server is significantly higher than the system average.
[0094] In an optional embodiment, the preset threshold value can be understood as a preset numerical limit for measuring or comparing a specific indicator (third numerical value) of the metadata server. When the specific indicator reaches or exceeds the preset threshold value, the metadata server is considered to be a server that meets a specific condition (such as a candidate migration server).
[0095] To further illustrate, optionally, for example, assume that there is a metadata server cluster, where the average request response time is 100 milliseconds. A preset threshold is set to 20 milliseconds. This means:
[0096] For each metadata server, this embodiment calculates the average response time of its requests within a preset period (such as the past hour), and compares it with the average request response time of the cluster (100 milliseconds) to obtain a third value (ie, the difference).
[0097] If the third value of a metadata server is greater than or equal to 20 milliseconds (for example, if its average response time is 125 milliseconds, the third value is 25 milliseconds), then this server is considered a candidate for migration. It should be noted that for each server, by calculating its average request response time within a preset period and comparing it with the average response time of the system as a whole, the difference is obtained as the third value, and metadata servers with response efficiency below the average level can be identified. At the same time, the larger the third value, the lower the processing efficiency of the server, and the more load adjustment is needed.
[0098] Furthermore, based on the calculated third value, N servers will be screened out from all metadata servers as candidate migration servers, and by setting a preset threshold and screening based on the third value, it is ensured that only servers whose third value is greater than or equal to the preset threshold, that is, servers with lower processing efficiency, will be marked as candidate migration servers, thereby avoiding unnecessary resource adjustments and improving the efficiency of load balancing.
[0099] Through the embodiment of the present application, the third value corresponding to each metadata server is obtained by using the request record, wherein the third value is the difference between the average response time of requests of each metadata server within a preset period and the average request response time; based on the third value, N candidate migration servers are determined from the metadata server cluster, wherein the third value corresponding to the candidate migration server is greater than or equal to the preset threshold. Thus, the technical purpose of determining the candidate migration server is achieved, and the technical effect of improving the load balancing efficiency is achieved.
[0100] As an optional solution, based on the hotspot attributes of each metadata server, N candidate migration servers are screened again to obtain metadata migration servers, including:
[0101] S5-1, according to the load hotspot formula, obtain the load hotspot value corresponding to each candidate migration server among N candidate migration servers;
[0102] The load hotspot formulas include:
[0103] ,
[0104] Among them, Load ij Meta_load is the load hotspot value of the i-th metadata server in the j-th period. ij is the number of metadata requests from the ith metadata server in the jth period, D i(j-1) Meta_load is the difference between the average request response time of the ith metadata server in the j-1th period and the average request response time of the metadata server cluster. i(j-1) is the number of metadata requests to the i-th metadata server in the j-1th period;
[0105] S5-2, using the load hotspot value, determine the metadata migration server from the metadata server cluster, wherein the load hotspot value corresponding to the metadata migration server is the largest in the metadata server cluster.
[0106] In an optional embodiment, the load hotspot recording formula may be, but is not limited to, used to calculate the load hotspot value corresponding to each candidate migration server, and the calculation formula of the load hotspot value includes:
[0107] ,
[0108] In an alternative embodiment, Load ij It may be, but is not limited to, the load hotspot value of the i-th metadata server in the j-th period.
[0109] In an alternative embodiment, Meta_load ijIt can be, but is not limited to, the number of metadata requests for the i-th metadata server in the j-th period.
[0110] In an alternative embodiment, D i(j-1) It can be, but is not limited to, the difference between the average request response time of the i-th metadata server in the j-1-th period and the average request response time of the metadata server cluster, and can be, but is not limited to, used to measure whether the server processing efficiency is lower than the system average level.
[0111] In an alternative embodiment, Meta_load i(j-1) It may be, but is not limited to, the number of metadata requests of the i-th metadata server in the j-1-th cycle, and may be, but is not limited to, be understood as the number of metadata requests of the candidate migration server in the previous cycle.
[0112] It should be noted that by analyzing the request records, the load hotspot value of each candidate migration server can be calculated. Then, the calculated load hotspot value is used to finally determine the server that needs metadata migration. Among the N candidate migration servers, those servers with the highest load hotspot values will be selected as metadata migration servers, which means that these servers have serious load and processing efficiency problems in the current and historical periods and need to migrate metadata. In other words, through the metadata migration server determination mechanism based on load hotspot values, it is ensured that the servers that need to migrate metadata can be accurately identified and processed, avoiding waste of resources and performance impact caused by unnecessary migration, helping to improve the overall processing capacity and response speed of the metadata server cluster, and improving the stability and efficiency of the server.
[0113] Through the embodiment of the present application, according to the load hotspot formula, the load hotspot value corresponding to each candidate migration server in N candidate migration servers is obtained; using the load hotspot value, the metadata migration server is determined from the metadata server cluster, wherein the load hotspot value corresponding to the metadata migration server is the largest in the metadata server cluster. Thus, the technical purpose of obtaining the load hotspot value according to the request record is achieved, and the technical effect of improving the efficiency of determining the migration server is achieved.
[0114] As an optional solution, before transferring all or part of the metadata in the metadata migration-out server to the metadata migration-in server, the method further includes:
[0115] S6-1, obtaining a target directory set of the metadata migration server, wherein the target directory set is a set of all top-level subdirectories managed by the metadata migration server;
[0116] S6-2, determining a directory to be migrated out from the target directory set, wherein metadata in the directory to be migrated out is set to be transferred to a metadata migration server.
[0117] In an optional embodiment, the target directory geometry may be, but is not limited to, a collection of all top-level subdirectories managed by the metadata migration server.
[0118] It should be noted that the system achieves load balancing by obtaining a collection of all top-level subdirectories managed on the metadata migration server, then determining the directories to be migrated from this collection, and transferring the metadata in these directories to the metadata migration server. By selectively migrating metadata of specific directories, the server can more accurately balance the load and avoid the waste of resources and performance impact caused by unnecessary migration.
[0119] Through the embodiment of the present application, a target directory set of a metadata migration server is obtained, wherein the target directory set is a set of all top-level subdirectories managed by the metadata migration server; from the target directory set, a directory to be migrated out is determined, wherein the metadata in the directory to be migrated out is set to be transferred to the metadata migration server. Thus, the technical effect of determining the directory to be migrated out is achieved, thereby achieving the technical effect of enabling the server to balance the load more accurately.
[0120] As an optional solution, the directory to be migrated out is determined from the target directory set, including:
[0121] Get the sum of the weighted voting values corresponding to each directory in the target directory set, where the weighted voting value is a value obtained by weighted calculation based on each metadata access record in the directory and the difference between the time when the metadata access occurred and the current time.
[0122] In an optional embodiment, the weighted voting value may be, but is not limited to, a value obtained by weighted calculation based on each metadata access record in the directory and the difference between the time when the metadata access occurred and the current time, and may be, but is not limited to, used to reflect the activity level of the directory and the demand for system resources of the directory.
[0123] It should be noted that the system evaluates each directory in the target directory set, calculates its weighted voting value, and finally sums up the weighted voting values of all directories to evaluate the overall directory activity and resource requirements. By calculating the weighted voting value, the system can evaluate the frequency of directory use and the immediate demand for resources, improve the pertinence and efficiency of metadata migration, ensure the rationality of load balancing, and effectively improve the response speed and stability of the entire system.
[0124] Through the embodiment of the present application, the sum of the weighted voting values corresponding to each directory in the target directory set is obtained, wherein the weighted voting value is a value obtained by weighted calculation based on each metadata access record in the directory and the difference between the time when the metadata access occurred and the current time. Thus, the technical purpose of obtaining the weighted voting value is achieved, and the technical effect of improving the stability and efficiency of metadata migration is achieved.
[0125] As an optional solution, based on the hotspot attributes of each metadata server, a metadata migration server is determined from the metadata server cluster, including:
[0126] The metadata migration server is determined from the metadata server cluster by using the load hotspot value, wherein the load hotspot value corresponding to the metadata migration server is the smallest in the metadata server cluster.
[0127] It should be noted that the system uses the load hotspot value as a quantitative indicator to select servers with lower loads in the cluster as migration servers. By selecting servers with smaller load hotspot values as migration servers, it ensures that the migration operation can not only effectively reduce the burden of the migration-out server, but also avoids transferring the load to the already highly loaded server, thereby avoiding the generation of new highly loaded servers and reducing the risk of server overload. In addition, through accurate load hotspot value calculation and migration server selection, the system can manage resources more effectively and improve the efficiency of load balancing.
[0128] Through the embodiment of the present application, the metadata migration server is determined from the metadata server cluster using the load hotspot value, wherein the load hotspot value corresponding to the metadata migration server is the smallest in the metadata server cluster. Thus, the technical effect of confirming the migration server through the load hotspot is achieved, thereby achieving the technical effect of improving the efficiency of load balancing.
[0129] As an optional solution, before distributing the static metadata to the metadata server cluster in sequence for management, the method further includes:
[0130] S7-1, split the directory structure of the file system into multiple directory subtrees;
[0131] S7-2, distribute the multiple directory subtrees to the metadata servers in sequence, so that the subdirectories and file metadata information in the same directory are maintained by the same metadata server, wherein the file metadata information includes static metadata.
[0132] In an optional embodiment, the directory structure of the file system can be understood as, but not limited to, a logical structure for organizing and managing files in the file system, and can be, but not limited to, be expressed as a directory tree containing multiple levels, and each directory can be, but not limited to, contain subdirectories and files.
[0133] In an optional embodiment, the directory subtree may be, but is not limited to, a part of the directory structure of the file system.
[0134] It should be noted that by splitting the directory structure of the file system to form multiple directory subtrees, each directory subtree contains part of the directory structure and all the subdirectories and files owned by these directory structures, the management pressure of the directory structure can be effectively dispersed to avoid overloading a single server due to managing too many directories.
[0135] Furthermore, after splitting the directory structure to obtain multiple directory subtrees, these directory subtrees are evenly distributed to different servers in the metadata server cluster. This distribution method ensures that the management load of metadata in the entire system is evenly distributed, avoiding excessive load on some servers. At the same time, it also ensures that all metadata (including static metadata) in the same directory is managed by the same metadata server, which helps to achieve load balancing and improve the overall processing capacity and response speed of the server cluster. At the same time, it ensures that metadata in the same directory is maintained by the same server, which simplifies the metadata query path and improves query efficiency. It is also conducive to maintaining data integrity and consistency and avoiding data conflicts.
[0136] Through the embodiment of the present application, the directory structure of the file system is split into multiple directory subtrees; the multiple directory subtrees are distributed to each metadata server in turn, so that the subdirectory and file metadata information in the same directory are maintained by the same metadata server, wherein the file metadata information includes static metadata. Thus, the technical purpose of ensuring that all metadata in the same directory is managed by the same metadata server is achieved, thereby achieving the technical effect of improving metadata query efficiency.
[0137] As an optional solution, multiple directory subtrees are distributed to each metadata server in sequence, including:
[0138] S8-1, perform hash calculation according to the file path name to obtain a hash value;
[0139] S8-2, using the hash value, performing a modulo operation on the number of metadata service instances to determine the metadata service instance number corresponding to the file path name;
[0140] S8-3, according to the metadata service instance number, randomly distribute the multiple directory subtrees to the metadata service instances configured inside each metadata server.
[0141] It should be noted that the file path name is taken as input, a hash value is calculated through a hash algorithm, and then the calculated hash value is used to perform a modulo operation, and the hash value is modulo the number of metadata service instances to determine the metadata service instance number corresponding to the file path name. Finally, according to the determined metadata service instance number, each directory subtree is assigned to a different service instance of the metadata server, ensuring the rapid location of data and the sequential distribution of loads, while simplifying the data query process and improving the response speed and processing power of the server.
[0142] Through the embodiment of the present application, a hash calculation is performed according to the file path name to obtain a hash value; the hash value is used to perform a modulo operation on the number of metadata service instances to determine the metadata service instance number corresponding to the file path name; and according to the metadata service instance number, multiple directory subtrees are randomly distributed to the metadata service instances configured inside each metadata server. Thus, the number of directory words is randomly distributed to the metadata service instances configured inside each metadata server according to the hash calculation, thereby achieving the technical effect of improving the response speed and processing capacity of the server.
[0143] As an optional solution, after distributing the multiple directory subtrees to the metadata servers, the method further includes:
[0144] Based on the directory names corresponding to different directory subtrees in the multiple directory subtrees and the mapping relationship between each metadata server, a metadata mapping table is created, wherein the metadata mapping table is used to locate and access required static metadata.
[0145] In an optional embodiment, the metadata mapping table may be, but is not limited to, a table that records the mapping relationship between different directory subtrees and metadata servers, and may be, but is not limited to, used to locate and access required static metadata.
[0146] It should be noted that by creating a metadata mapping table, the correspondence between the directory name of each directory subtree and the metadata server responsible for its metadata management is recorded. The metadata mapping table can help the system quickly locate the metadata server that stores static metadata according to the directory name, thereby speeding up the access speed of static metadata. In other words, the metadata mapping table, as a bridge between the directory subtree and the metadata server, greatly simplifies the search and access process of static metadata and improves data access efficiency. In addition, by maintaining the metadata mapping table, even when the server cluster and the number of directory subtrees change, the relevant metadata can be found through the mapping table, thereby improving the efficiency of obtaining metadata.
[0147] Through the embodiment of the present application, based on the directory names corresponding to different directory subtrees in multiple directory subtrees and the mapping relationship between each metadata server, a metadata mapping table is created, wherein the metadata mapping table is used to locate and access the required static metadata. Thus, the technical purpose of creating a metadata mapping table is achieved, and the technical effect of improving the efficiency of obtaining metadata is achieved.
[0148] As an optional solution, before distributing the static metadata to the metadata server cluster in sequence for management, the method further includes:
[0149] Each metadata server is connected to a first bus memory device, wherein the first bus memory device is used to provide a shared memory space for each metadata server.
[0150] In an optional embodiment, the first bus memory device may be used, but is not limited to, to provide a shared memory space for each metadata server.
[0151] It should be noted that by connecting all servers in the metadata server cluster to a shared first bus memory device, all metadata servers provide a shared memory space, which can significantly improve the access speed and processing efficiency of metadata. The first bus memory device, as a shared memory space, also allows all metadata servers to quickly read and write metadata, avoiding performance degradation caused by data transmission bottlenecks, and can also balance the load between servers and improve the response speed of the servers.
[0152] Through the embodiment of the present application, each metadata server is connected to the first bus memory device, wherein the first bus memory device is used to provide a shared memory space for each metadata server, thereby achieving the technical purpose of avoiding the performance degradation caused by the data transmission bottleneck, and further achieving the technical effect of improving the response speed of the server.
[0153] As an optional solution, after connecting each metadata server to the first bus memory device, the method further includes at least one of the following:
[0154] S9-1, storing a global metadata mapping table through a first value memory slice in a first bus memory device, wherein the global metadata mapping table records a correspondence between static metadata and each metadata server;
[0155] S9-2, allocating the second value memory slice corresponding to each metadata server through the first bus memory device as the metadata cache space of the corresponding metadata server, wherein the data in the second value memory slice is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying the data;
[0156] S9-3, allocating a corresponding third value memory slice to each metadata server through the first bus memory device, wherein the third value memory slice is used to store metadata request information of the corresponding metadata server, and the metadata request information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it;
[0157] S9-4, allocating a fourth value memory slice corresponding to each metadata server through the first bus memory device, wherein the fourth value memory slice is used to store metadata reply information of the corresponding metadata server, and the metadata reply information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it;
[0158] S9-5, through the first bus memory device, allocate the corresponding fifth value memory slice to each metadata server as the first bus memory metadata request history record circular buffer and load statistics area of the corresponding metadata server, wherein the data in the fifth value memory slice is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it.
[0159] In an optional embodiment, the global metadata mapping table may be, but is not limited to, stored in the first value memory slice of the first bus memory device, and the global mapping table may be, but is not limited to, recording the association between the static metadata and each metadata server. In addition, through the shared storage of the global metadata mapping table, the system is provided with the ability to quickly locate static metadata, avoiding the inconsistency problem caused by each metadata server needing to maintain the mapping relationship separately, and enhancing the stability of the system.
[0160] In an optional embodiment, a second value memory slice is allocated to each metadata server as a metadata cache space, wherein the cache space is dedicated to each metadata server, and only the metadata server corresponding to the cache space is allowed to perform read and write operations, that is, private access to data, which prevents unnecessary data conflicts and security risks and ensures data security and consistency. In addition, by setting up the metadata cache space, the number of times the metadata server obtains data from slow storage devices is reduced, significantly improving the access speed of metadata.
[0161] In an optional embodiment, a third value memory slice is allocated to each metadata server to store metadata request information received by the server, and the metadata request information is set to allow the corresponding metadata server to perform read and write access while prohibiting other metadata servers from modifying the information, thereby preventing unnecessary data conflicts and security risks and ensuring data security and consistency.
[0162] In an optional embodiment, a fourth value memory slice is allocated to each metadata server for storing metadata reply information, and the metadata reply information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying, that is, private access to data, which prevents unnecessary data conflicts and security risks and ensures data security and consistency. In addition, by storing metadata reply information, it can help the metadata server track and manage metadata responses.
[0163] In an optional embodiment, a fifth value memory slice is allocated to each metadata server, which is used as a circular buffer and load statistics area for metadata request history records. The read and write permissions of the data are limited to the metadata server, that is, private access to the data, which prevents unnecessary data conflicts and security risks and ensures data security and consistency. In addition, the establishment of the circular buffer and load statistics area also helps the metadata server to obtain its request load and response status in real time, providing data support for the implementation of dynamic load balancing and request optimization strategies.
[0164] Through the embodiment of the present application, different memory slices of the first bus memory device are used to store the global metadata mapping table, metadata cache, metadata request and reply information, and metadata server load statistics information, and the access rights of these information are clarified. Thus, the technical purpose of using different memory slices to store different information and setting data private access is achieved, thereby achieving the technical effect of preventing unnecessary data conflicts and security risks.
[0165] As an optional solution, before distributing the static metadata to the metadata server cluster in sequence for management, the method further includes:
[0166] A smart network card is configured for each metadata server, wherein the smart network card is used to capture metadata requests and metadata replies of each metadata server, and the metadata requests and metadata replies captured by the smart network card are set to be stored in the shared memory of the first bus.
[0167] In an optional embodiment, the smart network card may be used, but not limited to, to capture metadata requests and metadata replies from various metadata servers, and may also be used, but not limited to, to provide accelerated processing of network interfaces and metadata requests.
[0168] It should be noted that the intelligent network card reduces the maintenance burden of the central processing unit (CPU) of the metadata server, improves the data processing speed, optimizes the response time of metadata requests through shared memory, reduces the network transmission delay between servers, and thus improves the performance, response speed and efficiency of the metadata server as a whole.
[0169] Through the embodiment of the present application, a smart network card is configured for each metadata server, wherein the smart network card is used to capture metadata requests and metadata replies of each metadata server, and the metadata requests and metadata replies captured by the smart network card are set to be stored in the shared memory of the first bus. The technical purpose of obtaining and storing metadata by combining the smart network card with the shared memory is achieved, thereby achieving the technical effect of improving the performance of the metadata server.
[0170] In an optional embodiment, the above-mentioned distributed storage metadata management method is applied to metadata servers in other metadata server clusters, and the static metadata in other metadata server clusters is distributed to the servers in other metadata server clusters in turn for management. The servers in other metadata server clusters are interconnected with the second bus memory device through the second bus, and the second bus memory device is used to share other metadata processing records of the static metadata by the servers in other metadata server clusters. The method includes:
[0171] reading other metadata processing records from the second bus memory device;
[0172] According to other metadata processing records, obtain the hotspot attributes of each server in other metadata server clusters;
[0173] Based on the hotspot attributes of each server in the other metadata server cluster, determining other metadata migration servers from the other metadata server cluster;
[0174] Based on the hotspot attributes of each server in the other metadata server cluster, determining other metadata migration servers from the other metadata server cluster;
[0175] Transfer all or part of the metadata in the other metadata migration-out server to the other metadata migration-in server.
[0176] It should be noted that different clusters can be understood as different objects to be managed. In order to improve the management efficiency of the cluster and not be affected by other objects to be managed, the same management object is managed by a bus and a bus memory device. Therefore, different clusters are managed using different buses and different bus memory management devices.
[0177] To further illustrate, assuming there are cluster A and cluster B, cluster A is managed by a first bus and a first bus memory management device, while cluster B is managed by a second bus and a second bus memory management device that are different from the first bus and the first bus memory management device.
[0178] Through the embodiment of the present application, other metadata processing records are read from the second bus memory device; the hotspot attributes of each server of other metadata server clusters are obtained according to other metadata processing records; other metadata migration-out servers are determined from other metadata server clusters based on the hotspot attributes of each server of other metadata server clusters; other metadata migration-in servers are determined from other metadata server clusters based on the hotspot attributes of each server of other metadata server clusters; all or part of the metadata in other metadata migration-out servers are transferred to other metadata migration-in servers. Thus, the technical purpose of using different buses and bus memory management devices to manage different metadata server clusters is achieved, and the technical effect of improving the management efficiency of metadata server clusters is achieved.
[0179] As an optional solution, for ease of understanding, the metadata management of distributed storage is applied in the metadata service cluster system architecture.
[0180] In an optional embodiment, Compute Express Link (CXL) is a new interconnect technology standard for processors, memory expansion and accelerators, and it maintains consistency between CPU memory space and connected device memory. The CXL 3.0 standard supports shared memory across system devices, breaking the limitation that a certain physical memory can only belong to a certain server, and realizing the ability of multiple machines to access memory together in hardware.
[0181] In an optional embodiment, according to the CXL3.0 specification, a CXL memory device can provide multiple CXL ports. Through the CXL Fabric switch, each CXL memory device can be connected to one or more hosts. The CXL memory device acts as a logical memory device of the host and exposes the memory space of the entire CXL memory device. Multiple hosts can access the CXL memory device at the same time. Figure 3 As shown in FIG3 , there are host 1, host 2, host 3, host n, as well as management unit, CXL Fabric network configuration, CXL memory device 1, CXL memory device 2, head node 0, head node 1, head node n-1, logical device 1, logical device 2, logical device 3, and memory space in the memory device, and the connection status is shown in FIG3 . If the CXL Fabric network configuration connects the head node 0 of CXL memory device 1 to host 1, and connects the head node 1 of CXL memory device 1 to host 2, then host 1 can access the memory space of CXL memory device 1 through head node 0 and logical device 1, and host 2 can access the memory space of CXL memory device 1 through head node 1 and logical device 2. The FM management unit is responsible for the configuration and device management of the entire CXL network.
[0182] In an optional embodiment, if Figure 4 As shown in FIG. 4 , the CXL memory device designed in this embodiment is a CXL Type 3 device, which is composed of a CXL physical layer (PHY) link interface, a CXL protocol engine, a memory controller, a communication interface, and a double data rate synchronous dynamic random access memory (DDR). The communication interface of the CXL memory device in this embodiment adopts an I2C bus, or other communication buses, and the CXL memory device supports n CXL ports and m memory bars. In the embodiment shown in FIG. 4 , n=3, m=3.
[0183] In an optional embodiment, the memory controller manages the access rights of the global memory according to the memory slice. The size of the memory slice can be any value. In the example of this embodiment, the memory slice is set to 1G. After the CXL memory device is powered on, the access rights of each memory slice are set by reading and writing the MMIO space of the CXL memory device. The MMIO space of the CXL memory device supports hardware atomic operations, including test and set, compare and exchange operations. Each CXL memory slice supports one host write and multiple host reads. The host must obtain write access permission before writing, while the read host does not need to obtain permission permission. In addition, the CXL memory device receives configuration information sent by the management unit through the I2C communication bus.
[0184] In an optional embodiment, the metadata server architecture is as follows Figure 5 As shown in the figure, it mainly includes the central processing unit (CPU), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, referred to as DDR), hard disk, data processing unit (Data Processing Unit, referred to as DPU) and computing high-speed link (CXL) switch. The hard disk mainly stores metadata and can be a hard disk drive (Hard disk drive, referred to as HDD) or a solid-state drive. The DPU is an intelligent network card that mainly provides a network interface and accelerated processing of data requests. The CXL switch is mainly used to connect the server to the CXL bus of the cluster, where the CPU is connected to the DDR, and the CPU, hard disk, DPU, and CXL switch can be connected to each other.
[0185] In an optional embodiment, compared with an ordinary network card, the DPU (intelligent network card) adds a metadata management unloading unit (MMO Engine) to the DMA controller. The unit monitors the sending and receiving data of a specific port of the network card, and writes the metadata request and metadata reply data packets into the specified memory space respectively. The metadata entry information includes the request time and the specific information of the metadata, etc. The DPU has a setting register for the metadata request packet storage area address, the metadata request packet storage area space size, the single maximum metadata request packet size, the metadata reply packet storage area address, the metadata reply packet storage area space size, and the single maximum metadata reply packet size. In addition, the DPU also provides readable information on the current metadata request packet storage address and the current metadata reply packet storage address. The DPU treats the metadata request packet memory space and the metadata reply packet memory space as a circular buffer. The space occupied by each metadata request packet is equal to the size of the single maximum metadata request packet plus the size of the timestamp, and the space occupied by each metadata reply packet is equal to the size of the single maximum metadata reply packet plus the size of the timestamp. The DPU automatically writes the monitored metadata request packet and timestamp into the metadata request packet circular buffer, and writes the monitored metadata reply packet and timestamp into the metadata reply packet circular buffer.
[0186] To further illustrate, the optional Figure 6 As shown, there are bus interfaces, transmission direct memory access channels, and receiving direct memory access channels. There are also metadata management units in the transmission direct memory access channels and the receiving direct memory access channels. There are also control and status registers, multimedia transmission layer send FIFO controllers, multimedia receiving layer send FIFO controllers, multimedia transmission layer control and status registers, send media access control layers, receive media access control layers, control and status register access control layers, and physical layers. In addition, there are memory resources based on the CXL protocol, send memory resources, and receive memory resources, and the data transmission relationship is shown in Figure 6. In an optional embodiment, the memory space for storing metadata request and reply information in the embodiment of the present application is the CXL shared memory of the cluster, wherein the metadata request data packet and the metadata reply data packet are respectively stored in different CXL shared memory spaces, and the metadata servers in the cluster of this CXL memory shared space can all access it. Each metadata server is configured with a DPU, and the system allocates two CXL memory spaces to each metadata server for storing metadata request and metadata reply data packets. These two CXL memory spaces only allow the metadata servers to which they belong to perform write access, and other metadata servers can read access but not write access.
[0187] In an optional embodiment, the optional Figure 7As shown, the distributed storage system designed in the embodiment of the present application includes a client cluster, a data server cluster and a metadata server cluster, wherein the client cluster has n clients, namely, client 1, client 2, client 3... client n; the data server cluster has n data servers, namely, data server 1, data server 2, data server 3... data server n; the metadata server cluster has a CXL bus, a system network, a management network CXL memory device 1, a CXL switch, a management node, and n metadata servers, namely, metadata server 1, metadata server 2, metadata server 3... metadata server n. The client cluster, the data server cluster and the metadata server cluster exchange information through the network. The metadata server cluster is responsible for managing the metadata of the entire distributed storage system, such as the directory structure of the file system, the basic attributes of the file, the operation permissions of the file, and the index and layout information of the file data; the data server cluster is responsible for storing the data content of the distributed storage system; the user initiates metadata and data requests through the client.
[0188] In an optional embodiment, in a distributed storage architecture in which metadata and data operations are decoupled, the process for a client to access a file in a distributed storage system is as follows: first, the client interacts with the metadata server cluster to perform corresponding metadata operations to obtain the metadata information of the file, and then interacts with the data server cluster to perform data I / O transmission through the data index information recorded in the metadata, thereby obtaining the file data.
[0189] In an optional embodiment, the metadata server clusters of the embodiment of the present application use CXL interconnect bus technology; each metadata server is connected to the CXL bus (CXL Switch) of the cluster using a CDFP cable; each CXL memory device is also connected to the CXL bus (CXL Switch) using a CDFP cable; and the metadata servers share CXL memory devices, which can reduce data copying and improve system performance.
[0190] In an optional embodiment, the specific steps of initializing the configuration are as follows:
[0191] Step 1: The FM management unit obtains the status of devices on the cluster CXL bus through the management network. CXL devices include hosts, CXL memory devices, and CXL switches.
[0192] Step 2: The FM management unit configures the CXL Switch to ensure that all metadata servers and CXL memory devices are linked, and that all metadata servers can read and access the memory space of the CXL memory device on the bus, thereby achieving memory sharing among metadata servers; when a metadata server wants to write to the CXL memory space, it needs to obtain the write access permission of the memory slice through an atomic operation;
[0193] Step 3: Select the memory slice space of the first value slice in the CXL memory device to store the global metadata mapping table, which records the mapping relationship between the directory subtree and the metadata server node. The global metadata mapping table can be read and written by all metadata servers;
[0194] Step 4: Allocate the memory slice space of the second value slice in the CXL memory device for each metadata server as the metadata cache space of the metadata server. The metadata server can read and write to the cache space, while other metadata servers can only read from it;
[0195] Step 5: Allocate a memory slice space of the third value slice in the CXL memory device for each metadata server to store the metadata request information monitored by the metadata server DPU. The metadata server can read and write to this space, while other metadata servers can only read from it;
[0196] Step 6: Allocate a memory slice space of the fourth value slice in the CXL memory device for each metadata server to store the metadata reply information monitored by the metadata server DPU. The metadata server can read and write to this space, while other metadata servers can only read;
[0197] Step 7: Allocate the memory slice space of the fifth value slice in the CXL memory device for each metadata server as the CXL memory metadata request history circular buffer and load statistics area of the metadata server. The metadata server can read and write to the space, while other metadata servers can only read.
[0198] In an optional embodiment, the metadata distribution scheme is a scheme for studying how to distribute the metadata of a file or directory to a metadata cluster. The metadata distribution scheme has an important impact on many aspects of the metadata cluster, such as the data access process, storage space utilization efficiency, data consistency, load balancing, and system scalability. In view of the shortcomings of subtree partitioning and hash algorithms, this embodiment adopts a hybrid metadata distribution scheme of subtree partitioning and hash mapping. This scheme splits the directory structure of the entire file system into multiple directory subtrees and distributes them to multiple metadata server nodes, so that the subdirectory and file metadata information in the same directory is maintained by the same metadata server node. Metadata operations for the directory can be processed and completed within a single metadata server node, thereby retaining a directory structure with good metadata distribution.
[0199] In an optional embodiment, within the metadata server node, a hash calculation is performed based on the file path name and then modulo the number of MDSs, and the directory subtree is randomly distributed to multiple metadata service process (MDS) instances to maintain load balancing between multiple MDS metadata service process instances within a single metadata server node.
[0200] In an optional embodiment, MDSID = Hash(Pathname)%(MDS Count), where: MDSID is the number of the MDS service instance on the server, and MDS Count is the number of MDS server instances on the server.
[0201] In an optional embodiment, the distribution method of metadata determines its indexing method. In order to shorten the metadata storage process and improve the storage performance of metadata, the client also maintains a set of cache space in its memory to cache the metadata of recently accessed files. When the client receives a metadata request initiated by the application software, it first searches its own metadata cache for the metadata information of the target file. If it exists, it continues with the next metadata operation; otherwise, the client needs to request the metadata content of the target file from any metadata server node. The client maintains a metadata mapping table in its own cache space, which records the mapping relationship between the directory subtree and the metadata server node. The metadata mapping table structure is shown in the following table:
[0202] Serial number Directory Name Target metadata server node 1 / data 0 2 / home 1 3 / lib 2 4 / usr 3 5 / data / dfs 1 6 / home / cat 0
[0203] In an optional embodiment, after the metadata server node receives the metadata request sent by the client, the metadata server node first searches whether the directory subtree corresponding to the target file is managed by itself; if the directory subtree to which the target file belongs is managed by its own node, the metadata server node redirects and forwards the metadata request to the corresponding target MDS for processing according to the mapping relationship between the metadata in the node and the MDS metadata service process instance; if it is not found, it indicates that the directory subtree deployed by the target file is distributed in other metadata server nodes, then the global metadata mapping table is searched to find the metadata server node that manages the target file, and the metadata request is forwarded to the metadata server node. Since the global metadata mapping table is placed in the CXL memory device, all metadata servers can read and write access, and its format is consistent with the metadata mapping table of the client. When the MDS metadata service process instance receives the metadata request forwarded by the metadata server node, it first searches for the metadata of the target file in its own metadata cache space. If the metadata of the target file is not loaded into the cache space, the metadata loading operation is performed to load the metadata of the target file from the lower metadata storage device into the cache space; when the metadata of the target file has been loaded in the metadata cache, the MDS metadata service process instance performs the corresponding metadata operation and sends the metadata information of the target file to the client.
[0204] In an optional embodiment, due to the randomness of client service requests and the locality of file access, it is easy for some files and metadata server nodes to become local hot spots for a period of time. When the load difference of each metadata server node in the metadata server cluster is large, it is necessary to migrate the metadata load from the metadata server node with lower load to the metadata server node with lower load to maintain the load balance of the metadata server cluster and provide higher system performance.
[0205] In an optional embodiment, since this embodiment example adopts a metadata distribution method of subtree partitioning and hash mapping layering, and hash mapping has good load balancing characteristics, this embodiment example mainly performs load balancing between different metadata servers. The specific steps are as follows:
[0206] Step 1: Each metadata server load statistics unit matches the metadata request data packet in the metadata request packet circular buffer and the metadata reply packet in the metadata reply packet circular buffer. The matching method can match the target file and the protocol serial number to calculate the response time of each metadata request. At the same time, the target file, request time and response time of the metadata request are saved in the CXL memory metadata request history record circular buffer, and then the metadata request packet and metadata reply packet corresponding to the metadata request are deleted from the metadata request packet circular buffer and the metadata reply packet circular buffer.
[0207] Step 2: The load statistics unit of the metadata server reads the records of the metadata request history record circular buffer in the CXL memory, calculates the number of metadata requests and the average request response time of the metadata requests in the metadata server node in this cycle, and saves the number of metadata requests and the average request response time of the metadata requests in this cycle in the load statistics area.
[0208] Step 3: The metadata server load statistics unit reads the load statistics area of all metadata servers and calculates the average request response time of the metadata server cluster in this cycle. , the calculation method is as follows:
[0209] ,
[0210] Where: N is the number of metadata servers, is the number of metadata requests from the i-th metadata server in the current period, is the average response time of the i-th metadata server in the current period.
[0211] Step 4: Determine the hotspot metadata server and find out the migration-in server and the migration-out server.
[0212] Step 4.1: Calculate the difference between the average request response time of each metadata server in this cycle and the average request response time of the metadata server cluster in this cycle, and record the difference between the average request response time of the i-th metadata server in the j-th cycle and the average request response time of the metadata server cluster as D ij。
[0213] Step 4.2: The difference D between the average request response time of all metadata servers in this period and the average request response time of the cluster ij Compare with the first threshold; if there is no metadata server D ij If the D of one or more metadata servers is greater than the first threshold, no load balancing is required in this cycle and the system returns directly. ij If it is greater than or equal to the first threshold, proceed to step 4.3.
[0214] Step 4.3: Determine the hotspot metadata server and determine the target metadata server to migrate out. ij is greater than or equal to the first threshold, then the metadata server is a hotspot metadata server;
[0215] If there are multiple metadata servers, ij If the value is greater than or equal to the first threshold, the metadata server load hotspot value is calculated according to the following formula. The load hotspot value calculation method is as follows:
[0216] ,
[0217] Where: Load ij Meta_load is the load hotspot value of the i-th metadata server in the j-th period. ij is the number of metadata requests from the ith metadata server in the jth period, D i(j-1) Meta_load is the difference between the average request response time of the ith metadata server in the j-1th period and the average request response time of the metadata server cluster. i(j-1) is the number of metadata requests from the i-th metadata server in the j-1th period.
[0218] Compare the load hotspot values of each metadata server node in the current cycle (i.e., cycle j) ij ,The metadata server with the largest hotspot value is selected as the hotspot metadata server for this period.
[0219] The selected hotspot metadata server is used as the migration server.
[0220] Step 4.4: Determine the directory subtree to be migrated on the migration server. Establish a first directory set, where the members are the top-level subdirectories managed by the target migration server. Read the metadata access history within the specified time T from the CXL memory metadata request history loop buffer, and calculate the sum of the weighted voting values of the directories in the first directory set. All metadata accesses under the directory are counted as accesses to the directory. The weighted voting value calculation method for each access is as follows:
[0221] ,
[0222] in: is the weighted voting value of the j-th metadata access record, is the time when the jth metadata access occurs, is the current time.
[0223] The weighted voting values of each directory in the first directory set are accumulated, and the weighted voting values of each directory are compared, and the directory with the smallest absolute value of the difference between the weighted voting value and the second threshold is selected as the directory subtree to be migrated out.
[0224] Step 4.5 Determine the metadata server to be migrated, and calculate the load hotspot values of all metadata servers according to step 4.3 , the load hotspot value The smallest metadata server serves as the migration metadata server.
[0225] Step 5: Migrate the hotspot target directory subtree from the source metadata server node to the target metadata server node. The specific steps are as follows: first, record the time when the target directory subtree starts to migrate; then transmit the record of the directory subtree to the target metadata server node through the network or other communication methods; after the directory subtree is transmitted, the source metadata server informs the target metadata server of the time when the directory subtree starts to migrate; then, the target metadata server reads the cache record from the beginning of the migration of the directory subtree to the current source metadata server from the CXL memory to modify the local metadata, and then updates the global metadata index table in the CXL memory, and switches the index of the target directory subtree to the target metadata server.
[0226] Through the embodiments of the present application, a new metadata server cluster system architecture is designed based on the CXL bus technology, and the metadata cache and the global metadata index table are stored as a whole in the CXL shared memory, and each metadata server can access the CXL shared memory; in addition, this embodiment proposes a distributed storage metadata management method based on the system architecture. The method first statically divides the metadata into multiple subtree partitions and manages them separately by the metadata servers in the cluster. The metadata entries are hash-mapped to multiple MDS instances inside the metadata server. The system monitors the workload of each metadata server and the popularity of file metadata in real time, splits the directory subtrees managed by the metadata server with a high workload, and migrates them to the metadata server with a low workload, so as to implement a fine-grained dynamic load balancing strategy and achieve the effect of improving the concurrent access performance of cluster metadata.
[0227] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this 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, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0228] In this embodiment, a metadata management device for distributed storage is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0229] Figure 8 1 is a block diagram of a metadata management device for distributed storage according to an embodiment of the present application, which is applied to a metadata server in a metadata server cluster. Static metadata in the metadata server cluster is distributed to each server in the metadata server cluster for management. Each server is connected to a first bus memory device through a first bus. The first bus memory device is used to share metadata processing records of each server for static metadata, such as Figure 8 As shown, the device comprises:
[0230] A first reading unit 802 is used to read a metadata processing record from a first bus memory device;
[0231] A first acquisition unit 804 is used to acquire a hotspot attribute of the metadata server according to the metadata processing record, wherein the hotspot attribute is used to measure the load of the metadata server;
[0232] A first determining unit 806 is used to determine a metadata migration server from the metadata server cluster, wherein the hotspot attribute of the metadata migration server meets the attribute condition of the hotspot metadata server;
[0233] The second determining unit 808 is used to determine a metadata migration server from the metadata server cluster, wherein the hot attribute of the metadata migration server meets the attribute condition of the cold metadata server;
[0234] The first transfer unit 810 is used to transfer all or part of the metadata in the metadata migration-out server to the metadata migration-in server.
[0235] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0236] As an optional solution, the first determination unit 806 includes: a first screening module, which is used to screen each metadata server based on the hot spot attributes of each metadata server to obtain N candidate migration servers, where N is a positive integer; a first determination module, which is used to determine the N candidate migration servers as metadata migration servers when N is 1; and a second screening module, which is used to perform a second screening on the N candidate migration servers based on the hot spot attributes of each metadata server to obtain the metadata migration server when N is greater than 1.
[0237] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0238] As an optional solution, the first screening module includes: a first acquisition submodule, used to obtain the request records of each metadata server for each metadata; a second acquisition submodule, used to use the request records to obtain the number of metadata requests of each metadata server within a preset period, and use the request records to obtain the average request response time of metadata requests of the metadata server cluster within the preset period, wherein the hotspot attributes include the number of metadata requests and the average request response time.
[0239] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0240] As an optional solution, the second acquisition submodule includes: a first acquisition subunit, used to use the request record to obtain a first value, wherein the first value is the sum of the average response time of requests from each metadata server within a preset period and the number of metadata requests; a second acquisition subunit, used to use the request record to obtain a second value, wherein the second value is the sum of the number of metadata requests from each metadata server within the preset period; a third acquisition subunit, used to obtain an average request response time based on the first value and the second value, wherein the average request response time is the quotient of the first value and the second value.
[0241] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0242] As an optional solution, the first screening module includes: a third acquisition submodule, used to use the request record to obtain a third value corresponding to each metadata server, wherein the third value is the difference between the average response time of requests from each metadata server within a preset period and the average request response time; a first determination submodule, used to determine N candidate migration servers from the metadata server cluster based on the third value, wherein the third value corresponding to the candidate migration server is greater than or equal to a preset threshold.
[0243] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0244] As an optional solution, the second screening module includes: a fourth acquisition submodule, which is used to obtain the load hotspot value corresponding to each candidate migration server in the N candidate migration servers according to the load hotspot formula; the load hotspot formula includes:
[0245] ,
[0246] Among them, Load ijMeta_load is the load hotspot value of the i-th metadata server in the j-th period. ij is the number of metadata requests from the ith metadata server in the jth period, D i(j-1) Meta_load is the difference between the average request response time of the ith metadata server in the j-1th period and the average request response time of the metadata server cluster. i(j-1) is the number of metadata requests of the i-th metadata server in the j-1-th period; the second determination submodule is used to use the load hotspot value to determine the metadata migration server from the metadata server cluster, wherein the load hotspot value corresponding to the metadata migration server is the largest in the metadata server cluster.
[0247] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0248] As an optional solution, the first transfer unit 810 includes: an acquisition module, used to obtain a target directory set of the metadata migration server, wherein the target directory set is a set of all top-level subdirectories managed by the metadata migration server; a second determination module, used to determine the directory to be migrated from the target directory set, wherein the metadata in the directory to be migrated is set to be transferred to the metadata migration server.
[0249] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0250] As an optional solution, the second determination module includes: a fifth acquisition sub-module, used to obtain the sum of weighted voting values corresponding to each directory in the target directory set, wherein the weighted voting value is a numerical value obtained by weighted calculation based on each metadata access record in the directory and the difference between the time when the metadata access occurred and the current time.
[0251] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0252] As an optional solution, the second determination unit 808 includes: a third determination module, which is used to use the load hotspot value to determine the metadata migration server from the metadata server cluster, wherein the load hotspot value corresponding to the metadata migration server is the smallest in the metadata server cluster.
[0253] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0254] As an optional solution, the first reading unit 802 includes: a splitting module, used to split the directory structure of the file system into multiple directory subtrees; a distribution module, used to distribute the multiple directory subtrees in sequence to each metadata server, so that the subdirectory and file metadata information in the same directory are maintained by the same metadata server, wherein the file metadata information includes static metadata.
[0255] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0256] As an optional solution, the distribution module includes: a calculation submodule, which is used to perform hash calculation according to the file path name to obtain a hash value; a modulus operation module, which is used to use the hash value to perform a modulus operation on the number of metadata service instances to determine the metadata service instance number corresponding to the file path name; and a distribution submodule, which is used to randomly distribute multiple directory subtrees to the metadata service instances configured inside each metadata server according to the metadata service instance number.
[0257] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0258] As an optional solution, the distribution module includes: creating a sub-module for creating a metadata mapping table based on the mapping relationship between the directory names corresponding to different directory subtrees in multiple directory subtrees and each metadata server, wherein the metadata mapping table is used to locate and access the required static metadata.
[0259] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0260] As an optional solution, the first reading unit 802 includes: a connection module, used to connect each metadata server to a first bus memory device, wherein the first bus memory device is used to provide a shared memory space for each metadata server.
[0261] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0262] As an optional solution, the connection module includes: a storage submodule, which is used to store a global metadata mapping table through a first value memory slice in a first bus memory device, wherein the global metadata mapping table records the correspondence between static metadata and each metadata server; a first allocation submodule, which is used to allocate a corresponding second value memory slice to each metadata server through the first bus memory device as the metadata cache space of the corresponding metadata server, wherein the data in the second value memory slice is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it; a second allocation submodule, which is used to allocate a corresponding third value memory slice to each metadata server through the first bus memory device, wherein the third value memory slice is used to store the metadata request information of the corresponding metadata server, and the metadata request information The information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it; a third allocation submodule is used to allocate the corresponding fourth value memory slices to each metadata server through the first bus memory device, wherein the fourth value memory slice is used to store the metadata reply information of the corresponding metadata server, and the metadata reply information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it; a fourth allocation submodule is used to allocate the corresponding fifth value memory slices to each metadata server through the first bus memory device, as the first bus memory metadata request history record circular buffer and load statistics area of the corresponding metadata server, wherein the data in the fifth value memory slice is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it.
[0263] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0264] As an optional solution, the first reading unit 802 includes: a configuration module, used to configure a smart network card for each metadata server, wherein the smart network card is used to capture metadata requests and metadata replies from each metadata server, and the metadata requests and metadata replies captured by the smart network card are set to be stored in the shared memory of the first bus.
[0265] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0266] As an optional solution, the above-mentioned device also includes: a second reading unit, which is used to read other metadata processing records from the second bus memory device; a second acquisition unit, which is used to acquire the hotspot attributes of each server of other metadata server clusters according to other metadata processing records; a third determination unit, which is used to determine other metadata migration-out servers from other metadata server clusters based on the hotspot attributes of each server of other metadata server clusters; a fourth determination unit, which is used to determine other metadata migration-in servers from other metadata server clusters based on the hotspot attributes of each server of other metadata server clusters; and a second transfer unit, which is used to transfer all or part of the metadata in other metadata migration-out servers to other metadata migration-in servers.
[0267] For specific embodiments, reference may be made to the examples shown in the above-mentioned distributed storage metadata management method, which will not be described in detail in this example.
[0268] It should be noted that the above-mentioned virtual devices (modules, units, sub-modules, sub-units, components, etc.) can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned virtual devices are all located in the same processor; or, the above-mentioned virtual devices are located in different processors in any combination.
[0269] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0270] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0271] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0272] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0273] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0274] Obviously, those skilled in the art should understand that the above-mentioned virtual devices or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0275] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A distributed storage metadata management method, characterized in that: The method is applied to a metadata server in a metadata server cluster, wherein static metadata in the metadata server cluster is distributed to each metadata server in the metadata server cluster in sequence for management, each metadata server is connected to a first bus memory device via a first bus, and the first bus memory device is used to share metadata processing records of the static metadata by each metadata server, and comprises: reading the metadata processing record from the first bus memory device; According to the metadata processing record, a hotspot attribute of the metadata server is obtained, wherein the hotspot attribute is used to measure the load of the metadata server; the hotspot attribute includes the number of metadata requests of each metadata server within a preset period and the average request response time of metadata requests of the server cluster within the preset period; Obtain a third value corresponding to each metadata server, wherein the third value is the difference between the average response time of requests of each metadata server within the preset period and the average request response time; determine the servers in the server cluster whose third values are greater than or equal to the preset threshold as N candidate migration servers; wherein N is a positive integer; when N is greater than 1, obtain the load hotspot value corresponding to each candidate migration server in the N candidate migration servers, and determine the candidate migration server corresponding to the largest load hotspot value in the metadata server cluster as the metadata migration server, wherein the hotspot attribute of the metadata migration server meets the attribute condition of the hot frequency metadata server; Determine a metadata migration server from the metadata server cluster, wherein the hot attribute of the metadata migration server meets the attribute condition of the cold metadata server; All or part of the metadata in the metadata-migrating server is transferred to the metadata-migrating server.
2. The method according to claim 1, characterized in that The method further comprises: When N is 1, the N candidate migration-out servers are determined as the metadata migration-out servers.
3. The method according to claim 2, characterized in that Before obtaining the third values corresponding to the metadata servers, the method further includes: Obtaining request records of each metadata server for each metadata; The request records are used to obtain the number of metadata requests of each metadata server within a preset period, and the request records are used to obtain the average request response time of metadata requests of the metadata server cluster within the preset period.
4. The method according to claim 3, characterized in that: The obtaining an average request response time of metadata requests of the metadata server cluster within the preset period includes: Using the request record, obtaining a first value, wherein the first value is the sum of an average response time of requests from each metadata server within the preset period and the number of metadata requests; Using the request record, obtaining a second value, wherein the second value is the sum of the numbers of metadata requests from each metadata server within the preset period; The average request response time is obtained based on the first value and the second value, wherein the average request response time is a quotient of the first value and the second value.
5. The method according to claim 1, characterized in that The obtaining of the load hotspot value corresponding to each candidate migration-out server among the N candidate migration-out servers includes: According to the load hotspot formula, obtain the load hotspot value corresponding to each candidate migration-out server in the N candidate migration-out servers; The load hotspot formula includes: , Among them, Load ij Meta_load is the load hotspot value of the i-th metadata server in the j-th period. ij is the number of metadata requests from the ith metadata server in the jth period, D i(j-1) Meta_load is the difference between the average request response time of the ith metadata server in the j-1th period and the average request response time of the metadata server cluster. i(j-1) is the number of metadata requests from the i-th metadata server in the j-1th period.
6. The method according to claim 1, characterized in that Before transferring all or part of the metadata in the metadata-migrating server to the metadata-migrating server, the method further includes: Acquire a target directory set of the metadata migration server, wherein the target directory set is a set of all top-level subdirectories managed by the metadata migration server; A directory to be migrated out is determined from the target directory set, wherein metadata in the directory to be migrated out is set to be transferred to the metadata migration server.
7. The method according to claim 6, characterized in that The step of determining a directory to be migrated out from the target directory set includes: Obtain the sum of weighted voting values corresponding to each directory in the target directory set, wherein the weighted voting value is a value obtained by weighted calculation based on each metadata access record in the directory and the difference between the time when the metadata access occurred and the current time.
8. The method according to claim 5, characterized in that The step of determining a metadata migration server from the metadata server cluster includes: The metadata migration server is determined from the metadata server cluster by using the load hotspot value, wherein the load hotspot value corresponding to the metadata migration server is the smallest in the metadata server cluster.
9. The method according to claim 1, characterized in that: Before reading the metadata processing record from the first bus memory device, the method further includes: Split the directory structure of the file system into multiple directory subtrees; The plurality of directory subtrees are distributed to the respective metadata servers in sequence, so that the subdirectories and file metadata information in the same directory are maintained by the same metadata server, wherein the file metadata information includes the static metadata.
10. The method according to claim 9, characterized in that The distributing the plurality of directory subtrees to the metadata servers in sequence includes: Perform hash calculation based on the file path name to obtain the hash value; Using the hash value, performing a modulo operation on the number of metadata service instances to determine the metadata service instance number corresponding to the file path name; According to the metadata service instance number, the plurality of directory subtrees are randomly distributed to the metadata service instances configured inside the respective metadata servers.
11. The method according to claim 9, characterized in that After distributing the plurality of directory subtrees to the metadata servers, the method further comprises: Based on the directory names corresponding to different directory subtrees in the multiple directory subtrees and the mapping relationship between the metadata servers, a metadata mapping table is created, wherein the metadata mapping table is used to locate and access the required static metadata.
12. The method according to claim 1, characterized in that Before reading the metadata processing record from the first bus memory device, the method further includes: Each metadata server is connected to a first bus memory device, wherein the first bus memory device is used to provide a shared memory space for each metadata server.
13. The method according to claim 12, characterized in that After connecting each metadata server to the first bus memory device, the method further includes at least one of the following: A global metadata mapping table is stored in a first value memory slice in the first bus memory device, wherein the global metadata mapping table records the correspondence between the static metadata and each metadata server; Allocate, through the first bus memory device, a second value memory slice corresponding to each metadata server as metadata cache space of the corresponding metadata server, wherein data in the second value memory slice is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying; Allocate a third value memory slice corresponding to each metadata server through the first bus memory device, wherein the third value memory slice is used to store metadata request information of the corresponding metadata server, and the metadata request information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying the metadata request information; Allocate a fourth value memory slice corresponding to each metadata server through the first bus memory device, wherein the fourth value memory slice is used to store metadata reply information of the corresponding metadata server, and the metadata reply information is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying it; Through the first bus memory device, each metadata server is allocated a corresponding fifth value memory slice as a first bus memory metadata request history record circular buffer and load statistics area of the corresponding metadata server, wherein the data in the fifth value memory slice is set to allow the corresponding metadata server to perform read and write access, while prohibiting other metadata servers from modifying the data.
14. The method according to any one of claims 1 to 13, characterized in that Before reading the metadata processing record from the first bus memory device, the method further includes: A smart network card is configured for each metadata server, wherein the smart network card is used to capture metadata requests and metadata replies from each metadata server, and the metadata requests and metadata replies captured by the smart network card are set to be stored in the shared memory of the first bus.
15. The method according to any one of claims 1 to 13, characterized in that The method is applied to a metadata server in a cluster of other metadata servers, wherein the static metadata in the cluster of other metadata servers is sequentially distributed to the metadata servers in the cluster of other metadata servers for management, and the metadata servers in the cluster of other metadata servers are interconnected with a second bus memory device via a second bus, and the second bus memory device is used to share other metadata processing records of the static metadata by the metadata servers in the cluster of other metadata servers, and comprises: reading the other metadata processing record from the second bus memory device; According to the other metadata processing record, obtaining the hotspot attribute of each metadata server of the other metadata server cluster; Based on the hotspot attributes of each metadata server in the other metadata server cluster, determining other metadata migration servers from the other metadata server cluster; Based on the hotspot attributes of each metadata server in the other metadata server cluster, determining other metadata migration servers from the other metadata server cluster; All or part of the metadata in the other metadata migration-out server is transferred to the other metadata migration-in server.
16. A distributed storage metadata management device, characterized in that The device is applied to a metadata server in a metadata server cluster, wherein the static metadata in the metadata server cluster is distributed to each metadata server in the metadata server cluster in sequence for management, each metadata server is connected to a first bus memory device via a first bus, and the first bus memory device is used to share metadata processing records of the static metadata by each metadata server, and the device comprises: a reading unit, configured to read the metadata processing record from the first bus memory device; An acquisition unit, configured to acquire a hotspot attribute of the metadata server according to the metadata processing record, wherein the hotspot attribute is used to measure the load of the metadata server; the hotspot attribute includes the number of metadata requests of each metadata server within a preset period and the average request response time of metadata requests of the server cluster within the preset period; A first determination unit is used to obtain a third value corresponding to each metadata server, wherein the third value is the difference between the average response time of requests of each metadata server within the preset period and the average request response time; the servers in the server cluster whose third values are greater than or equal to a preset threshold are determined as N candidate migration servers; wherein N is a positive integer; when N is greater than 1, the load hotspot value corresponding to each candidate migration server in the N candidate migration servers is obtained, and the candidate migration server corresponding to the largest load hotspot value in the metadata server cluster is determined as the metadata migration server, wherein the hotspot attribute of the metadata migration server meets the attribute condition of the hot frequency metadata server; A second determining unit is used to determine a metadata migration server from the metadata server cluster, wherein the hot attribute of the metadata migration server meets the attribute condition of the cold metadata server; The transfer unit is used to transfer all or part of the metadata in the metadata migration-out server to the metadata migration-in server.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 15 when executed by a processor.
18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 15 are implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Distributed storage method and system
CN113918097A