CN102411637B - Metadata management method of distributed file system - Google Patents

Metadata management method of distributed file system Download PDF

Info

Publication number
CN102411637B
CN102411637B CN 201110454262 CN201110454262A CN102411637B CN 102411637 B CN102411637 B CN 102411637B CN 201110454262 CN201110454262 CN 201110454262 CN 201110454262 A CN201110454262 A CN 201110454262A CN 102411637 B CN102411637 B CN 102411637B
Authority
CN
China
Prior art keywords
metadata
set
server
copy
stored
Prior art date
Application number
CN 201110454262
Other languages
Chinese (zh)
Other versions
CN102411637A (en
Inventor
沈国文
吴棣章
Original Assignee
创新科软件技术(深圳)有限公司
创新科存储技术有限公司
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 创新科软件技术(深圳)有限公司, 创新科存储技术有限公司 filed Critical 创新科软件技术(深圳)有限公司
Priority to CN 201110454262 priority Critical patent/CN102411637B/en
Publication of CN102411637A publication Critical patent/CN102411637A/en
Application granted granted Critical
Publication of CN102411637B publication Critical patent/CN102411637B/en

Links

Abstract

本发明提供了一种分布式文件系统的元数据管理方法,通过基于元数据服务器集群对元数据进行管理,并能确保并发访问下元数据的一致性、集群的负载均衡。 The present invention provides a method for managing metadata distributed file system, manage the metadata-based metadata server clustering, load balancing and to ensure the consistency of concurrent data access roadway, cluster. 采用本发明能有效满足大量客户端并发访问的需求。 According to the present invention can effectively meet a large demand for concurrent access client.

Description

分布式文件系统的元数据管理方法 Metadata management method for distributed file systems

技术领域 FIELD

[0001] 本发明涉及存储技术,特别是涉及一种分布式文件系统的元数据管理方法。 [0001] The present invention relates to storage technologies, and more particularly to a method for managing metadata in a distributed file system.

背景技术 Background technique

[0002] 在现有的分布式文件系统中,通常采用单个元数据服务器对元数据进行管理。 [0002] In the conventional distributed file system, usually a single metadata management server metadata. 但是随着文件数量的增长,单个元数据服务器已经难以满足大量客户端并发访问的需求。 But as the number of files grows, a single metadata server it has been difficult to meet a large number of concurrent client access needs. 针对该情况,目前提出了在分布式文件系统中引入元数据服务器集群概念,即利用多个元数据服务器对元数据进行管理。 For this case, the current proposed the introduction of a metadata server cluster concept in a distributed file system, namely the use of multiple metadata servers for metadata management.

[0003]目前尚未公开一种在分布式文件系统中基于元数据服务器集群实现对元数据管理的技术方案。 [0003] is not yet open for implementing technical solutions for metadata management based on the metadata server cluster in a distributed file system.

发明内容 SUMMARY

[0004] 有鉴于此,本发明的主要目的在于提供一种分布式文件系统的元数据管理方法,该方法能满足大量客户端并发访问的需求。 [0004] In view of this, the main object of the present invention to provide a method for managing metadata in a distributed file system, which can meet the large demand for concurrent access client.

[0005] 为了达到上述目的,本发明提出的技术方案为: [0005] To achieve the above object, the technical solution proposed by the invention is:

[0006] 一种分布式文件系统的元数据管理方法,该方法包括以下步骤: [0006] The metadata management method of distributed file system, the method comprising the steps of:

[0007] a、分布式文件系统预先建立M个元数据集合,根据预设的第一哈希函数,采用哈希散列的方式将所述元数据集合分散设置在元数据服务集群中的各元数据服务器中。 [0007] a, a distributed file system metadata a pre-established set of M, a first predetermined hash function, the hash using a hash manner according to the set of metadata in a metadata service provided dispersed in each cluster metadata server. 所述元数据服务器各自保存一份全局集合映射表,所述全局集合映射表用于记录本服务器中设置的各元数据集合与其包含的元数据的映射关系以及所有未设置在本服务器中的各元数据集合与其所属元数据服务器的映射关系; The meta data server each keep a global collection mapping table, the mapping table for global collection of each set of mapping relationship metadata record provided in this server contains its metadata is not provided, and each of all the servers in the present set of metadata relevant to their mapping relationship metadata server;

[0008] b、当客户端向元数据服务集群中的一个元数据服务器S_1请求保存文件时,所述元数据服务器S_1为所述文件分配一个全局索引号,并根据该全局索引号,采用哈希散列的方式,确定所述文件的元数据所属的元数据集合W,以及该元数据存放在所述元数据集合W中的索引节点位置D,所述元数据服务器S_1根据自身保存的全局集合映射表确定所述元数据集合W所在的元数据服务器S_i,触发所述元数据服务器S_i将所述文件的元数据保存在所述元数据服务器S_i中。 [0008] b, when the client to the service metadata of one metadata cluster server S_1 save the file request, the metadata server S_1 a global index number assigned to the file, and based on the global index, using Ha Greek way hash, W determining the set of metadata file associated metadata, and the metadata stored in the metadata index node in set W D position, the meta data server according to its stored global S_1 collection mapping table to determine the set of metadata to the metadata server where W S_i, triggering the S_i metadata server of the file metadata stored in the metadata server in S_i.

[0009] 综上所述,本发明提出的分布式文件系统的元数据管理方法,通过基于元数据服务器集群对元数据进行管理,并确保并发访问下元数据的一致性、集群的负载均衡,因此,能有效满足大量客户端并发访问的需求。 [0009] In summary, metadata management method for distributed file system provided by the present invention, the metadata management based on metadata server cluster and load balancing to ensure data consistency concurrent access roadway, cluster, Therefore, a large number of clients can effectively meet the needs of concurrent access.

附图说明 BRIEF DESCRIPTION

[0010] 图1为本发明实施例一的流程示意图。 [0010] FIG. 1 is a schematic flowchart of an embodiment of the present invention.

具体实施方式 Detailed ways

[0011] 为使本发明的目的、技术方案和优点更加清楚,下面将结合附图及具体实施例对本发明作进一步地详细描述。 [0011] To make the objectives, technical solutions, and advantages of the invention more clearly, the accompanying drawings and the following specific embodiments of the present invention will be described in further detail.

[0012] 本发明的核心思想是:基于元数据服务器集群对元数据进行管理,在存储元数据时,利用散列函数确定存储元数据文件的地址,确保集群的负载均衡;在进行元数据存储时,同时在其他服务器中存储相应的副本文件,在对元数据修改时对其副本也进行修改,在一服务器出现故障时通过一预设的用于协调的服务器进行故障的协调处理。 [0012] The core idea of ​​the invention is: to manage the metadata server cluster based on the metadata, when the metadata is stored, is determined using a hash function stored in the metadata file address, ensuring load balancing cluster; performing metadata storage when, while the other copy of the server storing the corresponding file, when modifying its copy of the metadata may also be modified by coordination Troubleshooting a predetermined server for coordinating when a server fails. 如此,可以确保并发访问下元数据的一致性、完整性以及集群服务器的负载均衡。 So, load balancing ensures consistency of concurrent data access roadway, integrity and cluster servers.

[0013] 图1为本发明实施例一的流程示意图,如图1所示,该实施例一主要包括以下步骤: [0013] FIG. 1 is a schematic flow chart of embodiment of the present invention, shown in Figure 1, the first embodiment includes the following steps:

[0014] 步骤101、分布式文件系统预先建立M个元数据集合,根据预设的第一哈希函数,采用哈希散列的方式将所述元数集合分散设置在元数据服务集群中的各元数据服务器中。 [0014] Step 101, the distributed file system metadata M pre-established set of predetermined first hash function, the hash using a hash according to the manner set metadata in a metadata service provided dispersed cluster each metadata server.

[0015] 所述元数据(metadata),是指文件或目录的元数据信息,包括文件的名字、大小、修改时间、读写权限、所有者等信息,对于具体的文件或目录来说,由索引节点(inode)保存这些元数据信息。 [0015] The metadata (Metadata), refers to the file or directory metadata information, including file name, size, modification time information, access rights, owner, etc., for a particular file or directory, the a index node (the inode) save metadata information. 这里,所述元数据服务器各自保存一全局集合映射表,所述全局集合映射表用于记录本服务器中设置的各元数据集合与其包含的元数据的映射关系,以及所有未设置在本服务器中的各元数据集合与其所属元数据服务器的映射关系。 Here, each of the metadata server storage mapping table of a global set of the global set of mapping table for mapping relational data set for each recording element provided in the present server containing its metadata, and all the server is not provided in the present each set of metadata mapping relationship with their respective metadata server. 具体而言,全局集合映射表将保存文件的全局索引号到所属元数据集合的映射关系,具体地,以该全局集合映射表作为哈希表,以文件全局索引号的高H位作为散列函数的参数,查找该全局集合映射表可得到此文件元数据所属元数据集合的位置信息。 Specifically, the mapping relationship between global mapping table to save the file set global index belongs to the set of metadata, in particular, to set the global mapping table as a hash table, high global bit file H as the hash index number function parameters, to find the global collection position information mapping table to obtain this metadata associated metadata file set.

[0016] 所述元数据集合(set),是由许多文件的元数据组成的集合单元,集合中将保存集合的状态以及该集合的元数据映射表,该元数据映射表用于记录元数据集合中各文件的全局索引号与其索引节点位置的对应关系,具体地,以该元数据映射表为哈希表,以文件全局索引号的低L位作为散列函数的参数,查找该元数据映射表,即可得到该文件的元数据所在的索引节点的位置,在该索引节点的位置上将保存着文件的元数据。 [0016] The metadata set (SET), is set by the metadata unit consisting of a number of files, stored in the set of states and a set of metadata mapping table of the set, the metadata mapping table for recording metadata the correspondence relationship set for each global index file inode its position, in particular, to the metadata mapping table as a hash table, the global low L-bit index file as parameters of the hash function to find the metadata inode location mapping table, you can get the file where the metadata stored in the metadata file on the location of the inode.

[0017] 本步骤中,通过哈希散列的方式,可以有效实现元数据集合在各元数据服务器上的均衡分布,有利于实现并发访问下集群的负载均衡。 [0017] In this step, by way hashes can be effectively implemented on each set of metadata in the metadata server balanced distribution of load balancing facilitate concurrent access to the cluster.

[0018] 步骤102、当客户端向元数据服务集群中的一个元数据服务器S_1请求保存文件时,所述元数据服务器S_1为所述文件分配一个全局索引号,并根据该全局索引号,采用哈希散列的方式,确定所述文件的元数据所属的元数据集合W,以及该元数据存放在所述元数据集合W中的索引节点位置D,所述元数据服务器S_1根据自身保存的全局集合映射表确定所述元数据集合W所在的元数据服务器S_i,触发所述元数据服务器S_i将所述文件的元数据保存在所述元数据服务器S_i中。 [0018] Step 102, when a metadata server to the client metadata S_1 cluster service request to save the file, the metadata server S_1 a global index number assigned to the file, and based on the global index, using hashes manner, the metadata determination metadata file belongs set W, and the metadata stored in the metadata index node in set W D position, the meta data server according to its stored S_1 global mapping table to determine a set of metadata servers set of metadata S_i where W, triggers the S_i metadata server of the file metadata stored in the metadata server in S_i.

[0019] 这里,所述全局索引号为分布式文件系统中每个文件的元数据的唯一标识,用于定位该文件元数据所在的集合以及在集合中的具体保存位置。 [0019] Here, the global index number uniquely identifies each file in the distributed file system metadata for locating the set of metadata file is located and the specific position stored in the collection.

[0020] 较佳地,所述确定所述文件的元数据所属的元数据集合W,以及该元数据存放在所述元数据集合W中的索引节点位置D具体可以为: [0020] Preferably, the determined metadata of the metadata file set W belongs, and the metadata stored in the metadata index set in the node position W D may be:

[0021 ] 将所述全局索引号划分成高H位和低L位两部分,其中,L+H = Z,所述Z为预设的所述全局索引号的二进制位数; [0021] The global index into the high H and low L bits bits in two parts, wherein, L + H = Z, the Z is the number of bits of a predetermined number of global index;

[0022] 对于所述全局索引号的高H位,通过预设的第二哈希函数进行哈希计算,利用所得到的哈希值查找所述全局集合映射表,得到所述元数据集合W的位置信息;根据所述元数据集合W的位置信息,查到所述元数据集合W ; [0022] For the global index of the high number of H bits hashed by a predetermined second hash function, the hash value obtained using the mapping table to find the global collection, to obtain a set of metadata W position information; W is set according to the location information of the metadata, the metadata found in the set W;

[0023] 对于所述全局索引号的低L位,通过预设的第三哈希函数进行哈希计算,将所得到哈希值作为所述索引节点位置D。 [0023] For the global index lower L bits hashed by a predetermined third hash function, the resulting hash value as the index node position D.

[0024] 这里,所述H和L的设置可由本领域人员根据实际需要进行设置,较佳地,可以是:H = 16,L = 16。 [0024] Here, the H and L are provided by one skilled in the art in accordance with actual needs, preferably, it is: H = 16, L = 16.

[0025] 较佳地,将所述文件的元数据保存在所述元数据服务器S」中具体可以为: [0025] Preferably, the file metadata stored in the metadata server S 'may be specifically:

[0026] 元数据服务器S_i在索引节点位置D上分配索引节点,并将所述文件的元数据保存在本服务器中的所述索引节点位置D的索引节点中; Inode [0026] The metadata server S_i allocated inodes in the inode position D, and the metadata stored in this file server in the index node D in position;

[0027] 元数据服务器S_i在自身保存的所述全局集合映射表中记录所述元数据的全局索引号与所述元数据集合W的位置的映射关系; [0027] The metadata server S_i stored by the global set of mapping table records the mapping relationship between the position of the global index of the metadata of the metadata set W;

[0028] 元数据服务器S_i在自身保存的该元数据集合W的元数据映射表中记录所述元数据的全局索引号与所述元数据的索引节点的映射关系。 [0028] The meta data server node S_i record mapping relationship between global index number of the index of the metadata with the metadata in its own set of metadata stored in the metadata W mapping table.

[0029] 进一步地,还可以通过为各元数据集合建立副本的方式,实现数据的备份,以确保数据的安全和完整性,具体地,所述步骤101中可进一步包括: [0029] Further, it may also be set by way of a copy for each of the metadata, data backup, in order to ensure the security and integrity of data, in particular, the step 101 may further comprise:

[0030] 所述分布式文件系统为所述M个元数据集合分别建立副本集合,并按照负载均衡的原则,将所述M个元数据集合的副本集合设置在所述元数据服务集群中的各元数据服务器中,并确保所述元数据集合与其副本集合所在元数据服务器不相同,所述各元数据服务器中分别保存一集合原副本映射表,所述集合原副本映射表用于保存设置在本服务器中的各元数据集合和其副本集合所在元数据服务器的映射关系,以及设置在本服务器中的各副本集合与其对应的各元数据集合原本所在元数据服务器的映射关系。 [0030] The distributed file system is a set of metadata of the M are set to make a copy, and a copy of the principle of load balancing, the M sets of metadata in the metadata set disposed within a cluster each metadata server, and to ensure that its set of metadata where the metadata server replica set are not the same, the respective metadata server are stored a copy of the original set of mapping table, a copy of the original set of mapping tables is provided for storing each set of metadata corresponding to each copy of the mapping between the data set for each element present in the server, and where a copy of the metadata collection server, and this server is provided in the original set where the mapping relationship metadata server.

[0031] 在建立元数据集合时为其建立副本集合后,后续进行文件的存储、访问等操作的时,也需要对副本集合进行同步操作,以确保数据的一致性。 [0031] After establishing a set of metadata for the establishment of a copy of the collection, the subsequent conduct file storage, access and other operations, but also need to copy a set of synchronization operations to ensure data consistency. 具体地,步骤102中进行文件的保存时,还需要执行如下步骤: Specifically, the step 102 to save the file, but also need to perform the steps of:

[0032] 所述元数据服务器S_i根据自身保存的集合原副本映射表,确定所述元数据集合W的副本集合所在的元数据服务器W_copy,触发所述元数据服务器W_copy在所述元数据集合W的副本集合中保存所述文件的元数据。 [0032] The metadata stored in the server according to its own set of S_i original copy of the mapping table to determine the copy of the metadata server W_copy set of metadata where W is set to trigger the metadata server W_copy in the metadata set W saving a copy of the file in the set of metadata.

[0033] 这里,在副本集合中保存元数据的具体方法同前述对其原集合的元数据保存方法相同,即存放副本集合的元数据服务器也需要维护一个副本集合与其所包含元数据的全局索引号的映射表、一个副本集合中的索引节点地址与文件全局索引号的映射表,进行副本集合的保存时,则需要在这些映射表上记录相应的信息。 Specific Method [0033] Here, to save a copy of the metadata set with the meta data storage method thereof is the same as the original set, i.e., set to store a copy of the metadata server also need to maintain a copy of the global index of the set of metadata they contain when the number mapping table, a copy of the set of address mapping table and the file inode global index number, to save a copy of the set, the corresponding information to be recorded on the map.

[0034] 进一步地,客户端将文件保存在分布式文件系统中后,可以根据需要对文件进行访问,此时,也需要对该文件的元数据进行相应的处理操作,具体地,可利用下述方法实现对元数据的访问: After [0034] Furthermore, the client file in a distributed file system, the file can be accessed as needed, at this time, need to perform corresponding processing operation to the metadata file, specifically, by the following said method enabling access to metadata:

[0035] 当客户端需要请求访问指定的文件F时,将所述请求发送给所述元数据服务集群中的任一元数据服务器A,所述请求中携带所述文件F的全局索引号ino和请求访问的类型; [0035] When the file F needs to request access to the specified client, and transmits the data request to one yuan the metadata service server A cluster according to any of the global request carries the index number ino and the file F type of access request;

[0036] 所述元数据服务器A根据所述全局索引号ino,确定所述文件F的元数据所属的元数据集合J,根据自身保存的所述全局集合映射表,确定所述元数据集合J所在的元数据服务器S_J,如果该元数据服务器S_J是本服务器,则根据所述请求访问的类型、所述全局索引号ino和自身保存的所述元数据集合J的元数据映射表,访问所述文件F的元数据并执行相应的处理操作,并根据自身保存的所述集合原副本映射表,确定所述元数据集合J的副本集合所在的元数据服务器,将所述处理操作同步到该元数据服务器上的所述元数据集合J的副本集合上;否则,所述元数据集合J所在的元数据服务器S_J通知给所述客户端,触发所述客户端向所述元数据服务器S_J发送所述请求,所述元数据服务器S_J根据所述请求访问的类型、所述全局索引号ino和自身保存的所述元数据集合J的元 [0036] The meta data server based on the global index A number iNO, the metadata of the determined metadata file F set J belongs, according to its own set of global map stored in the table to determine the set of metadata J S_J metadata server is located, if the metadata server are S_J server, based on the type of the access request, the global metadata index stored by itself ino and the metadata mapping table J set, access to the said metadata file F and execute the corresponding processing operation, and a copy of the original set in accordance with the mapping table saved by itself, the metadata server determines the set of metadata J where the replica set, to synchronize the operation of the process set on the copy of the metadata on the metadata server set J; otherwise, the set of metadata metadata server resides S_j J notifies the client, the client sends a trigger to the metadata server S_j the request, the metadata server S_J according to the type of the access request, and the global index ino own set of metadata stored in the metadata J 据映射表,访问所述文件F的元数据并执行相应的处理操作,并根据自身保存的所述集合原副本映射表,确定所述元数据集合J的副本集合所在的元数据服务器,将所述处理操作同步到该元数据服务器上的所述元数据集合J的副本集合上。 According to the mapping table, accessing the metadata and the file F performs a corresponding processing operation, and a copy of the original set in accordance with the mapping table saved by itself, a copy of the metadata server determines the metadata set where the set J, The said processing operation to synchronize the metadata server the metadata set J is the replica set.

[0037] 这里,根据所述全局索引号ino,确定所述文件F的元数据所属的元数据集合J的具体方法,同前所述。 [0037] Here, according to the global index number iNO, the specific method of determining metadata for the associated metadata file F is a set of J, before the same.

[0038] 根据所述请求访问的类型、所述全局索引号ino和自身保存的所述元数据集合J的元数据映射表,访问所述文件F的元数据具体可以为: [0038] The type of the access request, and the global index ino own set of metadata stored in the metadata mapping table of J, F accessing the file metadata may specifically be:

[0039] 以元数据集合J的元数据映射表为哈希表,以所述全局索引号ino的低L位为所述第三哈希函数的参数,进行哈希计算,利用所得到的哈希值查找所述元数据映射表,得到所述文件F的元数据对应的索引节点的位置,基于该位置即可查找到所述文件F的元数据,并可根据所述请求访问的类型进行相应的操作。 [0039] In the set of metadata J metadata mapping table is a hash table to the lower L bits of the global index ino the third parameter is a hash function, the hash is calculated, using the obtained Ha Xi value lookup the metadata mapping table to obtain the location of the metadata file F corresponding inode, can be found based on the location of the metadata file F, and according to the type of the access request corresponding operation. 具体访问类型及相应的处理操作同现有系统,在此不再赘述。 Particular type of access and corresponding processing operations with existing systems, are not repeated here.

[0040] 较佳地,所述分布式文件系统的元数据服务集群中可以预设一协调服务器,该协调服务器可以通过定期地发送心跳信息,对所述元数据服务集群中的各元数据服务器进行监测,以便即时获知出故障的元数据服务器,进而可以及时进行故障处理,确保分布式文件系统对元数据保存的完整性。 [0040] Preferably, the metadata service cluster distributed file system server may be preset a coordinator, the coordinator server may periodically send heartbeat information, the metadata for each metadata service server cluster monitoring in order to get real-time metadata server failure, in turn, can be timely troubleshooting to ensure distributed file system metadata stored integrity. 具体方法如下: Specific methods are as follows:

[0041] 当所述协调服务器监测到任一元数据服务器B出现故障时,将所述故障信息通知给所述元数据服务集群中除所述元数据服务器B之外的其他各元数据服务器; [0041] When the coordinate data server B when one yuan server failure monitoring arrival, notifies the fault information to the metadata of each other cluster service metadata server in addition to the metadata server B;

[0042] 接收到所述通知的各元数据服务器,根据所述通知和自身保存的所述集合原副本映射表,判断自身是否保存了所述元数据服务器B上的元数据集合的副本集合,如果是,则根据负载平衡的原则,从其他未出现故障的其他元数据服务器中确定用于保存所述副本集合的新的元数据服务器,触发所述新的元数据服务器对所述副本集合进行保存,并将所述副本集合作为其对应的集合原本设置在本服务器中。 [0042] Each metadata server receives the notification, according to the notification and locally stored copy of the original set of mapping table, judging whether to save a copy of the metadata on the metadata collection server set B, If so, then according to the principles of load balancing, fault does not occur is determined from other additional metadata server for new metadata server saves a copy of the set of triggering the new copy of the metadata collection server saving, and the replica set as its corresponding original set provided in the present server.

[0043] 较佳地,所述M个元数据集合以及其副本集合也可由上述协调服务器建立。 [0043] Preferably, the set M as well as a copy of the metadata collection may also be established above the coordinator server.

[0044] 较佳地,可通过在元数据服务集群中的元数据服务器中采用选举方法选举出的一个元数据服务器,作为所述协调服务器。 [0044] Preferably, the metadata service by cluster metadata server using a voting method elected metadata server, as the coordinator server. 所述协调服务器是一服务例程,其本身不保存元数据信息,其接受元数据服务器注册,并通过元数据服务器的注册信息动态生成元数据服务器集群的状态信息。 The coordinator server is a service routine itself does not save metadata information, metadata server that accepts registration and state information dynamically generated by the metadata server cluster information metadata registration server. 较优地,从部署的角度上看,此协调服务器可与任意一个元数据服务器共用同一硬件服务器。 Jiaoyou manner, from the perspective of the deployment point of view, this server may share the same hardware coordination server with any one metadata server.

[0045] 从上述技术方案中可以看出,采用本发明可以确保并发访问下元数据的一致性、并发访问下集群的负载均衡、单个元数据节点出现故障时,元数据完整性以及元数据访问时的信息同步问题,从而可以满足大量客户端并发访问的需求,实现基于服务器集群对分布式文件系统中元数据的有效管理。 [0045] As can be seen from the above technical solution, the present invention can ensure the consistency of the metadata has concurrent access, concurrent load balancing cluster access, a single metadata node fails, the integrity of metadata and metadata access information synchronization problems, so that clients can meet a large number of concurrent access needs and achieve effective management of distributed file system based on the metadata server cluster. [0046] 综上所述,以上仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。 [0046] In summary, the foregoing is only preferred embodiments of the present invention but are not intended to limit the scope of the present invention. 凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 Any modification within the spirit and principle of the present invention, made, equivalent substitutions, improvements, etc., should be included within the scope of the present invention.

Claims (9)

1.一种分布式文件系统的元数据管理方法,其特征在于,该方法包括以下步骤: a、分布式文件系统预先建立M个元数据集合,根据预设的第一哈希函数,采用哈希散列的方式将所述元数据集合分散设置在元数据服务集群中的各元数据服务器中;所述元数据服务器各自保存一份全局集合映射表,所述全局集合映射表用于记录本服务器中设置的各元数据集合与其包含的元数据的映射关系以及所有未设置在本服务器中的各元数据集合与其所属元数据服务器的映射关系; b、当客户端向元数据服务集群中的一个元数据服务器S_1请求保存文件时,所述元数据服务器3_1为所述文件分配一个全局索引号,并根据该全局索引号,采用哈希散列的方式,确定所述文件的元数据所属的元数据集合W,以及该元数据存放在所述元数据集合W中的索引节点位置D,所述元数据服务 Metadata management method for distributed file system, wherein, the method comprising the steps of: a, a distributed file system metadata a pre-established set of M, according to a predetermined first hash function, using Ha Greek way hashing the set of metadata for each metadata server dispersed metadata service provided in the cluster; each of the metadata server to keep a global collection mapping table, the mapping table for recording a global collection of the present data sets each element server provided in its mapping relationship metadata and all data sets of each element is not provided in the present server included in it belongs mapping relationship metadata server; b, when a client, a metadata service cluster when a metadata request for metadata server S_1 save the file, the metadata file server assigns a globally 3_1 the index number, and based on the global index, using hashes manner, determining the file belongs set of metadata W, and the metadata stored in the metadata index node set W in position D, the metadata service S_1根据自身保存的全局集合映射表确定所述元数据集合W所在的元数据服务器S_i,触发所述元数据服务器S_i将所述文件的元数据保存在所述元数据服务器S_i中; 步骤b中所述确定所述文件的元数据所属的元数据集合W,以及该元数据存放在所述元数据集合W中的索引节点位置D为: 将所述全局索引号划分成高H位和低L位两部分,其中,L+H = Z,所述Z为预设的所述全局索引号的二进制位数; 对于所述全局索引号的高H位,通过预设的第二哈希函数进行哈希计算,利用所得到的哈希值查找所述全局集合映射表,得到所述元数据集合W的位置信息;根据所述元数据集合W的位置信息,查到所述元数据集合W ; 对于所述全局索引号的低L位,通过预设的第三哈希函数进行哈希计算,将所得到哈希值作为所述索引节点位置D。 S_1 according to its own set of global map stored metadata server determines the set of metadata S_i where W, triggers the metadata server S_i the file metadata stored in the metadata server S_i; and step b W the set of metadata of the determined metadata file belongs and the metadata stored in the metadata index node in set W to position D: the global index into the high H and low L bits two bit part, wherein, L + H = Z, Z the number of bits of a predetermined number of the global index; for the global index height H bits by a predetermined second hash function hashing the hash values ​​obtained using the mapping table to find the global set, obtain location information of the metadata set W; according to the position information of the metadata set W, W found in the set of metadata; for the global index lower L bits hashed by a predetermined third hash function, the hash value of the node position obtained as the index D.
2.根据权利要求1所述的方法,其特征在于,步骤b中将所述文件的元数据保存在所述元数据服务器S_i中包括: 元数据服务器S_i在索引节点位置D上分配索引节点,并将所述文件的元数据保存在本服务器中的所述索引节点位置D的索引节点中; 元数据服务器S_i在自身保存的所述全局集合映射表中记录所述元数据的全局索引号与所述元数据集合W的位置的映射关系; 元数据服务器S_i在自身保存的该元数据集合W的元数据映射表中记录所述元数据的全局索引号与所述元数据的索引节点的映射关系。 2. The method according to claim 1, wherein step b in the metadata of the files stored in the metadata server S_i includes: the metadata server S_i allocated inodes in the inode position D, the inode position index node D and the metadata file stored in the server in the present; S_i metadata server itself stored in the global set of mapping table recording a global index of the metadata and mapping relationship between the position of the metadata set W; metadata server inode S_i record the metadata in its own set of metadata stored in the metadata mapping table W, the global index of the metadata mapping relationship.
3.根据权利要求1所述的方法,其特征在于,所述步骤a中进一步包括: 所述分布式文件系统为所述M个元数据集合分别建立副本集合,并按照负载均衡的原则,将所述M个元数据集合的副本集合设置在所述元数据服务集群中的各元数据服务器中,并确保所述元数据集合与其副本集合所在元数据服务器不相同,所述各元数据服务器中分别保存一集合原副本映射表,所述集合原副本映射表用于保存设置在本服务器中的各元数据集合和其副本集合所在元数据服务器的映射关系以及设置在本服务器中的各副本集合与其对应的各元数据集合原本所在元数据服务器的映射关系。 3. The method according to claim 1, wherein said step a further comprises: the distributed file system is a set of metadata of the M replica set are established, and in accordance with the principles of load balancing, the each metadata server copy of the M sets of metadata in the metadata set disposed within a cluster and ensure that its set of metadata where the metadata server replica set are not the same, the respective metadata server save a copy of the original set of each mapping table, the mapping table set for each copy of the original copy of the data set where each member of the set is provided in this element stored in the server and copies the data server mapping relationship and disposed in this collection server each meta data set corresponding original location mapping between the metadata server.
4.根据权利要求3所述的方法,其特征在于,所述步骤b中进一步包括: 所述元数据服务器S_i根据自身保存的集合原副本映射表,确定所述元数据集合W的副本集合所在的元数据服务器,触发所述所在的元数据服务器在所述元数据集合W的副本集合中保存所述文件的元数据。 4. The method according to claim 3, wherein said step (b) further comprises: according to the metadata server S_i locally stored copy of the original set of mapping table, a copy of the metadata to determine a set of set W where the metadata server, metadata trigger the server where the file metadata stored in the copy set of metadata set W's.
5.根据权利要求4所述的方法,其特征在于,所述方法进一步包括: 当客户端需要请求访问指定的文件F时,将所述请求发送给所述元数据服务集群中的任一元数据服务器A,所述请求中携带所述文件F的全局索引号ino和请求访问的类型; 所述元数据服务器A根据所述全局索引号ino,确定所述文件F的元数据所属的元数据集合J,根据自身保存的所述全局集合映射表,确定所述元数据集合J所在的元数据服务器S_J,如果该元数据服务器S_J是本服务器,则根据所述请求访问的类型、所述全局索引号ino和自身保存的所述元数据集合J的元数据映射表,访问所述文件F的元数据并执行相应的处理操作,并根据自身保存的所述集合原副本映射表,确定所述元数据集合J的副本集合所在的元数据服务器,将所述处理操作同步到该元数据服务器上的所述元数据集合J的副本集合 5. The method as claimed in claim 4, wherein said method further comprises: when a client needs to request access to a file designated F., To either send the request to the service metadata of one metadata cluster server a, the request carries the type of the file F and a global index ino requesting access; the metadata server a ino accordance with the global index, the metadata of the determined metadata of the file F is set belongs J, according to its own set of global map stored in the table to determine the set of metadata metadata server S_J J where, if the metadata server S_j server is present, based on the type of the access request, the global index ino own number and set of metadata stored in the metadata mapping table J, F accessing the file metadata and performs a corresponding processing operation, and a copy of the original set in accordance with the mapping table saved by itself, determining that the element J metadata server data set where a copy of the set, the processing operation to synchronize the metadata on the metadata server replica set of set J ;否则,所述元数据集合J所在的元数据服务器S_J通知给所述客户端,触发所述客户端向所述元数据服务器S_J发送所述请求,所述元数据服务器S_J根据所述请求访问的类型、所述全局索引号ino和自身保存的所述元数据集合J的元数据映射表,访问所述文件F的元数据并执行相应的处理操作,并根据自身保存的所述集合原副本映射表,确定所述元数据集合J的副本集合所在的元数据服务器,将所述处理操作同步到该元数据服务器上的所述元数据集合J的副本集合上。 ; Otherwise, the metadata server S_j set of metadata resides J notifies the client, the client sends the triggering request to the server S_j metadata, the metadata request according to the access server S_j type, and the global index of the metadata ino locally stored set of metadata mapping table J, F accessing the file metadata and executes the corresponding processing operations, according to a copy of the original set and stored in itself the mapping table, the metadata server determines the set of metadata J where the replica set, the processing operation will be synchronized to the replica set of the metadata on the metadata server of the set J.
6.根据权利要求4所述的方法,其特征在于,所述方法进一步包括: 所述元数据服务集群中预设一协调服务器,所述协调服务器通过发送心跳信息,对所述元数据服务集群中的各元数据服务器进行监测; 当所述协调服务器监测到任一元数据服务器B出现故障时,将所述故障信息通知给所述元数据服务集群中除所述元数据服务器B之外的其他各元数据服务器; 接收到所述通知的各元数据服务器,根据所述通知和自身保存的所述集合原副本映射表,判断自身是否保存了所述元数据服务器B上的元数据集合的副本集合,如果是,则根据负载平衡的原则,从其他未出现故障的其他元数据服务器中确定用于保存所述副本集合的新的元数据服务器,触发所述新的元数据服务器对所述副本集合进行保存,并将所述副本集合作为其对应的集合原本设置在本服务器中。 6. The method as claimed in claim 4, wherein said method further comprises: a preset metadata of the service server cluster coordinator, the coordinator server by sending a heartbeat message, the service metadata cluster in each of the metadata server monitor; when one yuan when the coordinate data server B fails to monitor the arrival of the server, notifies the fault information to the other cluster service metadata other than the metadata server B each metadata server; each metadata server receives the notification, according to the notification and the locally stored copy of the original set of mapping table, judging whether to save a copy of the metadata on the metadata collection server B set, if so, load balancing based on the principle of determining a new metadata server storing the replica set from other without failure other metadata server triggers the new copy of the metadata server save set, and the set of the corresponding replica set as provided in the present original server.
7.根据权利要求1所述的方法,其特征在于,所述M个元数据集合由所述分布式文件系统中预设的一协调服务器建立。 7. The method according to claim 1, wherein said M predetermined set of metadata by the distributed file system server to establish a coordination.
8.根据权利要求2所述的方法,其特征在于,所述M个元数据集合的副本集合由所述分布式文件系统中预设的一协调服务器建立。 8. The method according to claim 2, wherein the M copies of the set of predetermined set of metadata by the distributed file system server to establish a coordination.
9.根据权利要求6、7或8所述的方法,其特征在于,所述协调服务器为在元数据服务集群中的元数据服务器中通过选举方法选举出的一个元数据服务器。 9. The method of claim 6, 7 or claim 8, wherein the metadata server coordinating metadata service server cluster elected in the election by the method of one metadata server.
CN 201110454262 2011-12-30 2011-12-30 Metadata management method of distributed file system CN102411637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110454262 CN102411637B (en) 2011-12-30 2011-12-30 Metadata management method of distributed file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110454262 CN102411637B (en) 2011-12-30 2011-12-30 Metadata management method of distributed file system

Publications (2)

Publication Number Publication Date
CN102411637A CN102411637A (en) 2012-04-11
CN102411637B true CN102411637B (en) 2013-07-24

Family

ID=45913708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110454262 CN102411637B (en) 2011-12-30 2011-12-30 Metadata management method of distributed file system

Country Status (1)

Country Link
CN (1) CN102411637B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694863B (en) * 2012-05-30 2015-08-26 电子科技大学 Implementation based distributed storage system and the load regulation system fault tolerance
CN103544156B (en) * 2012-07-10 2019-04-09 腾讯科技(深圳)有限公司 File memory method and device
CN102855284B (en) * 2012-08-03 2016-08-10 北京联创信安科技股份有限公司 The data managing method of a kind of cluster storage system and system
CN103631820B (en) * 2012-08-27 2017-09-12 阿里巴巴集团控股有限公司 The metadata management method and equipment of distributed file system
CN103778120B (en) * 2012-10-17 2018-01-16 腾讯科技(深圳)有限公司 Global profile mark generating method, generating means and corresponding distributed file system
CN103095687B (en) * 2012-12-19 2015-08-26 华为技术有限公司 Metadata processing method and apparatus
CN103106286B (en) * 2013-03-04 2017-02-01 曙光信息产业(北京)有限公司 Method and device for managing metadata
CN103218404B (en) * 2013-03-20 2015-11-18 华中科技大学 Multidimensional metadata management method and a system based on the association properties
CN103324466B (en) * 2013-05-24 2017-05-03 浪潮电子信息产业股份有限公司 Data dependency serialization IO parallel processing method
CN103559224A (en) * 2013-10-18 2014-02-05 华为技术有限公司 Method and device for hashing metadata objects
CN104866497B (en) * 2014-02-24 2018-06-15 华为技术有限公司 The metadata updates method, apparatus of distributed file system column storage, host
CN103793534B (en) * 2014-02-28 2017-09-08 苏州博纳讯动软件有限公司 Distributed file system and balanced metadata storage and the implementation method for accessing load
CN104657115B (en) * 2015-03-12 2017-04-19 浪潮集团有限公司 Cluster file system client-side multi-core concurrence and load implementation method
CN106326239A (en) * 2015-06-18 2017-01-11 阿里巴巴集团控股有限公司 Distributed file system and file meta-information management method thereof
CN105005588B (en) * 2015-06-26 2018-04-20 深圳市腾讯计算机系统有限公司 A kind of processing method and processing device of training data

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692239A (en) 2009-10-19 2010-04-07 浙江大学 Method for distributing metadata of distributed type file system
CN101957861A (en) 2010-10-18 2011-01-26 江苏大学 Novel metadata server cluster and metadata management method based on reconciliation statement

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692239A (en) 2009-10-19 2010-04-07 浙江大学 Method for distributing metadata of distributed type file system
CN101957861A (en) 2010-10-18 2011-01-26 江苏大学 Novel metadata server cluster and metadata management method based on reconciliation statement

Also Published As

Publication number Publication date
CN102411637A (en) 2012-04-11

Similar Documents

Publication Publication Date Title
Stribling et al. Flexible, Wide-Area Storage for Distributed Systems with WheelFS.
US9135269B2 (en) System and method of implementing an object storage infrastructure for cloud-based services
CN102014158B (en) Cloud storage service client high-efficiency fine-granularity data caching system and method
US8805889B2 (en) Metadata structures and related locking techniques to improve performance and scalability in a cluster file system
US7546486B2 (en) Scalable distributed object management in a distributed fixed content storage system
US7653668B1 (en) Fault tolerant multi-stage data replication with relaxed coherency guarantees
KR101453425B1 (en) Metadata Server And Metadata Management Method
US20080046538A1 (en) Automatic load spreading in a clustered network storage system
US8849759B2 (en) Unified local storage supporting file and cloud object access
AU2014235433B2 (en) Fast crash recovery for distributed database systems
US7657581B2 (en) Metadata management for fixed content distributed data storage
CN101697168B (en) Method and system for dynamically managing metadata of distributed file system
US20050262097A1 (en) System for moving real-time data events across a plurality of devices in a network for simultaneous data protection, replication, and access services
US7590667B2 (en) File replication method for distributed file systems
US9893957B2 (en) Forward-based resource delivery network management techniques
US8918392B1 (en) Data storage mapping and management
CN102882983B (en) Rapid data memory method for improving concurrent visiting performance in cloud memory system
CN102591970B (en) Distributed key-value query method and query engine system
US9898514B2 (en) System and method for aggregating query results in a fault-tolerant database management system
US20090012932A1 (en) Method and System For Data Storage And Management
US8229893B2 (en) Metadata management for fixed content distributed data storage
CN103150394B (en) Distributed file system metadata management method facing to high-performance calculation
CN102143215A (en) Network-based PB level cloud storage system and processing method thereof
CN100568240C (en) Method and system for building a database from backup data images
US10331655B2 (en) System-wide checkpoint avoidance for distributed database systems

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model
CP03 Change of name, title or address