CN115757326A - Metadata server load balancing method and device of Ceph file system - Google Patents

Metadata server load balancing method and device of Ceph file system Download PDF

Info

Publication number
CN115757326A
CN115757326A CN202211364568.2A CN202211364568A CN115757326A CN 115757326 A CN115757326 A CN 115757326A CN 202211364568 A CN202211364568 A CN 202211364568A CN 115757326 A CN115757326 A CN 115757326A
Authority
CN
China
Prior art keywords
directory
transmitted
metadata server
fragments
fragment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211364568.2A
Other languages
Chinese (zh)
Inventor
万玉铸
江文龙
朱盛
何宇航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202211364568.2A priority Critical patent/CN115757326A/en
Publication of CN115757326A publication Critical patent/CN115757326A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a metadata server load balancing method and device of a Ceph file system. The metadata server load balancing method of the Ceph file system comprises the following steps: determining to derive current data of the directory fragments to be transmitted on the metadata server in response to triggering of load balancing of the metadata server; under the condition of keeping the directory fragments to be transmitted in a readable and writable state, sending the current data of the directory fragments to be transmitted to an import metadata server; freezing the directory fragments to be transmitted, and calculating incremental data of the directory fragments to be transmitted based on the current data; and sending the incremental data to an import metadata server so that the import metadata server generates a to-be-transmitted directory fragment for providing metadata service for the external by using the incremental data and the current data. The method and the device can obviously reduce the freezing time of the directory fragmentation.

Description

Metadata server load balancing method and device of Ceph file system
Technical Field
The present application relates to the field of distributed system technologies, and in particular, to a method and an apparatus for load balancing of a metadata server of a Ceph file system.
Background
The Ceph distributed file system adopts a centralized architecture, and metadata service hot spots can occur in unit data servers in actual service scenes, so that the performance of a Ceph distributed storage cluster is limited to be exerted. In order to break through the performance bottleneck of the unit data server in a large-scale cluster, the multivariate data server technology is developed. The problem of unbalanced service load caused by uneven fragmentation service exists in the technology of the multi-data server, and a metadata server load balancing method is generally used for solving the problem. However, the current metadata server load balancing method has the problem that the freezing time of the directory fragment is too long, thereby possibly causing delay-sensitive service failure or timeout.
Disclosure of Invention
The application provides a metadata server load balancing method and device for a Ceph file system, which can effectively reduce the freezing time of directory fragments.
In order to achieve the above object, the present application provides a method for load balancing metadata servers of a Ceph file system, where the Ceph file system includes at least two metadata servers, and the method is applied to an export metadata server of the at least two metadata servers, and the method includes:
determining to derive current data of the directory fragments to be transmitted on the metadata server in response to triggering of metadata server load balancing;
under the condition of keeping the directory fragments to be transmitted in a readable and writable state, sending the current data of the directory fragments to be transmitted to an import metadata server;
freezing the directory fragments to be transmitted, and calculating incremental data of the directory fragments to be transmitted based on the current data;
and sending the incremental data to an import metadata server so that the import metadata server generates a to-be-transmitted directory fragment for providing metadata service for the external by using the incremental data and the current data.
In an implementation manner, determining current data of a directory fragment to be transmitted on a metadata server includes: executing snapshot creating operation of the to-be-transmitted directory fragment to obtain current data;
calculating incremental data of the directory fragments to be transmitted based on the current data, wherein the incremental data comprises the following steps: and calculating the incremental data of the directory fragments to be transmitted based on the snapshot and the latest directory fragments to be transmitted.
In an implementable manner, the method further comprises:
releasing the current data under the condition that the imported metadata server does not successfully receive the current data; or the like, or, alternatively,
and under the condition that the import metadata server does not successfully receive the incremental data or the import metadata server does not successfully generate the catalogue fragments to be transmitted, releasing the current data and/or the incremental data and unfreezing the catalogue fragments to be transmitted.
In one implementation, the export metadata server is a metadata server with a largest directory fragmentation among the at least two metadata servers, and the method includes:
and triggering the load balance of the metadata server under the condition that the popularity of the directory fragments managed on the metadata server is derived to exceed the fragmentation threshold.
In an implementable manner, determining current data of a directory shard to be transmitted on a derived metadata server includes:
and splitting the directory fragment managed by the export metadata server into two fragments, wherein the two fragments comprise the directory fragment to be transmitted and the fragment still managed by the export metadata server.
In order to achieve the above object, the present application provides a method for balancing load of metadata servers of a Ceph file system, where the Ceph file system includes at least two metadata servers, and the method is applied to an import metadata server in the at least two metadata servers, and the method includes:
responding to the trigger metadata server load balance, and acquiring current data of the catalog fragments to be transmitted from the export metadata server under the condition that the export metadata server keeps the catalog fragments to be transmitted in a readable and writable state;
acquiring incremental data of the directory fragments to be transmitted from the export metadata server under the condition that the export metadata server freezes the directory fragments to be transmitted;
and generating the directory fragment to be transmitted for providing the metadata service for the outside by utilizing the incremental data and the current data.
In an implementation mode, the current data of the directory fragment to be transmitted is a snapshot of the directory fragment to be transmitted;
the method for generating the directory fragment to be transmitted for providing the metadata service for the outside by utilizing the incremental data and the current data comprises the following steps: and recovering the full data of the directory fragments to be transmitted by using the snapshot and the incremental data, and providing metadata service of the directory fragments to be transmitted by using the full data.
In an implementable manner, the method further comprises:
feeding back reception confirmation information and/or recovery confirmation information to the derived metadata service;
and releasing the related data of the directory fragment to be transmitted on the import metadata server under the condition that the import metadata server does not successfully receive the current data, or under the condition that the import metadata server does not successfully receive the incremental data, or under the condition that the import metadata server does not successfully generate the directory fragment to be transmitted.
To achieve the above object, the present application also provides an electronic device, which includes a processor; the processor is used for executing instructions to realize the method.
To achieve the above object, the present application also provides a computer-readable storage medium for storing instructions/program data that can be executed to implement the above method.
In the metadata server load balancing method of the Ceph file system, if the metadata server load balancing is triggered, the export metadata server determines the current data of the self to-be-transmitted directory fragment and sends the current data to the import metadata server under the condition that the to-be-transmitted directory fragment is in a readable and writable state; and then, under the condition of freezing the directory fragments to be transmitted, the incremental data of the directory fragments to be transmitted are sent to the import metadata server, so that the transmission form of the directory fragments is converted from full to incremental, full fragment snapshot transmission is carried out first, the time-consuming logic does not need to freeze the directory fragments, the directory in the process can still be updated, the directory fragments need to be frozen until the fragment snapshot is transmitted, and the transmission of fragment increment is started, and the time for transmitting the incremental directory fragments is shorter and can reach millisecond level because the increment of the directory fragments is far less than the full snapshot of the directory fragments, so that the metadata service performance under the scene is greatly improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of the operation of a Ceph distributed file system;
FIG. 2 is a schematic diagram of metadata server load balancing in a Ceph distributed file system;
fig. 3 is a schematic flowchart of an embodiment of a method for load balancing a metadata server in a Ceph file system according to the present application;
fig. 4 is a schematic flowchart of a work flow of deriving a metadata server in the metadata server load balancing method of the Ceph file system of the present application;
fig. 5 is a schematic flowchart of a work flow of importing a metadata server in a metadata server load balancing method of a Ceph file system according to the present application;
FIG. 6 is a schematic structural diagram of an embodiment of an electronic device of the present application;
FIG. 7 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. Additionally, the term "or" as used herein refers to a non-exclusive "or" (i.e., "and/or") unless otherwise indicated (e.g., "or otherwise" or in the alternative). Moreover, the various embodiments described herein are not necessarily mutually exclusive, as some embodiments may be combined with one or more other embodiments to form new embodiments.
The Ceph distributed file system adopts a centralized architecture, and a metadata service hotspot occurs in a single MDS in an actual service scene, so that the performance of the Ceph distributed storage cluster is limited. In order to break through the performance bottleneck of single MDS in large-scale clusters, multiple MDS technologies are developed. For a Ceph cluster of a large-scale cluster, a file service can be provided with a plurality of MDSs, and the plurality of MDSs jointly bear metadata load pressure, so that the metadata load pressure of a single MDS is shared.
As shown in fig. 1, in the multi-MDS scheme, MDS0, MDS1, MDS2 share the load of the file system metadata, and a directory is sub-tree fragmented, so that a specific sub-tree is processed only on a specific MDS. For example, the root directory of the Ceph distributed file system is divided into 3 directory fragments, which are respectively a fragment 0, a fragment 1 and a fragment 2, wherein the fragment 0 is managed by MDS0, the fragment 1 is managed by MDS1, and the fragment 2 is managed by MDS2, and they do not interfere with each other. When any one MDS is down, the access of the fragments managed on the node is in a hanging state, and the MDS cluster is in an abnormal state. Meanwhile, if the service access pressures on the segment 0, the segment 1 and the segment 2 are not consistent, the pressure on the hotspot segment is not distributed to other segments, so that the load of the MDS is unbalanced, and in an extreme case, only one MDS bears the metadata service pressure.
In order to solve the problem of unbalanced service load caused by unbalanced service in the partition shown in fig. 1, directory partition transmission may be performed by using the dynamic subtree transmission method shown in fig. 2 to implement MDS load balancing, thereby effectively solving the problem of unbalanced load. Specifically, each slice managed by an MDS is dynamically adjusted according to the service pressure on the slice, if the pressure on one slice is higher, the slice is automatically sliced, and the slice directory is automatically transmitted to an idle MDS. Before transmission, a segmented subtree to be transmitted needs to be frozen, then subtree transmission is triggered, and after the subtree transmission is completed, the frozen segmented subtree is unfrozen, so that the load is dynamically adjusted among multiple MDSs.
Based on the above, when a directory fragment on one MDS (Meta Data Service) is split and then transmitted to a target MDS, the currently split directory fragment needs to be frozen, and until the directory fragment completes transmission and obtains confirmation of a target MDS node, the source MDS node will not release the frozen state of the directory fragment, where the freezing is mainly to prevent cached Data from being dropped or modified by Trim in the transmission process of the directory fragment. The frozen directory fragment cannot provide service to the outside, and if the frozen directory fragment to be transmitted is large, the time delay of the freezing of the directory fragment is long, which may directly cause the time delay sensitive service failure or timeout.
Based on the above, the application provides a metadata server load balancing method for a Ceph file system, in the method, if the metadata server load balancing is triggered, a exporting metadata server determines the current data of the directory fragments to be transmitted and sends the current data to a importing metadata server under the condition that the directory fragments to be transmitted are kept in a readable and writable state; and then, under the condition of freezing the directory fragments to be transmitted, the incremental data of the directory fragments to be transmitted are sent to the import metadata server, so that the transmission form of the directory fragments is converted from full to incremental, full fragment snapshot transmission is carried out first, the time-consuming logic does not need to freeze the directory fragments, the directory in the process can still be updated, the directory fragments need to be frozen until the fragment snapshot is transmitted, and the transmission of fragment increment is started, and the time for transmitting the incremental directory fragments is shorter and can reach millisecond level because the increment of the directory fragments is far less than the full snapshot of the directory fragments, so that the metadata service performance under the scene is greatly improved.
Specifically, as shown in fig. 3, the method for load balancing a metadata server of a Ceph file system according to the present embodiment includes the following steps. It should be noted that the following step numbers are only used for simplifying the description, and are not intended to limit the execution order of the steps, and the execution order of the steps in the present embodiment may be arbitrarily changed without departing from the technical idea of the present application.
S101: and determining to derive current data of the directory fragments to be transmitted on the metadata server in response to triggering the load balance of the metadata server.
Optionally, after triggering the metadata server to perform load balancing, it may be determined to derive current data of the to-be-transmitted directory fragment on the metadata server, so that the current data of the to-be-transmitted directory fragment is subsequently sent to the import metadata server.
When the access pressure of the derived metadata server far exceeds the rest metadata servers of the file system, that is, when a difference between a numerical value such as a maximum value, a median value or an average value of the access pressures of the rest metadata servers of the file system and the access pressure of the derived metadata server is greater than a first threshold, the load balance of the metadata server may be triggered. The first threshold is set according to actual conditions, and is not limited herein, and may be, for example, 20%.
Alternatively, the metadata server load balancing may be triggered when the directory sharding amount managed on the export metadata server far exceeds the other metadata servers of the file system, that is, when a difference between a maximum value, a median value, or an average value of the directory sharding amounts managed on the other metadata servers of the file system and the directory sharding amount managed on the export metadata server is greater than the second threshold. The first threshold is set according to actual conditions, and is not limited herein, and may be, for example, 1GB.
Still alternatively, the metadata server load balancing may be triggered when a difference between the access heat (e.g., read-write heat) of the directory shards managed on the derived metadata server and the access heat of the directory shards managed on the remaining metadata servers of the file system is greater than a heat threshold. The heat threshold may also be set according to actual conditions, and is not limited herein.
Still alternatively, metadata server load balancing may be triggered when the popularity of directory shards managed on the export metadata server exceeds a shard threshold. The fragmentation threshold may also be set according to actual conditions, which is not limited herein. Illustratively, the file client reads and writes metadata to the MDS cluster, and assuming that there are many more reads and writes for directory fragment 1 than directories of directory fragment 0 and directory fragment 2, the directory fragment heat of directory fragment 1 will continue to increase until the directory fragment heat of directory fragment 1 reaches the fragment threshold to trigger the metadata server load balancing.
Under the condition of triggering load balancing of the metadata server, firstly, the directory fragments to be transmitted of the metadata server can be determined.
The directory fragments to be transmitted of the export metadata server may be confirmed according to the condition of the export metadata server and/or the condition of the remaining metadata servers of the file system.
Generally, one metadata server is responsible for managing one directory fragment, so that the export metadata server can comprehensively confirm how many directory fragments to be transmitted need to be split from the directory fragment managed by the export metadata server according to the condition of the export metadata server and the conditions of the other metadata servers of the file system. For example, the export metadata server may determine how many directory shards to be transmitted need to be split from the directory shards it manages based on the maximum, median, or average of the directory shards managed on the remaining metadata servers of the file system and the directory shards managed on the export metadata server. It can be understood that, after the directory fragments managed on the export metadata server are split into the directory fragments to be transmitted, the remaining directory fragments are also managed by the export metadata server.
Of course, the condition that the export metadata server is responsible for managing at least two directory fragments is not excluded, in which case, the export metadata server may use one of the directory fragments as the directory fragment to be transmitted, or the export metadata server splits one of the directory fragments to be transmitted from one of the directory fragments.
After the export metadata server determines the directory fragments to be transmitted based on the method, the export metadata server can extract the current data of the directory fragments to be transmitted. For example, a snapshot creation operation of the directory fragment to be transmitted may be performed to obtain current data of the directory fragment to be transmitted. It is to be understood that the current data of the directory slice to be transmitted may be the current full amount of data.
S102: and under the condition of keeping the directory fragments to be transmitted in a readable and writable state, sending the current data of the directory fragments to be transmitted to an import metadata server.
After determining the current data of the directory fragment to be transmitted on the export metadata server, the current data of the directory fragment to be transmitted can be sent to the import metadata server under the condition that the directory fragment to be transmitted is kept in a readable and writable state, so that the import metadata server can obtain the current full data, and even if the directory fragment to be transmitted is different from the current data due to access in the process of transmitting the current data, the subsequent export metadata server only needs to send incremental data (namely, the differential data generated by accessing the directory fragment to be transmitted in the transmission process) in the transmission process to the import metadata server, so that the import metadata server can obtain the final data of the directory fragment to be transmitted on the export metadata server by combining the current data and the incremental data.
After the import metadata server receives the current data of the directory fragments to be transmitted, it may send confirmation information (i.e., reception confirmation information) to the export metadata server, so that the export metadata server knows that the transmission of the current data of the directory fragments to be transmitted is completed, and thus the export metadata server may proceed to the next step, i.e., step S103.
Under the condition that the import metadata server does not successfully receive the current data of the directory fragments to be transmitted, the import metadata server can release the received related data of the directory fragments to be transmitted (for example, the current data of the directory fragments to be transmitted), so as to delete the useless data in time. In addition, the import metadata server may also send information confirming that the current data is unsuccessfully received to the export metadata server, so that the export metadata server knows that the import metadata server unsuccessfully receives the current data of the directory shard to be transmitted, so that the export metadata server unfreezes the directory shard to be transmitted, and recovers IO services on the directory shard to be transmitted. In addition, the export metadata server may delete the generated current data of the directory shard to be transmitted (i.e., the snapshot of the directory shard to be transmitted) and the like under the condition that the import metadata server does not successfully receive the current data of the directory to be transmitted, so as to delete the useless data in time.
S103: and freezing the directory fragments to be transmitted, and calculating the incremental data of the directory fragments to be transmitted based on the current data.
After the current data of the directory fragments to be transmitted are sent to the import metadata server, the directory fragments to be transmitted can be frozen, and incremental data of the directory fragments to be transmitted are calculated based on the current data.
Freezing the directory fragment to be transmitted can mean closing the read-write permission of the directory fragment to be transmitted, so that the data of the directory fragment to be transmitted cannot be updated in the freezing period by freezing the directory fragment to be transmitted.
Therefore, under the condition of freezing the directory fragments to be transmitted, the incremental data of the directory fragments to be transmitted can be calculated based on the current data and the latest data of the directory fragments to be transmitted, so that after the incremental data of the directory fragments to be transmitted are sent to the import metadata server, the import metadata server can calculate the latest data of the directory fragments to be transmitted based on the incremental data of the directory fragments to be transmitted and the previously received current data, the freezing time of the directory fragments to be transmitted can be reduced under the condition that the directory fragment data is correctly transmitted, the influence of dynamic directory fragment transmission on services under the multi-MDS scene is reduced to the minimum, the transmission delay of the multi-MDS dynamic directory fragments is greatly reduced, and the performance and the robustness of the Ceph distributed file system under the time delay sensitive scene are effectively improved.
Optionally, the incremental data of the directory fragments to be transmitted may be calculated based on the snapshot of the directory fragments to be transmitted and the latest directory fragment to be transmitted. Specifically, the snapshot of the directory fragment to be transmitted and the latest directory fragment to be transmitted may be compared to determine the modified content of the directory fragment to be transmitted after the snapshot of the directory fragment to be transmitted is generated, so as to generate the incremental data of the directory fragment to be transmitted.
S104: and sending the incremental data to an import metadata server so that the import metadata server generates a to-be-transmitted directory fragment for providing metadata service for the external by using the incremental data and the current data.
After the incremental data of the directory fragments to be transmitted are calculated based on the current data, the incremental data of the directory fragments to be transmitted can be sent to the import metadata server, so that the import metadata server can generate the latest data of the directory fragments to be transmitted by using the incremental data and the current data, that is, the import metadata server can recover the full fragments of the directory fragments to be transmitted by using the incremental data and the current data, and thus, the import metadata server can accurately provide metadata services for the outside by using the full fragments of the directory fragments to be transmitted, that is, the services of the directory fragments to be transmitted can be obtained from the import metadata server.
After the import metadata server receives the incremental data of the directory fragment to be transmitted, it may send confirmation information (i.e., reception confirmation information) to the export metadata server, so that the export metadata server knows that the incremental data of the directory fragment to be transmitted has been transmitted, and thus the export metadata server may enter the next step, i.e., step S105.
When the import metadata server does not successfully receive the incremental data of the directory shards to be transmitted, the import metadata server may release the received related data of the directory shards to be transmitted (for example, snapshots and/or incremental data of the directory shards to be transmitted), so as to delete the useless data in time. In addition, the import metadata server may further send the increment information that the confirmation of unsuccessful reception to the export metadata server, so that the export metadata server knows that the import metadata server has unsuccessfully received the increment data of the directory fragment to be transmitted, so that the export metadata server unfreezes the directory fragment to be transmitted, and recovers the IO service on the directory fragment to be transmitted. In addition, the export metadata server can delete the generated snapshot, the incremental data and the like of the directory fragment to be transmitted under the condition that the import metadata server does not successfully receive the incremental data of the directory to be transmitted so as to delete the useless data in time.
In addition, after the import metadata server receives the incremental data of the directory fragments to be transmitted, it needs to determine whether the full fragments of the directory fragments to be transmitted are successfully recovered, and sends the determination result (and recovery determination information) to the export metadata server, so that the export metadata server knows whether the import metadata server successfully recovers the full data of the directory fragments to be transmitted.
Under the condition that the import metadata server successfully recovers the full data of the directory fragments to be transmitted, the import metadata server can provide metadata services to the outside based on the recovered full data of the directory fragments to be transmitted, that is, the import metadata server can recover the metadata IO operation of the directory fragments to be transmitted based on the full data of the directory fragments to be transmitted. In addition, the import metadata server may further send information confirming that the recovery has been successful to the export metadata server, so that the export metadata server knows that the import metadata server has successfully recovered the full amount of data of the directory fragment to be transmitted, so that the export metadata server may proceed to the next step, i.e., step S105.
Under the condition that the import metadata server does not successfully recover the full data of the directory fragments to be transmitted, the import metadata server can release the received related data (such as the current data and/or incremental data of the directory fragments to be transmitted) of the directory fragments to be transmitted, so as to delete the useless data in time. In addition, the import metadata server may also send the recovery information that is not successfully confirmed to the export metadata server, so that the export metadata server knows that the import metadata server has not successfully recovered the full data of the directory fragments to be transmitted, so that the export metadata server unfreezes the directory fragments to be transmitted, and recovers the IO services on the directory fragments to be transmitted. In addition, the export metadata server can delete the generated snapshot, incremental data and the like of the directory shard to be transmitted under the condition that the import metadata server is confirmed to be unsuccessful in recovering the full amount of data of the directory to be transmitted, so that the useless data can be deleted in time.
S105: and unfreezing and releasing the directory fragments to be transmitted.
After incremental data of the to-be-transmitted directory fragments are successfully transmitted to the import metadata server, the export metadata server can unfreeze the to-be-transmitted directory fragments and release the unfrozen to-be-transmitted directory fragments, so that the export metadata server can transmit the directory fragments to the import metadata server by using the load balancing method under the condition of consuming short freezing time, and delete relevant contents of the own to-be-transmitted directory fragments after the transmission is successful so as to share the service pressure of the export metadata server, thereby balancing the service pressure among a plurality of metadata servers.
The release of the to-be-transmitted directory fragments can mean that the metadata server is led out to delete the related contents of the to-be-transmitted directory fragments on the metadata server.
In the embodiment, if the load balance of the metadata server is triggered, the export metadata server determines the current data of the directory fragment to be transmitted and sends the current data to the import metadata server under the condition that the directory fragment to be transmitted is in a readable and writable state; and then, under the condition of freezing the directory fragments to be transmitted, the incremental data of the directory fragments to be transmitted are sent to the import metadata server, so that the transmission form of the directory fragments is converted from full to incremental, full fragment snapshot transmission is carried out first, the time-consuming logic does not need to freeze the directory fragments, the directory in the process can still be updated, the directory fragments need to be frozen until the fragment snapshot is transmitted, and the transmission of fragment increment is started, and the time for transmitting the incremental directory fragments is shorter and can reach millisecond level because the increment of the directory fragments is far less than the full snapshot of the directory fragments, so that the metadata service performance under the scene is greatly improved.
For the exported metadata server in the Ceph file system, please refer to fig. 4 for the steps of implementing the metadata server load balancing method of the Ceph file system, and fig. 4 is a schematic diagram of a workflow of exporting the metadata server in the metadata server load balancing method of the Ceph file system according to the present application.
S201: and determining the current data of the directory fragments to be transmitted on the metadata server in response to the triggering of the load balancing of the metadata server.
S202: and under the condition of keeping the directory fragments to be transmitted in a readable and writable state, sending the current data of the directory fragments to be transmitted to an import metadata server.
S203: and freezing the directory fragments to be transmitted, and calculating the incremental data of the directory fragments to be transmitted based on the current data.
S204: and sending the incremental data to an import metadata server so that the import metadata server generates a to-be-transmitted directory fragment for providing metadata service for the external by using the incremental data and the current data.
In this embodiment, the steps are similar to those in the embodiment shown in fig. 3, and detailed description is omitted. If the load of the metadata server is triggered to be balanced, the export metadata server determines the current data of the directory fragment to be transmitted per se and sends the current data to the import metadata server under the condition that the directory fragment to be transmitted is kept in a readable and writable state; and then, under the condition of freezing the directory fragment to be transmitted, the incremental data of the directory fragment to be transmitted is sent to the imported metadata server, so that the transmission form of the directory fragment is converted from full to incremental, full fragment snapshot is transmitted first, the time-consuming logic does not need to freeze the directory fragment, the directory in the process can still be updated, the directory fragment is frozen until the fragment snapshot is transmitted, and the fragment increment is transmitted, and the directory fragment increment is far smaller than the full snapshot of the directory fragment, so that the time for transmitting the incremental directory fragment is short and can reach millisecond level, and the metadata service performance under the scene is greatly improved.
For the import metadata server in the Ceph file system, please refer to fig. 5 for the steps of implementing the metadata server load balancing method of the Ceph file system, and fig. 5 is a schematic diagram of a workflow of importing the metadata server in the metadata server load balancing method of the Ceph file system according to the present application.
S301: and responding to the trigger of the load balance of the metadata server, and the import metadata server acquires the current data of the directory fragments to be transmitted from the export metadata server.
The current data is transmitted under the condition that the export metadata server keeps the directory fragment to be transmitted in a readable and writable state.
S302: and obtaining the incremental data of the directory fragments to be transmitted from the export metadata server.
The incremental data is transmitted by the export metadata server in the event that the export metadata server freezes the directory fragment to be transmitted.
Determining current data of the directory shards to be transmitted on the metadata server.
S303: and the import metadata server generates a to-be-transmitted directory fragment for providing metadata service for the outside by using the incremental data and the current data.
In this embodiment, the steps are similar to those in the embodiment shown in fig. 3, and detailed description is omitted. If the load of the metadata server is triggered to be balanced, the import metadata server acquires the current data of the directory fragments to be transmitted from the export metadata server under the condition that the export metadata server keeps the directory fragments to be transmitted in a readable and writable state; and then, under the condition that the export metadata server freezes the directory fragments to be transmitted, acquiring incremental data of the directory fragments to be transmitted from the export metadata server, so that the transmission form of the directory fragments is converted from full to incremental, full fragment snapshot transmission is firstly carried out, the time-consuming logic does not need to freeze the directory fragments, the directory in the process can still be updated, the directory fragments are not needed to be frozen until the fragment snapshots are transmitted and fragment increment transmission is started, and the increment of the directory fragments is far smaller than the full snapshot of the directory fragments, so that the time for transmitting the incremental directory fragments is short and can reach millisecond level, and the metadata service performance under the scene is greatly improved.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of an electronic device according to the present application. The electronic device 10 includes a processor 12, and the processor 12 is configured to execute instructions to implement the above-mentioned metadata server load balancing method of the Ceph file system. For a specific implementation process, please refer to the description of the foregoing embodiment, which is not repeated herein.
The processor 12 may also be referred to as a CPU (Central Processing Unit). The processor 12 may be an integrated circuit chip having signal processing capabilities. The processor 12 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 12 may be any conventional processor or the like.
The electronic device 10 may further include a memory 11 for storing instructions and data required for operation of the processor 12.
The processor 12 is configured to execute instructions to implement the methods provided by any one of the above embodiments of the metadata server load balancing method and the image encoding method of the Ceph file system of the present application, and any non-conflicting combinations thereof.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present disclosure. The computer readable storage medium 30 of the embodiment of the present application stores instructions/program data 31, and when executed, the instructions/program data 31 implement the method provided by any embodiment and any non-conflicting combination of the metadata server load balancing method of the Ceph file system of the present application. The instructions/program data 31 may form a program file stored in the storage medium 30 in the form of a software product, so as to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned storage medium 30 includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
The above are only embodiments of the present application, and not intended to limit the scope of the present application, and all equivalent structures or equivalent processes performed by the present application and the contents of the attached drawings, which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A metadata server load balancing method of a Ceph file system, wherein the Ceph file system comprises at least two metadata servers, and the method is applied to an export metadata server in the at least two metadata servers, and the method comprises the following steps:
determining to derive current data of the directory fragments to be transmitted on the metadata server in response to triggering of metadata server load balancing;
under the condition that the directory fragment to be transmitted is kept in a readable and writable state, the current data of the directory fragment to be transmitted is sent to an import metadata server;
freezing the directory fragments to be transmitted, and calculating incremental data of the directory fragments to be transmitted based on the current data;
and sending the incremental data to the import metadata server so that the import metadata server generates the to-be-transmitted directory fragments for providing metadata service for the outside by using the incremental data and the current data.
2. The method according to claim 1, wherein the determining to derive current data of the directory shards to be transmitted on the metadata server comprises: executing snapshot creating operation of the to-be-transmitted directory shards to obtain the current data;
calculating incremental data of the directory fragment to be transmitted based on the current data, including: and calculating the incremental data of the directory fragment to be transmitted based on the snapshot and the latest directory fragment to be transmitted.
3. The method of load balancing according to claim 1, further comprising:
releasing the current data under the condition that the import metadata server is confirmed to not successfully receive the current data; or the like, or a combination thereof,
and under the condition that the import metadata server is confirmed to not successfully receive the incremental data or the import metadata server is confirmed to not successfully generate the directory fragments to be transmitted, releasing the current data and/or the incremental data, and unfreezing the directory fragments to be transmitted.
4. The method of claim 1, wherein the derived metadata server is a metadata server with a largest directory fragmentation among the at least two metadata servers, and wherein the method comprises:
and triggering the load balance of the metadata server under the condition that the popularity of the directory fragments managed on the export metadata server exceeds a fragment threshold value.
5. The method according to claim 1, wherein the determining to derive current data of the directory shards to be transmitted on the metadata server comprises:
and splitting the directory fragment managed by the export metadata server into two fragments, wherein the two fragments comprise the directory fragment to be transmitted and the fragment still managed by the export metadata server.
6. A metadata server load balancing method of a Ceph file system, wherein the Ceph file system comprises at least two metadata servers, and the method is applied to an import metadata server in the at least two metadata servers, and is characterized by comprising the following steps:
responding to the trigger metadata server load balance, and acquiring current data of the directory fragments to be transmitted from an export metadata server under the condition that the export metadata server keeps the directory fragments to be transmitted in a readable and writable state;
acquiring incremental data of the catalog fragment to be transmitted from the export metadata server under the condition that the export metadata server freezes the catalog fragment to be transmitted;
and generating the directory fragment to be transmitted for providing the metadata service for the outside by using the incremental data and the current data.
7. The method according to claim 6, wherein the current data of the directory shard to be transmitted is a snapshot of the directory shard to be transmitted;
the generating the to-be-transmitted directory fragment for providing the metadata service to the outside by using the incremental data and the current data includes: and recovering the full data of the directory fragments to be transmitted by using the snapshot and the incremental data, and providing metadata service of the directory fragments to be transmitted by using the full data.
8. The method of claim 6, further comprising:
feeding back reception confirmation information and/or recovery confirmation information to the export metadata service;
and releasing the related data of the catalog fragment to be transmitted on the import metadata server under the condition that the import metadata server does not successfully receive the current data, or under the condition that the import metadata server does not successfully receive the incremental data, or under the condition that the import metadata server does not successfully generate the catalog fragment to be transmitted.
9. An electronic device, wherein the electronic device comprises a processor; the processor is configured to execute instructions to implement the steps of the method according to any one of claims 1-8.
10. A computer readable storage medium having stored thereon instructions/program data, characterized in that said instructions/program data, when executed, implement the steps of the method according to any of claims 1-8.
CN202211364568.2A 2022-11-02 2022-11-02 Metadata server load balancing method and device of Ceph file system Pending CN115757326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211364568.2A CN115757326A (en) 2022-11-02 2022-11-02 Metadata server load balancing method and device of Ceph file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211364568.2A CN115757326A (en) 2022-11-02 2022-11-02 Metadata server load balancing method and device of Ceph file system

Publications (1)

Publication Number Publication Date
CN115757326A true CN115757326A (en) 2023-03-07

Family

ID=85355567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211364568.2A Pending CN115757326A (en) 2022-11-02 2022-11-02 Metadata server load balancing method and device of Ceph file system

Country Status (1)

Country Link
CN (1) CN115757326A (en)

Similar Documents

Publication Publication Date Title
AU2020202621B2 (en) Techniques for performing data reconciliation in distributed data store systems
EP3208714A1 (en) Data reconstruction method, apparatus and system in distributed storage system
US20190087439A1 (en) Data replication from a cloud-based storage resource
CN107315825B (en) Index updating system, method and device
US20210160319A1 (en) Data Sending Method and Apparatus, and Data Receiving Method and Apparatus
CN111262822B (en) File storage method, device, block link point and system
CN111913667A (en) OSD blocking detection method, system, terminal and storage medium based on Ceph
CN111049928A (en) Data synchronization method, system, electronic device and computer readable storage medium
EP4270299A1 (en) Operating system upgrade method, electronic device, and storage medium
CN112632029B (en) Data management method, device and equipment of distributed storage system
CN112069169A (en) Block data storage method and device, electronic equipment and readable storage medium
CN106817387B (en) Data synchronization method, device and system
CN113515531A (en) Data access method, device, client and storage medium
CN112783445A (en) Data storage method, device, system, electronic equipment and readable storage medium
CN101216794A (en) Improved Server-Less backup method, memory apparatus and backup server
CN116233111A (en) Minio-based large file uploading method
CN110324681B (en) Slicing method, device, storage medium and transmission system of multimedia data
CN112162773A (en) Differential upgrading method and device, storage medium and terminal
EP3396554A1 (en) Backup control method and backup control device
CN115757326A (en) Metadata server load balancing method and device of Ceph file system
WO2008133862A1 (en) Efficiently re-starting and recovering synchronization operations between a client and server
CN113157497B (en) Data storage method, device, equipment and medium
CN109766363B (en) Streaming data processing method, system, electronic device and storage medium
CN113391759B (en) Communication method and equipment
CN107203559B (en) Method and device for dividing data strips

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination