WO2017107984A1 - 一种数据恢复方法及装置 - Google Patents

一种数据恢复方法及装置 Download PDF

Info

Publication number
WO2017107984A1
WO2017107984A1 PCT/CN2016/111762 CN2016111762W WO2017107984A1 WO 2017107984 A1 WO2017107984 A1 WO 2017107984A1 CN 2016111762 W CN2016111762 W CN 2016111762W WO 2017107984 A1 WO2017107984 A1 WO 2017107984A1
Authority
WO
WIPO (PCT)
Prior art keywords
data block
file
target data
target
node
Prior art date
Application number
PCT/CN2016/111762
Other languages
English (en)
French (fr)
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 中兴通讯股份有限公司
Publication of WO2017107984A1 publication Critical patent/WO2017107984A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1461Backup scheduling policy

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to a data recovery method and apparatus.
  • the data disaster recovery system is an environment for computer information systems that can cope with various disasters.
  • Disaster tolerance systems when computer systems are subject to irresistible natural disasters such as fires, floods, earthquakes, wars, and man-made disasters such as computer crime, computer viruses, power outages, network/communication failures, hardware/software errors, and human error.
  • User data security will be guaranteed. Even a more complete disaster recovery system can provide uninterrupted application services.
  • HDFS Hadoop Distributed File System
  • HDFS can recover data from the backup server as soon as possible and provide services to reduce the interruption time of the service.
  • the present invention provides a data recovery method and apparatus for solving the problem that the service interruption time is too long when the HDFS system recovers data from the backup server in the prior art.
  • the invention discloses a data recovery method.
  • the method includes:
  • the adjusting, by the data node, the expected access time according to the requested attribute includes:
  • the method further includes:
  • the expected access time of the block information is the expected access time of the block information.
  • the method before downloading the metadata list and the data block list, the method further includes:
  • the operation threshold is set such that the service for operating the data can be externally provided when the data recovery operation is not completed; wherein the operation threshold is a ratio of the number of recovered data blocks to the number of all data blocks to be restored.
  • the method further includes:
  • Determining, according to the requested attribute information, that the request is to delete the file, searching for the target data node corresponding to the target data block information in the data block list, and using the remote procedure call to the target data The node sends a delete message; after the target data node receives the delete message, the information corresponding to the target data block information is deleted in the download queue of the data block.
  • the method further includes:
  • the invention also provides a data recovery device, comprising:
  • a list module configured to download a metadata list and a data block list when the distributed file system HDFS performs data recovery
  • a first search module configured to receive a request for accessing any target file, and search, in the metadata, the target data block information included in the target file according to the request;
  • a second searching module configured to: if the target data block information is not downloaded according to the download completion flag, search for attribute information of the target data block information in the data block list;
  • an adjustment module configured to acquire an expected access time of the target data block information from the attribute information, and adjust the expected access time according to the requested attribute.
  • the adjusting module is specifically configured to: when determining, according to the requested attribute information, that the request is to read any of the files, determine a minimum value between the expected access time and a current system time, The expected access time is adjusted to the minimum value such that the system recovers the target data block information using the adjusted expected access time.
  • the adjusting module is further configured to: after adjusting the expected access time to the minimum value, find a target data node corresponding to the target data block information in the data block list, by using a remote procedure call The target data node sends the adjustment information, so that the target data node updates the expected access time of the pre-stored target data block information according to the adjustment information.
  • the device further includes:
  • a recovery module configured to set an operation threshold before downloading the metadata list and the data block list, so that the data operation operation may be externally provided when the data recovery operation is not completed; wherein the operation threshold is a restored data block The number of copies of the total number of data blocks to be recovered.
  • the device further includes:
  • a deleting module configured to: when determining, according to the requested attribute information, that the request is to delete the file, searching for the target data node corresponding to the target data block information in the data block list, and using a remote procedure call Sending a deletion message to the target data node; after the target data node receives the deletion message, deleting information corresponding to the target data block information in a download queue of the data block.
  • the device further includes:
  • the downloading module is configured to maintain a priority queue for downloading a data block in the data node, and the data node extracts the block information with the smallest expected access time from the queue each time; and downloads the data block corresponding to the block information from the backup server.
  • the invention also discloses a method for recovering data on demand according to the distributed file system HDFS, comprising:
  • the priority queue of the data block file download is adjusted according to the request to preferentially restore the target data block file.
  • the step of adjusting the priority queue of the data block file download according to the request to preferentially restore the target data block file further includes:
  • the method further includes:
  • the step of adjusting the priority queue of the data block file download according to the request to preferentially restore the target data block file includes:
  • the method before the receiving the request for an object file, searching for the target file, the method further includes: downloading metadata from the backup server.
  • the method before the downloading the metadata from the backup server, the method further includes:
  • an operation threshold such that the service for operating the data may be externally provided when the method for restoring data on demand is not completed; wherein the operation threshold is the number of recovered data blocks occupying the total number of data blocks to be restored proportion.
  • the method further includes:
  • the data corresponding to the extracted data block file is downloaded from the backup server.
  • the present invention also discloses an apparatus for recovering data on demand according to the distributed file system HDFS, including:
  • a first lookup module configured to receive a request for an object file to find the target file
  • a determining module configured to determine whether the target data block file corresponding to the target file is downloaded after the target file is found
  • an adjustment module configured to adjust the priority queue of the data block file download according to the request to preferentially restore the target data block when the target data block file is not downloaded.
  • the adjustment module is further configured to:
  • the adjustment module is further configured to:
  • the target data node corresponding to the target data file is found in the mapping relationship, and the adjustment information is sent to the target data node by remote calling, so that the target data is obtained.
  • the node updates the expected access time of the pre-stored target data block file according to the adjustment information.
  • the adjustment module is further configured to:
  • the request is to delete the target file
  • searching for a target data node corresponding to the target data block file in a mapping relationship between the pre-stored data block file and the data node and sending the target data node to the target data node by using a remote procedure call Deleting the message, causing the target data node to delete the target data block file from the download queue of the target data node after receiving the request.
  • the device further includes a backup module, configured to: download metadata from the backup server.
  • a backup module configured to: download metadata from the backup server.
  • the device further includes a recovery module, configured to:
  • an operation threshold such that the service for operating the data may be externally provided when the on-demand recovery data is not completed; wherein the operation threshold is a ratio of the number of restored data blocks to the number of all data blocks to be restored.
  • the device further includes a downloading module, configured to:
  • the method and apparatus disclosed by the present invention first download and load metadata to start providing a file system service during downloading a data block; and save a list of data blocks to be downloaded in a name node and a data node; according to the client pair in the recovery process
  • the access requirements of the data block adjust the priority of the recovery, and the files accessed by the client are preferentially restored; the recovery process is abandoned for the files deleted by the client to save time; and the efficient distributed file system can be restored on demand.
  • FIG. 1 is a flowchart of a data recovery method according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a device which is practical according to a method provided by an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a method according to an embodiment of the present invention when used in a specific environment;
  • FIG. 4 is a schematic structural diagram of a data recovery apparatus according to an embodiment of the present invention.
  • an embodiment of the present invention provides a data recovery method, where the data recovery of the Hadoop distributed file system includes:
  • Step 101 Download a metadata list and a data block list.
  • the method further includes:
  • the operation threshold is set such that the service for operating the data can be externally provided when the data recovery operation is not completed; wherein the operation threshold is a ratio of the number of recovered data blocks to the number of all data blocks to be restored.
  • the operational threshold can be set to a minimum acceptable to the system, for example set to zero.
  • Step 102 Receive a request to access any target file, and search, in the metadata, the target data block information included in the target file according to the request.
  • Step 103 If the target data block information is found in the data block list, obtain a download completion flag corresponding to the target data block information.
  • Step 104 if it is determined that the target data block information is not downloaded according to the download completion flag, searching for attribute information of the target data block information in the data block list;
  • Step 105 Acquire an expected access time of the target data block information from the attribute information, and adjust the expected access time according to the requested attribute.
  • the specific implementation manner of adjusting the expected access time according to the requested attribute includes multiple types.
  • the following provides an optimized manner, which may specifically be:
  • the method further includes:
  • the expected access time of the block information is the expected access time of the block information.
  • the file deleted by the client can choose to abandon the recovery process to save data recovery time; and can realize efficient on-demand recovery of the distributed file system.
  • the specific implementation can be:
  • Determining, according to the requested attribute information, that the request is to delete the file, searching for the target data node corresponding to the target data block information in the data block list, and using the remote procedure call to the target data The node sends a delete message; after the target data node receives the delete message, the information corresponding to the target data block information is deleted in the download queue of the data block.
  • the specific downloading of the data block includes:
  • a function on the name node (NameNode) is called by the remote procedure to inform the name node that the information of the data block that has been downloaded has been completed, and the information of the data block may include the id of the data block and the generation. Flag, length; the name node NameNode sets the download completion flag of the corresponding data block to true.
  • the HDFS downloads data from the backup server, and then the name node (NameNode) and the data node (DataNode) in the HDFS process the downloaded data correspondingly, and the specific implementation includes:
  • the memory of the name node includes a list of all data blocks downloaded from the backup server, and the number of data nodes (DataNodes) is specified when the HDFS starts, and the NameNode distributes all the data blocks evenly to all DataNodes.
  • the NameNode sends the data block list assigned to the DataNode to it, and the NameNode stores a mapping relationship of the data block information to the DataNode in the memory (ie, Block-DataNode Map), the data block.
  • the information includes the id of the data block, the generated flag, the length, the download completion flag (default false), the expected access time (a long integer, the default is the longest long integer).
  • the specific implementation of downloading data from the backup server may be:
  • the data node stores a priority queue for data block download.
  • the data node takes out the data block with the smallest expected access time from the queue each time (the expected access time type is a long integer, and the expected access time for initializing all data blocks is the largest.
  • the long integer downloads the data block from the backup server.
  • a function on the name node is called by the remote procedure call to inform the name node that the downloaded data block has been downloaded, and the information includes the id of the data block.
  • Generate the flag, length, and the name node sets the download completion flag of the corresponding data block to true.
  • HDFS is started from the command line, specifying the recovery options, the file system name to be restored, and the number of data nodes.
  • the configuration file is preferably hdfs-backup.xml.
  • the configuration file is stored in $HADOOP/etc/hadoop/hdfs-backup.xml. You need to configure the address port of the backup server.
  • the HDFS system executes the recovery command to start, specifying the recovery option -recoverFromBackup, the name of the file system to be restored, and the number of data nodes.
  • the name node downloads the compressed file of the metadata from the backup server to the local, and loads the file into the memory to obtain the metadata of the file system, that is, the directory tree of the file system; at the same time, the name node obtains the file system from the backup server.
  • HDFS is in the file system by default.
  • the HDFS file system is in safe mode. Only files are supported at this time.
  • the system directory tree does not support the modification of the file system and the reading of the file; in order to provide a complete service to the external file even if all the data blocks in the file system are not downloaded, in this embodiment
  • the threshold can be set to 0.
  • the data node is registered with the name node after it is started.
  • the name node assigns a list of data blocks to be downloaded to the DataNode upon registration.
  • the data node downloads the data in the list from the backup server.
  • the memory of the name node includes a list of all data blocks downloaded from the backup server, and the number of data nodes is specified when the HDFS is started, and the name node distributes all the data blocks evenly to all the data nodes, that is,
  • the name node sends the data block list assigned to the data node to it, and the name node stores a mapping relationship of the data block information to the data node in the memory (ie, the data block list: Block-DataNode Map)
  • the data block information includes the data block id, generated flag, length, download completion flag (default false), expected access time (a long integer, the default is the longest long integer).
  • the data node stores a priority queue for downloading the data block, and the data node takes out the block with the smallest expected access time from the queue each time (the expected access time type is a long integer, and the expected access time for initializing all the data blocks is The largest long integer) downloads the data block from the backup server.
  • the remote procedure call After the download is completed, a function on the name node is called by the remote procedure call to inform the name node that the downloaded data block has been downloaded, including the id of the data block. Generate the flag, length, and the name node sets the download completion flag of the corresponding data block to true.
  • the specific method further includes:
  • Step 301 the client reads or deletes any file.
  • Step 302 Find a data block list corresponding to the any file in the metadata.
  • Step 303 searching for a data block update expected access time or deleting a data block in the data block list, concurrently Send instructions to the corresponding data node;
  • Step 304 the data node updates the corresponding expected access time or deletes the corresponding data block according to the instruction of the name node;
  • the data node downloads the data, it is based on a preset priority queue, and the preset priority queue is a priority queue sorted by the expected access time.
  • Step 305 The data nodes download the data blocks one by one according to the order in the modified priority queue.
  • the client sends an open file command to the name node; the name node finds the data block to be read included in the file in the metadata in the memory, and searches for the data block to be read in the Block-DataNode Map, if not found, Then, the data block to be read is a newly created file after startup, and then normal read and write operations are performed; otherwise, the value of the download completion flag of the data block is checked. If the download completion flag of all data blocks is true (indicating that the download has been completed), normal read and write operations are performed.
  • Block download error is returned to the client, requesting the client to access the file later; meanwhile, look up in the Block-DataNode Map
  • the information of the data block, the minimum of the current system time and the expected access time of the data block is set as the expected access time of the data block, and if the expected access time of the data block changes, it is found in the Block-DataNode Map. Its corresponding data node sends information to the data node through a remote procedure call, updating the expected access time of the data block.
  • the client sends a delete file command to the name node; the name node finds the data block contained in the file in the metadata in the memory, and searches for the data block in the Block-DataNode Map. If not found, the deletion is After the startup, the newly created file is used for the normal deletion operation; otherwise, the normal deletion metadata operation is performed, and the value of the download completion flag of the included data block is checked; for the data block whose download completion flag is true, the normal deletion operation is performed.
  • the data node corresponding to the data block is searched in the Block-DataNode Map, and the delete message is sent to the data node through the remote procedure call; if the data node receives the message, if there is a download queue The data block deletes the data block from the download queue of the data block.
  • the method provided by the embodiment of the present invention first downloads and loads the metadata to start providing the file system service in the process of downloading the data block; and saves the data block list to be downloaded in the name node and the data node; according to the client pair in the recovery process
  • the access requirement of the data block adjusts the priority of the recovery, and the file accessed by the client is preferentially restored; the recovery process is abandoned for the file deleted by the client to save time; and an efficient distributed file can be realized.
  • the system recovers as needed.
  • an embodiment of the present invention further provides a data recovery apparatus, where the apparatus includes:
  • a list module 401 configured to download a metadata list and a data block list when the distributed file system HDFS performs data recovery
  • the first searching module 402 is configured to receive a request for accessing any target file, and search, in the metadata, the target data block information included in the target file according to the request;
  • the obtaining module 403 is configured to: if the target data block information is found in the data block list, obtain a download completion flag corresponding to the target data block information;
  • a second searching module 404 configured to: if the target data block information is not downloaded according to the download completion flag, search for attribute information of the target data block information in the data block list;
  • the adjusting module 405 is configured to obtain an expected access time of the target data block information from the attribute information, and adjust the expected access time according to the requested attribute.
  • the adjusting module 405 is specifically configured to: when determining, according to the requested attribute information, that the request is to read the file, determine a minimum value of the expected access time and a current system time, The expected access time is adjusted to the minimum value such that the system recovers the target data block information using the adjusted expected access time.
  • the adjusting module 405 is further configured to: after adjusting the expected access time to the minimum value, find a target data node corresponding to the target data block information in the data block list, by using a remote procedure call The target data node sends the adjustment information, so that the target data node updates the expected access time of the pre-stored target data block information according to the adjustment information.
  • the device further includes:
  • a recovery module configured to set an operation threshold before downloading the metadata list and the data block list, so that the data operation operation may be externally provided when the data recovery operation is not completed; wherein the operation threshold is a restored data block The number of copies of the total number of data blocks to be recovered.
  • the file to be deleted by the client may choose to abandon the recovery, and the device further includes:
  • a deleting module configured to: when determining, according to the requested attribute information, that the request is to delete the file, searching for the target data node corresponding to the target data block information in the data block list, and using a remote procedure call Sending a deletion message to the target data node; after the target data node receives the deletion message, deleting information corresponding to the target data block information in a download queue of the data block.
  • the device further includes:
  • the downloading module is configured to maintain a priority queue for downloading a data block in the data node, and the data node extracts the block information with the smallest expected access time from the queue each time; and downloads the data block corresponding to the block information from the backup server.
  • the storage medium may be a ROM/RAM, a magnetic disk, an optical disk, or the like.
  • the present invention provides a non-transitory computer readable storage medium having stored therein instructions that, when executed by one or more processors in a data recovery device, perform a data recovery method,
  • the method includes: receiving a request for an object file, searching for the target file; determining, if the target file is found, determining whether the target data block file corresponding to the target file is downloaded; and the target data block
  • the priority queue of the data block file download is adjusted according to the request to preferentially restore the target data block file.
  • the method and apparatus disclosed by the present invention first download and load metadata to start providing a file system service during downloading a data block; and save a list of data blocks to be downloaded in a name node and a data node; according to the client pair in the recovery process
  • the access requirements of the data block adjust the priority of the recovery, and the files accessed by the client are preferentially restored; the recovery process is abandoned for the files deleted by the client to save time; and the efficient distributed file system can be restored on demand.
  • the modules or units in the data recovery device may pass through one or more digital signal processors (DSPs), application specific integrated circuits (ASICs), processors, microprocessors, controllers, and microcontrollers.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs Real-time programmable arrays
  • programmable logic devices or other electronic units, or any combination thereof.
  • the present invention relates to the field of data processing technologies, and can solve the problem that the service interruption time is too long when the HDFS system recovers data from the backup server in the prior art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种数据恢复方法及装置,当分布式文件系统HDFS进行数据恢复时,该方法包括:下载元数据列表和数据块列表(101);接收访问任一目标文件的请求,根据所述请求在所述元数据中查找所述目标文件所包含的目标数据块信息(102);若在数据块列表中查找到所述目标数据块信息,则获取所述目标数据块信息对应的下载完成标志(103);若根据所述下载完成标志确定所述目标数据块信息未下载完成,则在所述数据块列表中查找所述目标数据块的属性信息(104);从所述属性信息中获取所述目标数据块信息的预期访问时间,并根据所述请求的属性调整所述预期访问时间(105)。

Description

一种数据恢复方法及装置 技术领域
本发明涉及数据处理技术领域,尤其涉及一种数据恢复方法及装置。
背景技术
随着大数据时代的到来,数据信息日益重要,数据保护问题日渐突出。数据保护、数据的容灾是非常重要的话题。
据统计,导致系统出现问题的原因分布比例一般为:硬件故障占44%、人为错误占32%、软件故障占14%、病毒影响占7%、自然灾难占3%。数据容灾系统,就是为计算机信息系统提供的一个能应付各种灾难的环境。当计算机系统在遭受如火灾、水灾、地震、战争等不可抗拒的自然灾难以及计算机犯罪、计算机病毒、掉电、网络/通信失败、硬件/软件错误和人为操作错误等人为灾难时,容灾系统将保证用户数据的安全性。甚至,一个更加完善的容灾系统,还能提供不间断的应用服务。
Hadoop分布式文件系统(Hadoop distributed filesystem,简称HDFS)被设计成适合运行在通用硬件上的分布式文件系统。它和现有的分布式文件系统有很多共同点。但同时,它和其他的分布式文件系统也有很明显的区别。HDFS是一个高度容错性的系统,适合部署在廉价的机器上。HDFS能提供高吞吐量的数据访问,非常适合大规模数据集上的应用。
随着HDFS的使用越来越普遍,如何把HDFS中的大量数据快速准确地备份到远端服务器,并且能够在指定的集群上迅速恢复成为了一个显著问题。
在系统损坏恢复过程中,我们希望HDFS能够尽快从备份服务器恢复数据,并向外提供服务,以减小服务的中断时间。
但是一个HDFS系统中往往保存了大量的数据,尽管使用了多个数据节点并行传输的方法,依然需要花费相当长的时间从备份服务器恢复过来,导致服务中断时间过长。
发明内容
本发明提供一种数据恢复方法和装置,该方法和装置用于解决现有技术中HDFS系统从备份服务器恢复数据时服务中断时间过长的问题。
本发明公开一种数据恢复方法,当分布式文件系统HDFS进行数据恢复时,包括:
下载元数据列表和数据块列表;
接收访问任一目标文件的请求,根据所述请求在所述元数据中查找所述目标文件 所包含的目标数据块信息;
若在数据块列表中查找到所述目标数据块信息,则获取所述目标数据块信息对应的下载完成标志;
若根据所述下载完成标志确定所述目标数据块信息未下载完成,则在所述数据块列表中查找所述目标数据块信息的属性信息;
从所述属性信息中获取所述目标数据块信息的预期访问时间,并根据所述请求的属性调整所述预期访问时间。
可选的,数据节点根据所述请求的属性调整所述预期访问时间包括:
当根据所述请求的属性信息确定所述请求为读取所述任一文件,则确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得系统利用调整后的所述预期访问时间恢复所述目标数据块信息。
可选的,将所述预期访问时间调整为所述最小值之后,该方法进一步包括:
在所述数据块列表中找到所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块信息的预期访问时间。
可选的,下载元数据列表和数据块列表之前,该方法进一步包括:
设置操作阈值,使得在数据恢复操作未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块的数量占待恢复的所有数据块的数量的比例。
可选的,该方法还包括:
当根据所述请求的属性信息确定所述请求为删除所述任一文件,则在所述数据块列表中查找所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息;使得所述目标数据节点收到所述删除消息后,在数据块的下载队列中删除所述目标数据块信息对应的信息。
可选的,根据所述请求的属性调整所述预期访问时间之后,进一步包括:
数据节点中维护一个数据块下载的优先队列,数据节点每次从该队列中取出预期访问时间最小的块信息;
从备份端服务器下载块信息对应的数据块。
本发明还提供一种数据恢复装置,包括:
列表模块,用于当分布式文件系统HDFS进行数据恢复时,下载元数据列表和数据块列表;
第一查找模块,用于接收访问任一目标文件的请求,根据所述请求在所述元数据中查找所述目标文件所包含的目标数据块信息;
获取模块,用于若在数据块列表中查找到所述目标数据块信息,则获取所述目标数据块信息对应的下载完成标志;
第二查找模块,用于若根据所述下载完成标志确定所述目标数据块信息未下载完成,则在所述数据块列表中查找所述目标数据块信息的属性信息;
调整模块,用于从所述属性信息中获取所述目标数据块信息的预期访问时间,并根据所述请求的属性调整所述预期访问时间。
可选的,所述调整模块具体用于当根据所述请求的属性信息确定所述请求为读取所述任一文件,则确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得系统利用调整后的所述预期访问时间恢复所述目标数据块信息。
可选的,所述调整模块还用于将所述预期访问时间调整为所述最小值之后,在所述数据块列表中找到所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块信息的预期访问时间。
可选的,该装置还包括:
恢复模块,用于在下载元数据列表和数据块列表之前,设置操作阈值,使得在数据恢复操作未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块的数量占待恢复的所有数据块的数量的比例。
可选的,该装置还包括:
删除模块,用于当根据所述请求的属性信息确定所述请求为删除所述任一文件,则在所述数据块列表中查找所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息;使得所述目标数据节点收到所述删除消息后,在数据块的下载队列中删除所述目标数据块信息对应的信息。
可选的,该装置还包括:
下载模块,用于在数据节点中维护一个数据块下载的优先队列,数据节点每次从该队列中取出预期访问时间最小的块信息;从备份端服务器下载块信息对应的数据块。
本发明还公开一种分布式文件系统HDFS的按需恢复数据的方法,包括:
接收针对一目标文件的请求,查找所述目标文件;
在查找到所述目标文件的情况下,判断所述目标文件对应的目标数据块文件是否下载完成;以及
在所述目标数据块文件未下载完成时,根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件。
可选的,当所述请求为访问所述目标文件时,所述根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件的步骤还包括:
在预先存储的数据块文件与数据节点的映射关系中查找所述目标数据块文件的信息;以及
从所述目标数据块文件的信息中获取所述目标数据块文件的预期访问时间,确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得所述HDFS利用调整后的所述预期访问时间恢复所述目标数据块文件。
可选的,将所述预期访问时间调整为所述最小值之后,该方法还包括:
在所述映射关系中找到所述目标数据块文件对应的目标数据节点,通过远程过程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块文件的预期访问时间。
可选的,当所述请求为删除所述目标文件时,所述根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件的步骤包括:
在预先存储的数据块文件与数据节点的映射关系中查找所述目标数据块文件对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息,使得所述目标数据节点在收到所述请求后,从所述目标数据节点的下载队列中删除所述目标数据块文件。
可选的,在所述接收针对一目标文件的请求,查找所述目标文件之前,所述方法还包括:从备份服务器下载元数据。
可选的,在所述从备份服务器下载元数据之前,所述方法还包括:
设置操作阈值,使得在所述按需恢复数据的方法未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块的数量占待恢复的所有数据块的数量的比例。
可选的,所述方法还包括:
所述数据节点每次从所述优先队列中取出预期访问时间最小的数据块文件;以及
从备份服务器下载与被取出的数据块文件对应的数据。
此外,本发明还公开一种分布式文件系统HDFS的按需恢复数据的装置,包括:
第一查找模块,设置为接收针对一目标文件的请求,查找所述目标文件;
判断模块,设置为在查找到所述目标文件的情况下,判断所述目标文件对应的目标数据块文件是否下载完成;
调整模块,设置为在所述目标数据块文件未下载完成时,根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块。
可选的,所述调整模块还设置为:
当所述请求为访问所述目标文件时,在预先储存的数据块文件与数据节点的映射关系中查找所述目标数据块文件的信息;以及
从所述目标数据块文件的信息中获取所述目标数据块文件的预期访问时间,确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得所述HDFS利用调整后的所述预期访问时间恢复所述目标数据块文件。
可选的,所述调整模块还设置为:
在将所述预期访问时间调整为所述最小值之后,在所述映射关系中找到所述目标数据文件对应的目标数据节点,通过远程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块文件的预期访问时间。
可选的,所述调整模块还设置为:
当所述请求为删除所述目标文件时,在预先存储的数据块文件与数据节点的映射关系中查找所述目标数据块文件对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息,使得所述目标数据节点在收到所述请求后,从所述目标数据节点的下载队列中删除所述目标数据块文件。
可选的,所述装置还包括备份模块,设置为:从备份服务器下载元数据。
可选的,所述装置还包括恢复模块,设置为:
设置操作阈值,使得在所述按需恢复数据未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块的数量占待恢复的所有数据块的数量的比例。
可选的,所述装置还包括下载模块,设置为:
使所述数据节点每次从所述优先队列中取出预期访问时间最小的数据块文件;以及
从备份端服务器下载被取出的数据块文件对应的数据。
上述技术方案中的一个或两个,至少具有如下技术效果:
本发明公开的方法和装置,在下载数据块过程中,首先下载并载入元数据开始提供文件系统服务;在名字节点和数据节点中保存要下载的数据块列表;根据恢复过程中客户端对数据块的访问需求调整恢复的优先级,优先恢复客户端访问的文件;对于客户端删除的文件放弃恢复过程以节省时间;可以实现高效的分布式文件系统按需恢复。
附图说明
图1为本发明实施例提供一种数据恢复方法的流程图;
图2为本发明实施例所提供方法所实用的装置结构示意图;
图3为本发明实施例所提供方法在具体环境中使用时的流程示意图;
图4为本发明实施例提供一种数据恢复装置的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
在HDFS中并不会出现所有的数据在同一时刻被访问的情况,一般需要立刻访问的数据往往只是一小部分。为了减小数据恢复时服务中断时间,让HDFS尽快开 始向外提供服务,本发明实施例提供的方法中,可以按需对数据进行恢复;即在数据恢复过程中,实时地根据访问情况调整恢复的优先级,先恢复需要尽快访问的数据,后恢复不需要现在访问的数据。通过上述方法,大大地减少了服务的中断恢复时间,并且提供了更灵活的控制恢复过程的方法。以下结合具体的附图对本发明实施例提供的方法作详细说明,具体包括:
如图1所示,本发明实施例提供一种数据恢复方法,当Hadoop分布式文件系统进行数据恢复时,具体包括:
步骤101,下载元数据列表和数据块列表;
现有技术中,如果数据没有恢复到一定程度,HDFS文件系统处于安全模式,此时只支持文件系统目录树的查看,不支持对文件系统的修改和对文件的读取。为了保证即使在文件系统中的数据块没有被下载完成时,文件系统依然可以对外提供完整的服务,在该实施例中,可以在步骤101下载元数据列表和数据块列表之前,进一步包括:
设置操作阈值,使得在数据恢复操作未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块的数量占待恢复的所有数据块的数量的比例。具体使用时,该操作阈值可以设置为系统能够接受的最小值,例如设置为0。
步骤102,接收访问任一目标文件的请求,根据所述请求在所述元数据中查找所述目标文件所包含的目标数据块信息;
步骤103,若在数据块列表中查找到所述目标数据块信息,则获取所述目标数据块信息对应的下载完成标志;
步骤104,若根据所述下载完成标志确定所述目标数据块信息未下载完成,则在所述数据块列表中查找所述目标数据块信息的属性信息;
步骤105,从所述属性信息中获取所述目标数据块信息的预期访问时间,并根据所述请求的属性调整所述预期访问时间。
在本发明实施例中,根据请求的属性调整预期访问时间包括的具体实现方式包括多种,以下提供一种最优化的方式,具体可以是:
当根据所述请求的属性信息确定所述请求为读取所述任一文件,则确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得系统利用调整后的所述预期访问时间恢复所述目标数据块信息。
进一步,将预期访问时间调整为系统时间和下载之前设定的预期访问时间中的最小值后,该方法进一步包括:
在所述数据块列表中找到所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块信息的预期访问时间。
另外,在数据恢复过程中,对于客户端删除的文件可以选择放弃恢复过程以节省数据恢复的时间;可以实现高效的分布式文件系统按需恢复。具体实现可以是:
当根据所述请求的属性信息确定所述请求为删除所述任一文件,则在所述数据块列表中查找所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息;使得所述目标数据节点收到所述删除消息后,在数据块的下载队列中删除所述目标数据块信息对应的信息。
基于上述方案根据访问的需求对数据块的预期访问时间进行调整之后,具体进行数据块的下载包括:
数据节点中维护一个数据块下载的优先队列,数据节点每次从该队列中取出预期访问时间最小的块信息;
从备份端服务器下载块信息对应的数据块。
另外,数据块下载完成后,通过远程过程调用名字节点(NameNode)上的一个函数,告知名字节点(NameNode)已经完成下载的该数据块的信息,数据块的信息可以包括数据块的id、生成标志、长度;名字节点NameNode把对应数据块的下载完成标志置为true。
上述实施例所提供的方法应用到具体的环境中时,本发明实施例所实用的使用环境如图2所示,具体实现流程可以是:
该实施例中HDFS从备份服务器下载数据,然后HDFS中的名字节点(NameNode)和数据节点(DataNode)对下载的数据进行对应的处理,具体实现包括:
名字节点(NameNode)的内存中包括从备份端服务器下载的所有数据块的列表,同时HDFS启动时指定了数据节点(DataNode)的个数,NameNode将所有的数据块平均分配给所有的DataNode,即在DataNode向NameNode注册时,NameNode把分配给该DataNode的数据块列表发送给它,并且NameNode在内存中保存一个数据块信息到DataNode的映射关系(即数据块列表:Block-DataNode Map),数据块的信息包括数据块的id、生成标志、长度、下载完成标志(默认false)、预期访问时间(一个长整数,默认为最大的长整数)。
在实施例中,从备份服务器下载数据的具体实现可以是:
数据节点中保存有一个数据块下载的优先队列,数据节点每次从该队列中取出预期访问时间最小的数据块(预期访问时间类型是一个长整数,初始化所有数据块的预期访问时间为最大的长整数),从备份端服务器下载该数据块,下载完成后,通过远程过程调用调用名字节点上的一个函数,告知名字节点已经完成下载的该数据块的信息,这些信息包括数据块的id、生成标志、长度,名字节点把对应数据块的下载完成标志置为true。
启动名字节点,下载元数据;
在配置文件中进行配置,HDFS通过命令行启动,指定恢复选项、要恢复的文件系统名称和数据节点个数。配置文件优选是hdfs-backup.xml。配置文件存放于$HADOOP/etc/hadoop/hdfs-backup.xml,需要配置备份服务器的地址端口。配置完成以后HDFS系统执行恢复命令启动,指定恢复选项-recoverFromBackup、要恢复的文件系统名称、数据节点的个数。名字节点会从备份端服务器下载元数据的压缩文件到本地,并把该文件载入内存中得到文件系统的元数据,即文件系统的目录树;同时,名字节点从备份端服务器获取文件系统中所包含的所有数据块的列表,并将其放入内存中。
具体地,HDFS默认在文件系统中,当现有的数据块的数量占应该包含的所有数据块的数量的比例小于某个设定的阈值时,HDFS文件系统处于安全模式,此时只支持文件系统目录树的查看,不支持对文件系统的修改和对文件的读取;为了即使在文件系统中所有的数据块都没有被下载时,文件系统依然可以对外提供完整的服务,在该实施例中可以将该阈值设置为0。
启动数据节点,下载块数据;
数据节点启动之后向名字节点进行注册。名字节点在注册时向DataNode分配需要下载的数据块的列表。数据节点从备份服务器下载列表中的数据。
具体地,名字节点的内存中包括从备份端服务器下载的所有数据块的列表,同时HDFS启动时指定了数据节点的个数,名字节点将所有的数据块平均分配给所有的数据节点,即在数据节点向名字节点注册时,名字节点把分配给该数据节点的数据块列表发送给它,并且名字节点在内存中保存一个数据块信息到数据节点的映射关系(即数据块列表:Block-DataNode Map),数据块的信息包括数据块的id、生成标志、长度、下载完成标志(默认false)、预期访问时间(一个长整数,默认为最大的长整数)。
具体地,数据节点中保存有一个数据块下载的优先队列,数据节点每次从该队列中取出预期访问时间最小的块(预期访问时间类型是一个长整数,初始化所有数据块的预期访问时间为最大的长整数),从备份端服务器下载该数据块,下载完成后,通过远程过程调用调用名字节点上的一个函数,告知名字节点已经完成下载的该数据块的信息,包括数据块的id、生成标志、长度,名字节点把对应数据块的下载完成标志置为true。
如图3所示,基于上述数据下载的方法,如果在数据还没有恢复完成时,接收到客户端发送的访问某一数据的请求(该访问请求可以是读取某一数据也可以是删除数据),则具体该方法还包括:
步骤301,客户端读取或删除任一文件;
步骤302,在元数据中查找该任一文件对应的数据块列表;
步骤303,在数据块列表中查找数据块更新预期访问时间或删除数据块,并发 送指令到相应的数据节点;
步骤304,数据节点根据名字节点的指令更新相应的预期访问时间或删除相应的数据块;
数据节点在下载数据时候是根据预先设置的优先队列进行的,预先设置的优先队列是以预期访问时间排序的优先队列。
步骤305,数据节点根据修改后的优先队列中的顺序,逐个下载数据块。
为了更详细的说明数据读取和删除的具体实现方式,以下分别对数据读取和删除的具体实现方式做进一步的说明,具体包括:
(1)根据访问文件情况改变优先级。
客户端向名字节点发送打开文件命令;名字节点在内存中的元数据中查找到该文件所包含的待读取数据块,在Block-DataNode Map中查找该待读取数据块,若未找到,则说明要读取的数据块是启动之后新建的文件,则进行正常的读写操作;否则查看数据块的下载完成标志的值。如果所有数据块的下载完成标志都为true(表示已经下载完成),则进行正常的读写操作。如果存在数据块的下载完成标志为false(表示未下载完成),则对客户端返回一个“数据块下载中”错误,要求客户端稍后访问该文件;同时,在Block-DataNode Map中查找该数据块的信息,取现在的系统时间和该数据块的预期访问时间中的最小值设置为该数据块的预期访问时间,若该数据块的预期访问时间改变,则在Block-DataNode Map中找到它对应的数据节点,通过远程过程调用向该数据节点发送信息,更新该数据块的预期访问时间。
(2)根据删除文件情况改变优先级。
客户端向名字节点发送删除文件命令;名字节点在内存中的元数据中查找到该文件所包含的数据块,在Block-DataNode Map中查找这些数据块,若未找到,则说明要删除的是启动之后新建的文件,进行正常的删除操作;否则进行正常的删除元数据操作,并查看所包含的数据块的下载完成标志的值;对于下载完成标志为true的数据块,进行正常的删除操作;对于下载完成标志为false的数据块,在Block-DataNode Map中查找该数据块对应的数据节点,通过远程过程调用向该数据节点发送删除消息;数据节点收到消息后,若下载队列中有该数据块,则从数据块的下载队列中删除该数据块。
完成恢复过程。在执行上面的恢复步骤时,检测名字节点中的Block-DataNode Map,当Block-DataNode Map变为空或其中所有的数据块的下载标志都为true时,删除NameNode内存中的Block-DataNode Map,完成恢复过程。
本发明实施例所提供的方法在下载数据块过程中,首先下载并载入元数据开始提供文件系统服务;在名字节点和数据节点中保存要下载的数据块列表;根据恢复过程中客户端对数据块的访问需求调整恢复的优先级,优先恢复客户端访问的文件;对于客户端删除的文件放弃恢复过程以节省时间;可以实现高效的分布式文件 系统按需恢复。
实施例
如图4所示,本发明实施例还提供一种数据恢复装置,该装置包括:
列表模块401,用于当分布式文件系统HDFS进行数据恢复时,下载元数据列表和数据块列表;
第一查找模块402,用于接收访问任一目标文件的请求,根据所述请求在所述元数据中查找所述目标文件所包含的目标数据块信息;
获取模块403,用于若在数据块列表中查找到所述目标数据块信息,则获取所述目标数据块信息对应的下载完成标志;
第二查找模块404,用于若根据所述下载完成标志确定所述目标数据块信息未下载完成,则在所述数据块列表中查找所述目标数据块信息的属性信息;
调整模块405,用于从所述属性信息中获取所述目标数据块信息的预期访问时间,并根据所述请求的属性调整所述预期访问时间。
可选的,该调整模块405具体用于当根据所述请求的属性信息确定所述请求为读取所述任一文件,则确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得系统利用调整后的所述预期访问时间恢复所述目标数据块信息。
可选的,该调整模块405还用于将所述预期访问时间调整为所述最小值之后,在所述数据块列表中找到所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块信息的预期访问时间。
另外,该装置还包括:
恢复模块,用于在下载元数据列表和数据块列表之前,设置操作阈值,使得在数据恢复操作未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块的数量占待恢复的所有数据块的数量的比例。
可选的,为了节省数据恢复的时间,对于客户端要删除的文件可以选择放弃恢复,则该装置还包括:
删除模块,用于当根据所述请求的属性信息确定所述请求为删除所述任一文件,则在所述数据块列表中查找所述目标数据块信息对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息;使得所述目标数据节点收到所述删除消息后,在数据块的下载队列中删除所述目标数据块信息对应的信息。
可选的,该装置还包括:
下载模块,用于在数据节点中维护一个数据块下载的优先队列,数据节点每次从该队列中取出预期访问时间最小的块信息;从备份端服务器下载块信息对应的数据块。
本领域普通技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中。其中,所述的存储介质可以为ROM/RAM、磁碟、光盘等。
本发明提供一种非临时性计算机可读存储介质,其中存储有指令,当数据恢复装置中的一个或多个处理器执行所述指令时,所述数据恢复装置执行一种数据恢复方法,该方法包括:接收针对一目标文件的请求,查找所述目标文件;在查找到所述目标文件的情况下,判断所述目标文件对应的目标数据块文件是否下载完成;以及在所述目标数据块文件未下载完成时,根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件。
本发明所提供的方法及装置,具有以下优点:
本发明公开的方法和装置,在下载数据块过程中,首先下载并载入元数据开始提供文件系统服务;在名字节点和数据节点中保存要下载的数据块列表;根据恢复过程中客户端对数据块的访问需求调整恢复的优先级,优先恢复客户端访问的文件;对于客户端删除的文件放弃恢复过程以节省时间;可以实现高效的分布式文件系统按需恢复。
本申请实施例提供的数据恢复装置中的各个模块或单元可以通过一个或多个数字信号处理器(DSP)、专用集成电路(ASIC)、处理器、微处理器、控制器、微控制器、现场可编程阵列(FPGA)、可编程逻辑器件或其他电子单元或其任意组合来实现。在本申请实施例中描述的一些功能或处理也可以通过在处理器上执行的软件来实现。
工业实用性
本发明涉及数据处理技术领域,可以解决现有技术中HDFS系统从备份服务器恢复数据时服务中断时间过长的问题。
显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。

Claims (14)

  1. 一种分布式文件系统HDFS的按需恢复数据的方法,包括:
    接收针对一目标文件的请求,查找所述目标文件;
    在查找到所述目标文件的情况下,判断所述目标文件对应的目标数据块文件是否下载完成;以及
    在所述目标数据块文件未下载完成时,根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件。
  2. 如权利要求1所述的方法,其中,当所述请求为访问所述目标文件时,所述根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件的步骤包括:
    在预先存储的数据块文件与数据节点的映射关系中查找所述目标数据块文件的信息;以及
    从所述目标数据块文件的信息中获取所述目标数据块文件的预期访问时间,确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得所述HDFS利用调整后的所述预期访问时间恢复所述目标数据块文件。
  3. 如权利要求2所述的方法,其中,将所述预期访问时间调整为所述最小值之后,该方法还包括:
    在所述映射关系中找到所述目标数据块文件对应的目标数据节点,通过远程过程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块文件的预期访问时间。
  4. 如权利要求1所述的方法,其中,当所述请求为删除所述目标文件时,所述根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块文件的步骤包括:
    在预先存储的数据块文件与数据节点的映射关系中查找所述目标数据块文件对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息,使得所述目标数据节点在收到所述请求后,从所述目标数据节点的下载队列中删除所述目标数据块文件。
  5. 如权利要求1~4中任一项所述的方法,其中,在所述接收针对一目标文件的请求,查找所述目标文件之前,所述方法还包括:从备份服务器下载元数据。
  6. 如权利要求5所述的方法,其中,在所述从备份服务器下载元数据之前,所述方法还包括:
    设置操作阈值,使得在所述按需恢复数据的方法未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块文件的数量占待恢复的所 有数据块文件的数量的比例。
  7. 如权利要求2-4中任一项所述的方法,还包括:
    所述数据节点每次从所述优先队列中取出预期访问时间最小的数据块文件;以及
    从备份服务器下载与被取出的数据块文件对应的数据。
  8. 一种分布式文件系统HDFS的按需恢复数据的装置,包括:
    第一查找模块,设置为接收针对一目标文件的请求,查找所述目标文件;
    判断模块,设置为在查找到所述目标文件的情况下,判断所述目标文件对应的目标数据块文件是否下载完成;
    调整模块,设置为在所述目标数据块文件未下载完成时,根据所述请求对数据块文件下载的优先队列进行调整以优先恢复所述目标数据块。
  9. 如权利要求8所述的装置,其中,所述调整模块还设置为:
    当所述请求为访问所述目标文件时,在预先储存的数据块文件与数据节点的映射关系中查找所述目标数据块文件的信息;以及
    从所述目标数据块文件的信息中获取所述目标数据块文件的预期访问时间,确定所述预期访问时间与当前的系统时间中的最小值,将所述预期访问时间调整为所述最小值,使得所述HDFS利用调整后的所述预期访问时间恢复所述目标数据块文件。
  10. 如权利要求9所述的装置,其中,所述调整模块还设置为:
    在将所述预期访问时间调整为所述最小值之后,在所述映射关系中找到所述目标数据文件对应的目标数据节点,通过远程调用向所述目标数据节点发送调整信息,使得该目标数据节点根据该调整信息更新预存的所述目标数据块文件的预期访问时间。
  11. 如权利要求8所述的装置,其中,所述调整模块还设置为:
    当所述请求为删除所述目标文件时,在预先存储的数据块文件与数据节点的映射关系中查找所述目标数据块文件对应的目标数据节点,通过远程过程调用向所述目标数据节点发送删除消息,使得所述目标数据节点在收到所述请求后,从所述目标数据节点的下载队列中删除所述目标数据块文件。
  12. 如权利要求8-11中任一项所述的装置,还包括备份模块,设置为:从备份服务器下载元数据。
  13. 如权利要求12所述的装置,还包括恢复模块,设置为:
    设置操作阈值,使得在所述按需恢复数据未完成时可以对外提供对数据进行操作的服务;其中,所述操作阈值为已恢复的数据块文件的数量占待恢复的所有数据块文件的数量的比例。
  14. 如权利要求9~11中任一项所述的装置,还包括下载模块,设置为:
    使所述数据节点每次从所述优先队列中取出预期访问时间最小的数据块文件;以及
    从备份端服务器下载被取出的数据块文件对应的数据。
PCT/CN2016/111762 2015-12-25 2016-12-23 一种数据恢复方法及装置 WO2017107984A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510991047.3 2015-12-25
CN201510991047.3A CN106919470A (zh) 2015-12-25 2015-12-25 一种数据恢复方法及装置

Publications (1)

Publication Number Publication Date
WO2017107984A1 true WO2017107984A1 (zh) 2017-06-29

Family

ID=59089054

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/111762 WO2017107984A1 (zh) 2015-12-25 2016-12-23 一种数据恢复方法及装置

Country Status (2)

Country Link
CN (1) CN106919470A (zh)
WO (1) WO2017107984A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542860A (zh) * 2018-10-25 2019-03-29 平安科技(深圳)有限公司 基于hdfs的业务数据管理方法、终端设备
CN111831625A (zh) * 2020-07-14 2020-10-27 深圳力维智联技术有限公司 数据迁移方法、数据迁移装置和可读存储介质
US20220237010A1 (en) * 2021-01-28 2022-07-28 Red Hat, Inc. Executing containerized applications using partially downloaded container image files

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579179A (zh) * 2019-09-30 2021-03-30 合肥杰发科技有限公司 一种嵌入式系统的分区挂载方法
CN111176901B (zh) * 2019-12-31 2022-10-11 厦门市美亚柏科信息股份有限公司 一种hdfs删除文件恢复方法、终端设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102713856A (zh) * 2009-12-21 2012-10-03 国际商业机器公司 具有选择性按需数据可用性的多阶段文件系统恢复
US8639974B1 (en) * 2005-07-20 2014-01-28 Dell Software Inc. Method and system for virtual on-demand recovery
CN104572357A (zh) * 2014-12-30 2015-04-29 清华大学 一种用于hdfs系统的备份和恢复方法
CN104937556A (zh) * 2013-01-30 2015-09-23 惠普发展公司,有限责任合伙企业 恢复数据库的页面
CN105007172A (zh) * 2015-05-28 2015-10-28 杭州健港信息科技有限公司 一种hdfs高可用性方案的实现方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414277B (zh) * 2008-11-06 2010-06-09 清华大学 一种基于虚拟机的按需增量恢复容灾系统及方法
CN103207867B (zh) * 2012-01-16 2019-04-26 联想(北京)有限公司 处理数据块的方法、发起恢复操作的方法和节点
CN103617097B (zh) * 2013-11-19 2017-07-07 华为技术有限公司 文件恢复方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8639974B1 (en) * 2005-07-20 2014-01-28 Dell Software Inc. Method and system for virtual on-demand recovery
CN102713856A (zh) * 2009-12-21 2012-10-03 国际商业机器公司 具有选择性按需数据可用性的多阶段文件系统恢复
CN104937556A (zh) * 2013-01-30 2015-09-23 惠普发展公司,有限责任合伙企业 恢复数据库的页面
CN104572357A (zh) * 2014-12-30 2015-04-29 清华大学 一种用于hdfs系统的备份和恢复方法
CN105007172A (zh) * 2015-05-28 2015-10-28 杭州健港信息科技有限公司 一种hdfs高可用性方案的实现方法

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542860A (zh) * 2018-10-25 2019-03-29 平安科技(深圳)有限公司 基于hdfs的业务数据管理方法、终端设备
CN109542860B (zh) * 2018-10-25 2023-07-07 平安科技(深圳)有限公司 基于hdfs的业务数据管理方法、终端设备
CN111831625A (zh) * 2020-07-14 2020-10-27 深圳力维智联技术有限公司 数据迁移方法、数据迁移装置和可读存储介质
CN111831625B (zh) * 2020-07-14 2024-03-12 深圳力维智联技术有限公司 数据迁移方法、数据迁移装置和可读存储介质
US20220237010A1 (en) * 2021-01-28 2022-07-28 Red Hat, Inc. Executing containerized applications using partially downloaded container image files

Also Published As

Publication number Publication date
CN106919470A (zh) 2017-07-04

Similar Documents

Publication Publication Date Title
US11809726B2 (en) Distributed storage method and device
WO2017107984A1 (zh) 一种数据恢复方法及装置
US10089030B2 (en) Making more active use of a secondary storage system
US10339101B1 (en) Distributed write journals that support fast snapshotting for a distributed file system
US9727273B1 (en) Scalable clusterwide de-duplication
US20150019495A1 (en) Customizable storage system for virtual databases
US11449391B2 (en) Network folder resynchronization
US9075532B1 (en) Self-referential deduplication
CN107710164B (zh) 作为一种服务的灾难恢复
US8843581B2 (en) Live object pattern for use with a distributed cache
JP5686034B2 (ja) クラスタシステム、同期制御方法、サーバ装置および同期制御プログラム
CN108984544B (zh) 一种分布式系统修改配置信息的方法和装置
US10929100B2 (en) Mitigating causality discrepancies caused by stale versioning
US11442752B2 (en) Central storage management interface supporting native user interface versions
US11531712B2 (en) Unified metadata search
JP6196389B2 (ja) 分散型ディザスタリカバリファイル同期サーバシステム
CN111600794A (zh) 服务器切换方法、终端、服务器及存储介质
WO2019001021A1 (zh) 数据处理方法、装置、系统、服务器及计算机存储介质
US20160050113A1 (en) Methods for managing storage virtual machine configuration changes in a distributed storage system and devices thereof
CN112883119B (zh) 数据同步方法、装置、计算机设备及计算机可读存储介质
CN113726546A (zh) 配置方法、装置、系统、计算设备及存储介质
CN114363356B (zh) 数据同步方法、系统、装置、计算机设备和存储介质
US11630736B2 (en) Recovering a storage volume associated with a snapshot lineage from cloud storage
CN108196979B (zh) 数据备份方法和装置
CN111125001A (zh) 快照复制方法、电子设备和计算机程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16877794

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16877794

Country of ref document: EP

Kind code of ref document: A1