CN104239425A - File access method, file access device and file access system - Google Patents

File access method, file access device and file access system Download PDF

Info

Publication number
CN104239425A
CN104239425A CN201410421369.XA CN201410421369A CN104239425A CN 104239425 A CN104239425 A CN 104239425A CN 201410421369 A CN201410421369 A CN 201410421369A CN 104239425 A CN104239425 A CN 104239425A
Authority
CN
China
Prior art keywords
file
back end
instruction
recovery
client
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.)
Granted
Application number
CN201410421369.XA
Other languages
Chinese (zh)
Other versions
CN104239425B (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410421369.XA priority Critical patent/CN104239425B/en
Publication of CN104239425A publication Critical patent/CN104239425A/en
Application granted granted Critical
Publication of CN104239425B publication Critical patent/CN104239425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file access method, a file access device and a file access system, and belongs to the field of storage. The method comprises the following steps that when a client accesses a first file through a first data node, file information of the first file is obtained; when the client accesses the first file through the first data node, a directory node generates switching indication information if the condition that the first data node has a fault is detected; the directory node sends the switching indication information to the client; the client sends a recovery instruction to a second data node according to the switching indication information, wherein the recovery instruction comprises the file information of the first file; the second data node recovers the first file according to the file information of the first file; the client accesses the first file through the second data node. The file access method, the file access device and the file access system have the advantages that the problem of greater system load is solved, the effect of reducing the system load is achieved, and the method, the device and the system provided by the invention are used for the file access in a distributed system.

Description

The method of file access, Apparatus and system
Technical field
The present invention relates to field of storage, the method for particularly a kind of file access, Apparatus and system.
Background technology
Along with the development of the network communications technology, distributed system is widely used.Distributed system supports the software systems of distributed treatment, can execute the task on multiple back end interconnected by communication network, this distributed system comprises: directory node and back end, each back end can both access all resources in this distributed system, and this directory node can manage the information of each back end.
In a distributed system, when client is by back end access file, this back end the fileinfo of this file can be backed up to disk or on other back end, this file packets of information draws together File Open status information and lock information.If now this back end there occurs fault, so directory node will specify to this client the back end do not broken down in other back end, client triggers this back end do not broken down and obtains the fileinfo that disk or other back end store, this back end do not broken down is by sending magnetic disc i/o (Input/Output to disk, I/O) ask or send the corresponding fileinfo of network service I/O acquisition request to other back end, this back end do not broken down carries out the recovery of data according to this fileinfo, and continue the access that file is provided to client, avoid service disconnection.
In prior art, the recovery of data file during in order to support access file, fileinfo is write on disk or other back end, but, no matter fileinfo writes on disk or writes on other back end, all occupies the disk space in distributed system or overall system internal memory, and when the back end carrying out fault recovery communicates with disk or other back end, need to use a large amount of I/O requests, therefore system loading is larger.
Summary of the invention
In order to the problem that resolution system load is larger, embodiments provide a kind of method of file access.Described technical scheme is as follows:
First aspect, provides a kind of file access method, comprising:
Client accesses the first file by the first back end, obtains the fileinfo of described first file;
Directory node detects that described first back end breaks down, and send indication message to described client, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described client is according to described indication message, and send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file;
Described second back end recovers described first file according to the fileinfo of described first file;
Described client is by described first file of described second back end access.
In conjunction with first aspect, can in implementation at the first, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described client, according to described indication message, sends to described second back end and recovers instruction, comprising:
Described client, according to described indication message, sends described handle respectively to described second back end and recovers instruction and the instruction of described lock Information recovering;
Described second back end carries out the recovery of described first file according to the fileinfo of described first file, comprising:
Described second back end rebuilds the file handle of described first file according to described File Open status information;
The lock information of described second back end first file according to the lock information reconstruction of described first file.
Can implementation in conjunction with first aspect or the first, can in implementation at the second, detect that described first back end breaks down in described directory node, before sending indication message to described client, described method also comprises:
Described directory node generates the first accesses entry information, and it is to be repaired that described first accesses entry information is used to indicate described first file;
In described client according to described indication message, after described second back end sends recovery instruction, described method also comprises:
Described second back end sends accesses entry lastest imformation to described directory node, and described accesses entry lastest imformation instruction upgrades described first accesses entry information;
Described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation and obtains the second accesses entry information, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
Second aspect, provides a kind of file access method, comprising:
Client accesses the first file by the first back end, obtains the fileinfo of described first file;
Described client receives the indication message that directory node sends, described indication message is that described directory node generates when detecting that described first back end breaks down, and described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described client is according to described indication message, send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file, so that described second back end carries out the recovery of described first file according to the fileinfo of described first file.
In conjunction with second aspect, can in implementation at the first, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described client, according to described indication message, sends to described second back end and recovers instruction, comprising:
Described client is according to described indication message, send described handle respectively to described second back end and recover instruction and the instruction of described lock Information recovering, so that described second back end rebuilds the file handle of described first file according to described File Open status information, the lock information of the first file according to the lock information reconstruction of described first file.
The third aspect, provides a kind of file access method, comprising:
Second back end receives the recovery instruction that client sends, described recovery instruction is that described client generates after the indication message receiving directory node transmission, described indication message is that described directory node generates when detecting that described first back end breaks down, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file, and described recovery instruction comprises the fileinfo of described first file;
Described second back end carries out the recovery of described first file according to the fileinfo of described first file.
In conjunction with the third aspect, can in implementation at the first, before described second back end carries out the recovery of described first file according to the fileinfo of described first file, described method also comprises:
Described second back end sends accesses entry lastest imformation to described directory node, described accesses entry lastest imformation indicates described directory node to upgrade the first accesses entry information, so that described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation obtain the second accesses entry information;
Wherein, described first accesses entry information generates when described directory node detects that described first back end breaks down, be used to indicate described first file to be repaired, described second accesses entry information is used to indicate described first file and is recovered by described second back end.
Can implementation in conjunction with the third aspect or the first, can in implementation at the second, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described second back end carries out the recovery of described first file according to the fileinfo of described first file, comprising:
Handle in the recovery instruction that described second back end sends according to described client recovers the file handle that described first file is rebuild in instruction;
The lock information of described first file is rebuild in lock Information recovering instruction in the recovery instruction that described second back end sends according to described client.
Fourth aspect, provides a kind of file access method, comprising:
Directory node is when client accesses the first file by the first back end, if detect that described first back end breaks down, generate indication message, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described directory node sends described indication message to client, so that described client sends recovery instruction according to described indication message to described second back end, described recovery instruction comprises the fileinfo of described first file, and described recovery instruction is used to indicate described second back end carries out described first file recovery according to the fileinfo of described first file.
In conjunction with fourth aspect, can in implementation at the first, after described directory node generates indication message, described method also comprises:
Described directory node generates the first accesses entry information, and it is to be repaired that described first accesses entry information is used to indicate described first file;
After described directory node sends described indication message to client, described method also comprises:
Described directory node receives the accesses entry lastest imformation that described second back end sends, and described accesses entry lastest imformation indicates described directory node to upgrade described first accesses entry information;
Described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation and obtains the second accesses entry information, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
5th aspect, provides a kind of file access system, comprising:
Client, directory node and the second back end,
Described client, for accessing the first file by the first back end, obtains the fileinfo of described first file;
Described directory node, for detecting that described first back end breaks down, send indication message to described client, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described client is also for according to described indication message, and send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file;
Described second back end, for carrying out the recovery of described first file according to the fileinfo of described first file;
Described client, also for accessing described first file by described second back end.
In conjunction with the 5th aspect, can in implementation at the first, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described client, specifically for according to described indication message, sends described handle respectively to described second back end and recovers instruction and the instruction of described lock Information recovering;
Described second back end specifically for:
The file handle of described first file is rebuild according to described File Open status information;
The lock information of the first file according to the lock information reconstruction of described first file.
Can implementation in conjunction with the 5th aspect or the first, can in implementation at the second, described directory node is also for generating the first accesses entry information, and it is to be repaired that described first accesses entry information is used to indicate described first file;
Described second back end is also for sending accesses entry lastest imformation to described directory node, and described accesses entry lastest imformation instruction upgrades described first accesses entry information;
Described directory node also obtains the second accesses entry information for upgrading described first accesses entry information according to described accesses entry lastest imformation, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
6th aspect, provides a kind of file access device, comprising:
Acquiring unit, for accessing the first file by the first back end, obtains the fileinfo of described first file;
Receiving element, for receiving the indication message that directory node sends, described indication message is that described directory node generates when detecting that described first back end breaks down, and described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Transmitting element, for according to described indication message, send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file, so that described second back end carries out the recovery of described first file according to the fileinfo of described first file.
In conjunction with the 6th aspect, can in implementation at the first, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described transmitting element comprises:
Sending module, for according to described indication message, send described handle respectively to described second back end and recover instruction and the instruction of described lock Information recovering, so that described second back end rebuilds the file handle of described first file according to described File Open status information, the lock information of the first file according to the lock information reconstruction of described first file.
7th aspect, provides a kind of file access device, comprising:
Receiving element, for receiving the recovery instruction that client sends, described recovery instruction is that described client generates after the indication message receiving directory node transmission, described indication message is that described directory node generates when detecting that described first back end breaks down, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file, and described recovery instruction comprises the fileinfo of described first file;
Recovery unit, for carrying out the recovery of described first file according to the fileinfo of described first file.
In conjunction with the 7th aspect, can in implementation at the first, described device also comprises:
Transmitting element, for sending accesses entry lastest imformation to described directory node, described accesses entry lastest imformation indicates described directory node to upgrade the first accesses entry information, so that described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation obtain the second accesses entry information;
Wherein, described first accesses entry information generates when described directory node detects that described first back end breaks down, be used to indicate described first file to be repaired, described second accesses entry information is used to indicate described first file and is recovered by described second back end.
Can implementation in conjunction with the 7th aspect or the first, can in implementation at the second, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described recovery unit comprises:
First rebuilds module, recovers for the handle in the recovery instruction that sends according to described client the file handle that described first file is rebuild in instruction;
Second rebuilds module, rebuilds the lock information of described first file for the lock Information recovering instruction in the recovery instruction that sends according to described client.
Eighth aspect, provides a kind of file access device, comprising:
First generation unit, for when client accesses the first file by the first back end, if detect that described first back end breaks down, generate indication message, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Transmitting element, for sending described indication message to client, so that described client sends recovery instruction according to described indication message to described second back end, described recovery instruction comprises the fileinfo of described first file, and described recovery instruction is used to indicate described second back end carries out described first file recovery according to the fileinfo of described first file.
In conjunction with eighth aspect, can in implementation at the first, described device also comprises:
Second generation unit, for generating the first accesses entry information, it is to be repaired that described first accesses entry information is used to indicate described first file;
Receiving element, for receiving the accesses entry lastest imformation that described second back end sends, described accesses entry lastest imformation indicates described directory node to upgrade described first accesses entry information;
Updating block, obtains the second accesses entry information for upgrading described first accesses entry information according to described accesses entry lastest imformation, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
The invention provides a kind of method of file access, Apparatus and system, because the present invention is by the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the environmental structure schematic diagram of a kind of communication network involved by file access method that the embodiment of the present invention provides;
Fig. 2 is the method flow diagram of a kind of file access method that the embodiment of the present invention provides;
Fig. 3 is the method flow diagram of the another kind of file access method that the embodiment of the present invention provides;
Fig. 4 is the method flow diagram of another file access method that the embodiment of the present invention provides;
Fig. 5 is the method flow diagram of another file access method that the embodiment of the present invention provides;
Fig. 6 is the method flow diagram of a kind of file access method that another embodiment of the present invention provides;
Fig. 7 is the method flow diagram of a kind of access the second file that another embodiment of the present invention provides;
Fig. 8 is the method flow diagram of a kind of recovery the first file that another embodiment of the present invention provides;
Fig. 9 is the structural representation of a kind of file access system that the embodiment of the present invention provides;
Figure 10 is the structural representation of a kind of file access device that the embodiment of the present invention provides;
Figure 11 is that a kind of that the embodiment of the present invention provides sends the structural representation recovering command device;
Figure 12 is the structural representation that the embodiment of the present invention provides another kind of file access device;
Figure 13 is the structural representation of the first file access device that the embodiment of the present invention provides;
Figure 14 is the structural representation that the embodiment of the present invention provides another file access device;
Figure 15 is the structural representation that the embodiment of the present invention provides another file access device;
Figure 16 is the structural representation that another embodiment of the present invention provides a kind of file access device;
Figure 17 is the structural representation that another embodiment of the present invention provides another kind of file access device;
Figure 18 is the structural representation that another embodiment of the present invention provides another file access device;
Figure 19 is the structural representation that another embodiment of the present invention provides another file access device;
Figure 20 is the structural representation that further embodiment of this invention provides a kind of file access device;
Figure 21 is the structural representation that further embodiment of this invention provides another kind of file access device.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Please refer to Fig. 1, it illustrates the environmental structure schematic diagram of a kind of communication network involved by file access method that the embodiment of the present invention provides.This communication network relates to distributed system 00 and multiple client 01, and wherein, this distributed system 00 can comprise: a directory node 001 and multiple back end 002.Wherein, directory node 001 can manage the information of each back end 002, and each back end 002 can both all resources in visiting distribution formula system 00, and client 01 is by the resource in back end visiting distribution formula system 00.Example, as Fig. 1, client 01 comprises client 011, client 012 and client 013.Back end 002 comprises back end A, back end B and back end C, then any one in client 011, client 012 and client 013 can access all resources in this distributed system 00 by any one back end in back end A, back end B and back end C.
Fig. 2 is the method flow diagram of a kind of file access method that the embodiment of the present invention provides, and the method comprises:
Step 201, client access the first file by the first back end, obtain the fileinfo of the first file.
Step 202, directory node detect that the first back end breaks down, and send indication message to client.
Wherein, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Step 203, client, according to indication message, send to the second back end and recover instruction.
Concrete, this recovery instruction comprises the fileinfo of the first file.
Step 204, the second back end recover described first file according to the fileinfo of the first file.
Step 205, described client are by described first file of described second back end access.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Concrete, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, this handle recovers instruction and comprises this file open state information, and this lock Information recovering instruction comprises the lock information of this first file.
Wherein, step 203 comprises: client, according to indication message, sends handle respectively to the second back end and recovers instruction and the instruction of lock Information recovering.
Concrete, step 204 comprises: the second back end rebuilds the file handle of the first file according to File Open status information; Second back end is according to the lock information of lock information reconstruction first file of the first file.
It should be noted that, before step 202, the method also comprises:
Directory node generates the first accesses entry information, and it is to be repaired that this first accesses entry information is used to indicate the first file.
After step 203, the method also comprises:
Second back end sends accesses entry lastest imformation to directory node, and this accesses entry lastest imformation indicates described directory node to upgrade the first accesses entry information; Directory node upgrades the first accesses entry information according to accesses entry lastest imformation and obtains the second accesses entry information, and this second accesses entry information is used to indicate the first file and is recovered by the second back end.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Fig. 3 is the method flow diagram of the another kind of file access method that the embodiment of the present invention provides, and the method comprises:
Step 301, client access the first file by the first back end, obtain the fileinfo of the first file.
Step 302, client receive the indication message that directory node sends.
Wherein, this indication message is that directory node generates when detecting that the first back end breaks down, and this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Step 303, client, according to indication message, send to the second back end and recover instruction, so that the second back end carries out the recovery of the first file according to the fileinfo of the first file.
It should be noted that, this recovery instruction comprises the fileinfo of the first file.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Wherein, the fileinfo of this first file comprises: lock information and File Open status information, recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, and handle recovers instruction and comprises File Open status information, and the instruction of lock Information recovering comprises the lock information of the first file.
Concrete, step 303 comprises:
Client is according to indication message, send handle respectively to the second back end and recover instruction and the instruction of lock Information recovering, so that the second back end rebuilds the file handle of the first file according to File Open status information, according to the lock information of lock information reconstruction first file of the first file.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Fig. 4 is the method flow diagram of another file access method that the embodiment of the present invention provides, and the method comprises:
Step 401, the second back end receive the recovery instruction that client sends.
Concrete, this recovery instruction is that client generates after the indication message receiving directory node transmission, this indication message is that directory node generates when detecting that the first back end breaks down, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file, and this recovery instruction comprises the fileinfo of the first file.
Step 402, the second back end carry out the recovery of the first file according to the fileinfo of the first file.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
It should be noted that, before step 402, the method also comprises:
Second back end sends accesses entry lastest imformation to directory node, this accesses entry lastest imformation instruction directory node upgrades the first accesses entry information, so that directory node upgrades the first accesses entry information according to accesses entry lastest imformation obtain the second accesses entry information.
Wherein, this first accesses entry information generates when directory node detects that the first back end breaks down, and is used to indicate the first file to be repaired, and this second accesses entry information is used to indicate the first file and is recovered by the second back end.
Concrete, the fileinfo of this first file comprises: lock information and File Open status information, recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, and handle recovers instruction and comprises File Open status information, and the instruction of lock Information recovering comprises the lock information of the first file.
It should be noted that, step 402, comprising:
Handle in the recovery instruction that second back end sends according to client recovers the file handle that the first file is rebuild in instruction; The lock information of the first file is rebuild in lock Information recovering instruction in the recovery instruction that second back end sends according to client.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Fig. 5 is the method flow diagram of another file access method that the embodiment of the present invention provides, and the method comprises:
Step 501, directory node, when client accesses the first file by the first back end, if detect that the first back end breaks down, generate indication message.
Wherein, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Step 502, directory node send indication message to client, so that client sends recovery instruction according to indication message to the second back end.
Concrete, this recovery instruction comprises the fileinfo of the first file, and this recovery instruction is used to indicate the second back end carries out the first file recovery according to the fileinfo of the first file.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Concrete, after step 501, the method also comprises:
Directory node generates the first accesses entry information, and it is to be repaired that this first accesses entry information is used to indicate the first file.
It should be noted that, after step 502, the method also comprises: directory node receives the accesses entry lastest imformation that the second back end sends, and this accesses entry lastest imformation instruction directory node upgrades the first accesses entry information; Directory node upgrades the first accesses entry information according to accesses entry lastest imformation and obtains the second accesses entry information, and this second accesses entry information is used to indicate the first file and is recovered by the second back end.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Fig. 6 is the method flow diagram of a kind of file access method that another embodiment of the present invention provides, and for communication network as shown in Figure 1, the client that the invention process example assumes carries out file access is customer end A, and the method comprises:
Step 601, customer end A conduct interviews to the second file.
It should be noted that, this customer end A can be conducted interviews to this second file by the arbitrary back end in distributed system, and this distributed system can comprise a directory node and multiple back end.The invention process example assumes customer end A accesses the second file at initial time by the 3rd back end, concrete, and as shown in Figure 7, step 601 can comprise:
Step 6011, customer end A send request of access to the 3rd back end.Perform step 6012.
Wherein, this request of access is used to indicate this customer end A and accesses the second file, and this request of access can comprise the mark of the second file.
Step 6012, the 3rd back end send Access status inquiry request to directory node.Perform step 6013.
It should be noted that, whether this Access status inquiry request is used to indicate this directory node and inquires about the second file and be buffered.
Whether step 6013, directory node, according to this Access status inquiry request, detect this second file and are buffered.If so, step 6014 is performed.If not, step 6019 is performed.
Concrete, when client accesses arbitrary file by specific back end, this file can carry out buffer memory at this particular data node.When this specific back end access and this file of buffer memory time, directory node can generate accesses entry information corresponding to this particular data node, accesses entry information corresponding to this particular data node is for recording the file of client-access by this specific back end buffer memory, i.e. the corresponding relation of client, this specific back end and accessed file.By detecting accesses entry information corresponding to each back end, directory node can determine whether this back end is cached with this file, therefore, in embodiments of the present invention, directory node can go to detect accesses entry information corresponding to each back end according to the mark of the second file, when the accesses entry information corresponding to the mark that there is this second file in the accesses entry information that each back end is corresponding, the back end that there is corresponding relation with the second file then can be obtained from the accesses entry information corresponding to the mark of this second file, correspondingly determine this back end is cached with the second file, when the accesses entry information corresponding to the mark that there is not this second file in the accesses entry information that each back end is corresponding, then determine that this second file is not buffered.
Step 6014, this second file detected by the 4th back end buffer memory when directory node, generate Access status inquiry response.Perform step 6015.
It should be noted that, when the 4th back end accesses the second file, real-time buffer memory can be carried out to the second file, accordingly, this directory node can generate the 3rd accesses entry information, and the 3rd accesses entry information, for recording the second file by the 4th back end buffer memory, namely records the corresponding relation of the 4th back end and the second file, so that whether directory node is buffered according to this second file of the 3rd accesses entry infomation detection, thus generate Access status inquiry response.Especially, the 3rd accesses entry information can also record the corresponding relation of client, specific back end and accessed file, in embodiments of the present invention, namely have recorded the corresponding relation of customer end A, the 4th back end and the second file.Example, the 3rd accesses entry information can be: " file2-DataServer4:normal ", i.e. the second file-four back end: normal, represents that the second file is normally accessed and buffer memory by the 4th back end.If access terminates, then in the 4th back end, corresponding buffer memory is released, and directory node can delete the 3rd accesses entry information.
Due to current directory nodal test to the second file by the 4th back end buffer memory, then generate Access status inquiry response, this Access status inquiry response is used to indicate client and accesses the second file by the 4th back end.
Step 6015, to the 3rd back end send status poll response.Perform step 6016.
Step 6016, the 3rd back end generate particular error code according to status poll response.Perform step 6017.
It should be noted that, 3rd back end generates particular error code according to status poll response, in order to after the 4th back end carries out buffer memory to this second file, instruction customer end A carries out the access of the second file by the 4th back end, so, only allow to be conducted interviews to this second file by the 4th back end, other back end are avoided to visit this process of caching caused by the second file, reduce different pieces of information node to the repetition buffer memory of identical file, therefore, reduce taking Installed System Memory, reduce system loading.
Step 6017, the 3rd back end send this particular error code to customer end A.Perform step 6018.
Step 6018, customer end A, according to this particular error code, access this second file by the 4th back end.
It should be noted that, customer end A is when carrying out the second file access by the 4th back end, 4th back end can increase accesses entry information corresponding to this second file in this directory node, this accesses entry information can be: " file2-DataServer4-ClientA:normal ", i.e. second file-four back end-customer end A-normal, represents that customer end A carries out normal access and buffer memory by the 4th back end to this second file.
Step 6019, customer end A access the second file by the 3rd back end.
Be not buffered when this directory node detects the second file, then show currently do not have back end to access and be cached this second file, therefore directly can be carried out access and the buffer memory of the second file by the 3rd back end.When carrying out the second file access by the 3rd back end, accesses entry information corresponding to second file can be increased in this directory node, this accesses entry information can be: " file2-DataServer3-ClientA:normal ", second file-three back end-customer end A, represents that customer end A carries out normal access and buffer memory by the 3rd back end to this second file.
Step 602, customer end A access the first file by the first back end.
It should be noted that, this customer end A can be conducted interviews to this first file by the arbitrary back end in distributed system, the invention process example assumes customer end A carries out the access of the first file by the first back end, when customer end A carries out the access process of the first file by other back end, identical with the process that the first back end carries out the access of the first file, the embodiment of the present invention does not repeat this.
Concrete, customer end A can to the first back end transmission request information, this solicited message is for asking the information of the first file, the information of this first file comprises the content of the first file and the fileinfo of the first file, and the fileinfo of this first file can comprise: lock information and File Open status information.This lock information is used for when the information of this first back end this first file of buffer memory, avoids other back end to carry out buffer memory to the information of this file, prevents multiple back end from accessing also buffer memory identical file simultaneously and causes system file mistake.This file open state information is used for the state of identification document, example, the state of file can be read-only with read-write etc. state.First back end, according to this solicited message, obtains the information of the first file in a distributed system, and sends to customer end A.
Step 603, customer end A, when accessing the first file by the first back end, obtain the fileinfo of this first file.
Customer end A, after the information of acquisition first file, can be extracted the fileinfo of this first file, and be kept at customer end A from the information of the first file.
Step 604, this directory node, when detecting that this first back end breaks down, generate indication message.
Example, directory node periodically can detect whether this first back end breaks down, concrete, this directory node detects the process that this first back end breaks down: this directory node sends Detection Information every prefixed time interval to this first back end, this prefixed time interval can be 5s (second), first back end is after this Detection Information of reception, send to this directory node and detect response message, do not break down to indicate this first back end.If this directory node does not receive the detection response message that this first back end sends within the time period of presetting, then this directory node judges that this first back end breaks down, and this time period can be more than one prefixed time interval, as 5s-10s.
It should be noted that, when customer end A carries out the access of the first file by this first back end, this directory node can increase the accesses entry information that this first file is corresponding, this accesses entry information is used to indicate customer end A and accesses the first file by the first back end, namely have recorded customer end A, the corresponding relation of the first back end and the first file, therefore, after the first back end breaks down, directory node can determine a back end in the back end do not broken down, and notify that this customer end A carries out failover by this back end.This directory node established data node of the invention process example assumes is the second back end, then directory node indicate described customer end A to notify by indication message the second back end carries out the recovery of described first file, after the first file access pattern, carry out the access of the first file again.
Step 605, this directory node generate the first accesses entry information.
Wherein, this the first accesses entry information is used to indicate this customer end A to be needed to repair by the first file that the first back end is accessed, namely have recorded customer end A, the corresponding relation of the first back end and the first file, this the first accesses entry information represents that the back end only allowing directory node to select carries out recovery operation to this first file, the system file mistake preventing from other back end from visiting this first file causing, the back end that this directory node of the invention process example assumes is selected is the second back end, example, this the first accesses entry information can be: " file1-DataServer1-ClientA:recovery ", first file the-the first back end-customer end A: recover, represent customer end A by this first back end to this first file conduct interviews and buffer memory there is fault, this first file is in and returns to form.
Step 606, directory node send indication message to this customer end A.
This indication message can comprise the mark of the second back end, so that customer end A determines this second back end according to the mark of this second back end.
Step 607, customer end A, according to this indication message, carry out the recovery of the first file with the second back end.
In practical application, customer end A is according to this indication message, send to this second back end and recover instruction, this recovery instruction can comprise: recover indication information, the instruction of network connection reconstruction, handle recovery instruction and the instruction of lock Information recovering, the second back end carries out the recovery of the first file according to this recovery instruction.As shown in Figure 8, the rejuvenation that customer end A and the second back end carry out the first file specifically comprises:
Step 6071, customer end A send to the second back end recovers indication information.
This recovery indication information triggers the recovery that the second back end carries out the first file.
Step 6072, customer end A send the instruction of network connection reconstruction to the second back end.
This network connection reconstruction instruction indicates the second back end to carry out the reconstruction of network connection.
Step 6073, the second back end send the response of network connection reconstruction to customer end A.
The network connection reconstruction instruction that second back end sends according to customer end A, connect network and rebuild, generating network connection reconstruction responds.When customer end A receives the response of this network connection reconstruction, the network connection reconstruction success of customer end A and the second back end, this network connects for transmitting the data entrained by recovering in instruction, as handle recovers instruction and the instruction of lock Information recovering.
Step 6074, customer end A send handle to the second back end and recover instruction.
This handle recovers instruction and indicates the second back end to carry out the recovery of the first file handle, and it is that the network set up by step 6073 connects transmission that this handle recovers instruction, and this handle recovers instruction and comprises this file open state information.
Step 6076, the second back end send handle to customer end A and recover response.
The handle that second back end sends according to customer end A recovers instruction, the handle of this first file is recovered, it should be noted that, handle (handle) is a kind of special intelligent pointer, the different memory address of the object be used in identification application, application program can access the information of corresponding object by handle, then can be had access to the corresponding information of the first file by the handle of the first file.Second back end needs to recover the handle of the first file, the access of the corresponding information of the first file before the first back end breaks down could be realized, therefore the second back end according to the File Open status information that handle recovers in instruction the handle of the first file can be returned to the first back end break down before state, realize the recovery of the handle of the first file, correspondingly generate handle and recover response, and be sent to customer end A by the network connection that step 6073 is set up.
Step 6076, customer end A send the instruction of lock Information recovering to the second back end.
This lock Information recovering instruction indicates the second back end to carry out the recovery of the first file lock information, and this lock Information recovering instruction is that the network set up by step 6073 connects transmission, and this lock Information recovering instruction comprises the lock information of this first file.
Step 6077, the second back end send the response of lock Information recovering to customer end A.
Second back end is according to the lock information of the first file in the instruction of lock Information recovering, the lock information of this first file is recovered, state before being broken down by lock Information recovering to the first back end of the first file, generates the response of lock Information recovering and is sent to customer end A by the network connection that step 6073 is set up.
It should be noted that, before step 6072, second back end can also send accesses entry lastest imformation to this directory node, be used to indicate directory node with new first accesses entry information, this directory node is according to this accesses entry lastest imformation, and the first accesses entry information that upgrades obtains the second accesses entry information.
This second accesses entry information have recorded the corresponding relation of customer end A, the second back end and the first file, is mainly used in indicating this first file to be recovered by this second back end.Concrete, first accesses entry information " file1-DataServer1-ClientA:recovery " becomes the second accesses entry information " file1-DataServer2-ClientA:normal " after upgrading, namely, first file the-the first back end-customer end A: recover, become, first file the-the second back end-customer end A: normal, represent customer end A by the first back end to the first file access and buffer memory break down and after repairing, become customer end A, by the second back end, also buffer memory is normally accessed to the first file.Follow-up recovery operation can be carried out after renewal rewards theory success.
Especially, upgrading items for information is in order to when this first back end breaks down, and only allow the back end that directory node is specified, namely the second back end carries out recovery operation to this first file, prevent now other back end from visiting this first file, avoid system file mistake.
In sum, in the method for the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
As shown in Figure 9, the embodiment of the present invention provides a kind of file access system 90, and this file access system 90 can the communication network shown in reference diagram 1, comprising:
Client 901, directory node 902 and the second back end 903.
Client 901, for accessing the first file by the first back end, obtains the fileinfo of the first file.
Directory node 902, for detecting that the first back end breaks down, send indication message to client, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Client 901 is also for according to indication message, and send to the second back end and recover instruction, this recovery instruction comprises the fileinfo of the first file.
Second back end 903, for carrying out the recovery of the first file according to the fileinfo of the first file.
Client 901, also for accessing described first file by described second back end.
In sum, in the system of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Concrete, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, and handle recovers instruction and comprises File Open status information, and the instruction of lock Information recovering comprises the lock information of the first file.
It should be noted that, client 901, specifically for according to indication message, sends handle respectively to the second back end and recovers instruction and the instruction of lock Information recovering.
Wherein, the second back end 903 specifically for:
The file handle of the first file is rebuild according to File Open status information; According to the lock information of lock information reconstruction first file of the first file.
Example, directory node 902 is also for generating the first accesses entry information, and it is to be repaired that this first accesses entry information is used to indicate the first file.
It should be noted that, the second back end 903 is also for sending accesses entry lastest imformation to directory node, and accesses entry lastest imformation indicates described directory node to upgrade the first accesses entry information.
Directory node 902 also obtains the second accesses entry information for upgrading the first accesses entry information according to accesses entry lastest imformation, and the second accesses entry information is used to indicate the first file and is recovered by the second back end.
In sum, in the system of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
The embodiment of the present invention provides a kind of file access device 100, and as shown in Figure 10, this file access device can be client, and this file access device comprises: acquiring unit 1001, receiving element 1002 and transmitting element 1003.
Acquiring unit 1001, for accessing the first file by the first back end, obtains the fileinfo of the first file.
Receiving element 1002, for receiving the indication message that directory node sends, this indication message is that directory node generates when detecting that the first back end breaks down, and this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Transmitting element 1003, for according to indication message, sends to the second back end and recovers instruction, recover the fileinfo that instruction comprises the first file, so that the second back end carries out the recovery of the first file according to the fileinfo of the first file.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
It should be noted that, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, and handle recovers instruction and comprises File Open status information, and the instruction of lock Information recovering comprises the lock information of the first file.
Wherein, as shown in figure 11, transmitting element 1003 comprises:
Sending module 10031, for according to indication message, send handle respectively to the second back end and recover instruction and the instruction of lock Information recovering, so that the second back end rebuilds the file handle of the first file according to File Open status information, according to the lock information of lock information reconstruction first file of the first file.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
The embodiment of the present invention provides another kind of file access device 120, and as shown in figure 12, this file access device can be the second back end, and this file access device comprises: receiving element 1201 and recovery unit 1202.
Receiving element 1201, for receiving the recovery instruction that client sends, this recovery instruction is that client generates after the indication message receiving directory node transmission, this indication message is that directory node generates when detecting that the first back end breaks down, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file, and this recovery instruction comprises the fileinfo of the first file.
Recovery unit 1202, for carrying out the recovery of the first file according to the fileinfo of the first file.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
It should be noted that, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, this handle recovers instruction and comprises File Open status information, and this lock Information recovering instruction comprises the lock information of the first file.
Concrete, as shown in figure 13, recovery unit 1202 comprises:
First rebuilds module 12021, rebuilds the file handle of the first file for the handle recovery instruction in the recovery instruction that sends according to client.
Second rebuilds module 12022, rebuilds the lock information of the first file for the lock Information recovering instruction in the recovery instruction that sends according to client.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
The embodiment of the present invention provides another file access device 120, and as shown in figure 14, this file access device can be the second back end, and this file access device comprises: receiving element 1201, recovery unit 1202 and transmitting element 1203.
Receiving element 1201, for receiving the recovery instruction that client sends, this recovery instruction is that client generates after the indication message receiving directory node transmission, this indication message is that directory node generates when detecting that the first back end breaks down, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file, and this recovery instruction comprises the fileinfo of the first file.
Recovery unit 1202, for carrying out the recovery of the first file according to the fileinfo of the first file.
Transmitting element 1203, for sending accesses entry lastest imformation to directory node, accesses entry lastest imformation instruction directory node upgrades the first accesses entry information, so that directory node upgrades the first accesses entry information according to accesses entry lastest imformation obtain the second accesses entry information.
Wherein, this first accesses entry information generates when directory node detects that the first back end breaks down, and is used to indicate the first file to be repaired, and this second accesses entry information is used to indicate the first file and is recovered by the second back end.
It should be noted that, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, this handle recovers instruction and comprises File Open status information, and this lock Information recovering instruction comprises the lock information of the first file.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
The embodiment of the present invention provides another file access device 150, and as shown in figure 15, this file access device can be directory node, and this file access device comprises: the first generation unit 1501 and transmitting element 1502.
First generation unit 1501, for when client accesses the first file by the first back end, if detect that the first back end breaks down, generate indication message, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Transmitting element 1502, for sending indication message to client, so that client sends recovery instruction according to indication message to the second back end, this recovery instruction comprises the fileinfo of the first file, and this recovery instruction is used to indicate the second back end carries out the first file recovery according to the fileinfo of the first file.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Another embodiment of the present invention provides a kind of file access device 150, and as shown in figure 16, this file access device can be directory node, this file access device comprises: the first generation unit 1501, transmitting element 1502, the second generation unit 1503, receiving element 1504 and updating block 1505.
First generation unit 1501, for when client accesses the first file by the first back end, if detect that the first back end breaks down, generate indication message, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Transmitting element 1502, for sending indication message to client, so that client sends recovery instruction according to indication message to the second back end, this recovery instruction comprises the fileinfo of the first file, and this recovery instruction is used to indicate the second back end carries out the first file recovery according to the fileinfo of the first file.
Second generation unit 1503, for generating the first accesses entry information, it is to be repaired that this first accesses entry information is used to indicate the first file.
Receiving element 1504, for receiving the accesses entry lastest imformation that the second back end sends, this accesses entry lastest imformation instruction directory node upgrades the first accesses entry information.
Updating block 1505, obtain the second accesses entry information for upgrading the first accesses entry information according to accesses entry lastest imformation, this second accesses entry information is used to indicate the first file and is recovered by the second back end.
In sum, in the device of the file access provided due to the embodiment of the present invention, the fileinfo of client records first file, and be sent to the second back end, recovery to the first file is completed according to this fileinfo by the second back end, without the need to the fileinfo of the first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Another embodiment of the present invention provides another kind of file access device 170, and as shown in figure 17, this file access device can be client, and this file access device comprises: processor 1701, receiver 1702 and transmitter 1703.
Processor 1701, for accessing the first file by the first back end, obtains the fileinfo of the first file.
Receiver 1702, for receiving the indication message that directory node sends, this indication message is that directory node generates when detecting that the first back end breaks down, and this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Transmitter 1703, for according to indication message, sends to the second back end and recovers instruction, recover the fileinfo that instruction comprises the first file, so that the second back end carries out the recovery of the first file according to the fileinfo of the first file.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
It should be noted that, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, this handle recovers instruction and comprises File Open status information, and this lock Information recovering instruction comprises the lock information of the first file.
This transmitter 1703 is also for according to indication message, send handle respectively to the second back end and recover instruction and the instruction of lock Information recovering, so that the second back end rebuilds the file handle of the first file according to File Open status information, according to the lock information of lock information reconstruction first file of the first file.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Another embodiment of the present invention provides another file access device 180, and as shown in figure 18, this file access device can be the second back end, and this file access device comprises: receiver 1801 and processor 1802.
Receiver 1801, for receiving the recovery instruction that client sends, this recovery instruction is that client generates after the indication message receiving directory node transmission, this indication message is that directory node generates when detecting that the first back end breaks down, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file, and this recovery instruction comprises the fileinfo of the first file.
Processor 1802, for carrying out the recovery of the first file according to the fileinfo of the first file.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
It should be noted that, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, this handle recovers instruction and comprises File Open status information, and this lock Information recovering instruction comprises the lock information of the first file.
This processor 1802 also recovers for the handle in the recovery instruction that sends according to client the file handle that the first file is rebuild in instruction.
This processor 1802 rebuilds the lock information of the first file for the lock Information recovering instruction in the recovery instruction that sends according to client.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Another embodiment of the present invention provides another file access device 180, and as shown in figure 19, this file access device can be the second back end, and this file access device comprises: receiver 1801, processor 1802 and transmitter 1803.
Receiver 1801, for receiving the recovery instruction that client sends, this recovery instruction is that client generates after the indication message receiving directory node transmission, this indication message is that directory node generates when detecting that the first back end breaks down, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file, and this recovery instruction comprises the fileinfo of the first file.
Processor 1802, for carrying out the recovery of the first file according to the fileinfo of the first file.
Transmitter 1803, for sending accesses entry lastest imformation to directory node, accesses entry lastest imformation instruction directory node upgrades the first accesses entry information, so that directory node upgrades the first accesses entry information according to accesses entry lastest imformation obtain the second accesses entry information.
Wherein, this first accesses entry information generates when directory node detects that the first back end breaks down, and is used to indicate the first file to be repaired, and this second accesses entry information is used to indicate the first file and is recovered by the second back end.
It should be noted that, the fileinfo of this first file comprises: lock information and File Open status information, this recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, this handle recovers instruction and comprises File Open status information, and this lock Information recovering instruction comprises the lock information of the first file.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Further embodiment of this invention provides a kind of file access device 200, and as shown in figure 20, this file access device can be directory node, and this file access device comprises: processor 2001 and transmitter 2002.
Processor 2001, for when client accesses the first file by the first back end, if detect that the first back end breaks down, generate indication message, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Transmitter 2002, for sending indication message to client, so that client sends recovery instruction according to indication message to the second back end, this recovery instruction comprises the fileinfo of the first file, and this recovery instruction is used to indicate the second back end carries out the first file recovery according to the fileinfo of the first file.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
Further embodiment of this invention provides another kind of file access device 200, and as shown in figure 21, this file access device can be directory node, and this file access device comprises: processor 2001, transmitter 2002 and receiver 2003.
Processor 2001, for when client accesses the first file by the first back end, if detect that the first back end breaks down, generate indication message, this indication message is used to indicate client and notifies that the second back end carries out the recovery of the first file.
Transmitter 2002, for sending indication message to client, so that client sends recovery instruction according to indication message to the second back end, this recovery instruction comprises the fileinfo of the first file, and this recovery instruction is used to indicate the second back end carries out the first file recovery according to the fileinfo of the first file.
This processor 2001 is also for generating the first accesses entry information, and it is to be repaired that this first accesses entry information is used to indicate the first file.
Receiver 2003, for receiving the accesses entry lastest imformation that the second back end sends, this accesses entry lastest imformation instruction directory node upgrades the first accesses entry information.
This processor 2001 also obtains the second accesses entry information for upgrading the first accesses entry information according to accesses entry lastest imformation, and this second accesses entry information is used to indicate the first file and is recovered by the second back end.
In sum, due in the file access device that the embodiment of the present invention provides, the fileinfo of client records first file, and be sent to the second back end by transmitter, recovery to this first file is completed according to this fileinfo by processor, without the need to the fileinfo of this first file being write on disk or other back end, decrease taking the disk space in distributed system or overall system internal memory, and the second back end is without the need to communicating, because this reducing system loading by sending I/O request to disk or other back end.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (20)

1. a file access method, is characterized in that, comprising:
Client accesses the first file by the first back end, obtains the fileinfo of described first file;
Directory node detects that described first back end breaks down, and send indication message to described client, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described client is according to described indication message, and send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file;
Described second back end recovers described first file according to the fileinfo of described first file;
Described client is by described first file of described second back end access.
2. method according to claim 1, it is characterized in that, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described client, according to described indication message, sends to described second back end and recovers instruction, comprising:
Described client, according to described indication message, sends described handle respectively to described second back end and recovers instruction and the instruction of described lock Information recovering;
Described second back end carries out the recovery of described first file according to the fileinfo of described first file, comprising:
Described second back end rebuilds the file handle of described first file according to described File Open status information;
The lock information of described second back end first file according to the lock information reconstruction of described first file.
3. method according to claim 1 and 2, is characterized in that, detects that described first back end breaks down in described directory node, and before sending indication message to described client, described method also comprises:
Described directory node generates the first accesses entry information, and it is to be repaired that described first accesses entry information is used to indicate described first file;
In described client according to described indication message, after described second back end sends recovery instruction, described method also comprises:
Described second back end sends accesses entry lastest imformation to described directory node, and described accesses entry lastest imformation instruction upgrades described first accesses entry information;
Described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation and obtains the second accesses entry information, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
4. a file access method, is characterized in that, comprising:
Client accesses the first file by the first back end, obtains the fileinfo of described first file;
Described client receives the indication message that directory node sends, described indication message is that described directory node generates when detecting that described first back end breaks down, and described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described client is according to described indication message, send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file, so that described second back end carries out the recovery of described first file according to the fileinfo of described first file.
5. method according to claim 4, it is characterized in that, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described client, according to described indication message, sends to described second back end and recovers instruction, comprising:
Described client is according to described indication message, send described handle respectively to described second back end and recover instruction and the instruction of described lock Information recovering, so that described second back end rebuilds the file handle of described first file according to described File Open status information, the lock information of the first file according to the lock information reconstruction of described first file.
6. a file access method, is characterized in that, comprising:
Second back end receives the recovery instruction that client sends, described recovery instruction is that described client generates after the indication message receiving directory node transmission, described indication message is that described directory node generates when detecting that described first back end breaks down, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file, and described recovery instruction comprises the fileinfo of described first file;
Described second back end carries out the recovery of described first file according to the fileinfo of described first file.
7. method according to claim 6, is characterized in that, before described second back end carries out the recovery of described first file according to the fileinfo of described first file, described method also comprises:
Described second back end sends accesses entry lastest imformation to described directory node, described accesses entry lastest imformation indicates described directory node to upgrade the first accesses entry information, so that described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation obtain the second accesses entry information;
Wherein, described first accesses entry information generates when described directory node detects that described first back end breaks down, be used to indicate described first file to be repaired, described second accesses entry information is used to indicate described first file and is recovered by described second back end.
8. the method according to claim 6 or 7, it is characterized in that, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described second back end carries out the recovery of described first file according to the fileinfo of described first file, comprising:
Handle in the recovery instruction that described second back end sends according to described client recovers the file handle that described first file is rebuild in instruction;
The lock information of described first file is rebuild in lock Information recovering instruction in the recovery instruction that described second back end sends according to described client.
9. a file access method, is characterized in that, comprising:
Directory node is when client accesses the first file by the first back end, if detect that described first back end breaks down, generate indication message, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described directory node sends described indication message to client, so that described client sends recovery instruction according to described indication message to described second back end, described recovery instruction comprises the fileinfo of described first file, and described recovery instruction is used to indicate described second back end carries out described first file recovery according to the fileinfo of described first file.
10. method according to claim 9, is characterized in that, after described directory node generates indication message, described method also comprises:
Described directory node generates the first accesses entry information, and it is to be repaired that described first accesses entry information is used to indicate described first file;
After described directory node sends described indication message to client, described method also comprises:
Described directory node receives the accesses entry lastest imformation that described second back end sends, and described accesses entry lastest imformation indicates described directory node to upgrade described first accesses entry information;
Described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation and obtains the second accesses entry information, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
11. 1 kinds of file access system, is characterized in that, comprising:
Client, directory node and the second back end,
Described client, for accessing the first file by the first back end, obtains the fileinfo of described first file;
Described directory node, for detecting that described first back end breaks down, send indication message to described client, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Described client is also for according to described indication message, and send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file;
Described second back end, for carrying out the recovery of described first file according to the fileinfo of described first file;
Described client, also for accessing described first file by described second back end.
12. systems according to claim 11, it is characterized in that, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described client, specifically for according to described indication message, sends described handle respectively to described second back end and recovers instruction and the instruction of described lock Information recovering;
Described second back end specifically for:
The file handle of described first file is rebuild according to described File Open status information;
The lock information of the first file according to the lock information reconstruction of described first file.
13. systems according to claim 11 or 12, is characterized in that,
Described directory node is also for generating the first accesses entry information, and it is to be repaired that described first accesses entry information is used to indicate described first file;
Described second back end is also for sending accesses entry lastest imformation to described directory node, and described accesses entry lastest imformation instruction upgrades described first accesses entry information;
Described directory node also obtains the second accesses entry information for upgrading described first accesses entry information according to described accesses entry lastest imformation, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
14. 1 kinds of file access devices, is characterized in that, comprising:
Acquiring unit, for accessing the first file by the first back end, obtains the fileinfo of described first file;
Receiving element, for receiving the indication message that directory node sends, described indication message is that described directory node generates when detecting that described first back end breaks down, and described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Transmitting element, for according to described indication message, send to described second back end and recover instruction, described recovery instruction comprises the fileinfo of described first file, so that described second back end carries out the recovery of described first file according to the fileinfo of described first file.
15. devices according to claim 14, it is characterized in that, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described transmitting element comprises:
Sending module, for according to described indication message, send described handle respectively to described second back end and recover instruction and the instruction of described lock Information recovering, so that described second back end rebuilds the file handle of described first file according to described File Open status information, the lock information of the first file according to the lock information reconstruction of described first file.
16. 1 kinds of file access devices, is characterized in that, comprising:
Receiving element, for receiving the recovery instruction that client sends, described recovery instruction is that described client generates after the indication message receiving directory node transmission, described indication message is that described directory node generates when detecting that described first back end breaks down, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file, and described recovery instruction comprises the fileinfo of described first file;
Recovery unit, for carrying out the recovery of described first file according to the fileinfo of described first file.
17. devices according to claim 16, is characterized in that, described device also comprises:
Transmitting element, for sending accesses entry lastest imformation to described directory node, described accesses entry lastest imformation indicates described directory node to upgrade the first accesses entry information, so that described directory node upgrades described first accesses entry information according to described accesses entry lastest imformation obtain the second accesses entry information;
Wherein, described first accesses entry information generates when described directory node detects that described first back end breaks down, be used to indicate described first file to be repaired, described second accesses entry information is used to indicate described first file and is recovered by described second back end.
18. devices according to claim 16 or 17, it is characterized in that, the fileinfo of described first file comprises: lock information and File Open status information, described recovery instruction comprises: handle recovers instruction and the instruction of lock Information recovering, described handle recovers instruction and comprises described File Open status information, and the instruction of described lock Information recovering comprises the lock information of described first file;
Described recovery unit comprises:
First rebuilds module, recovers for the handle in the recovery instruction that sends according to described client the file handle that described first file is rebuild in instruction;
Second rebuilds module, rebuilds the lock information of described first file for the lock Information recovering instruction in the recovery instruction that sends according to described client.
19. 1 kinds of file access devices, is characterized in that, comprising:
First generation unit, for when client accesses the first file by the first back end, if detect that described first back end breaks down, generate indication message, described indication message is used to indicate described client and notifies that the second back end carries out the recovery of described first file;
Transmitting element, for sending described indication message to client, so that described client sends recovery instruction according to described indication message to described second back end, described recovery instruction comprises the fileinfo of described first file, and described recovery instruction is used to indicate described second back end carries out described first file recovery according to the fileinfo of described first file.
20. devices according to claim 19, is characterized in that, described device also comprises:
Second generation unit, for generating the first accesses entry information, it is to be repaired that described first accesses entry information is used to indicate described first file;
Receiving element, for receiving the accesses entry lastest imformation that described second back end sends, described accesses entry lastest imformation indicates described directory node to upgrade described first accesses entry information;
Updating block, obtains the second accesses entry information for upgrading described first accesses entry information according to described accesses entry lastest imformation, and described second accesses entry information is used to indicate described first file and is recovered by described second back end.
CN201410421369.XA 2014-08-25 2014-08-25 The method, apparatus and system of file access Active CN104239425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410421369.XA CN104239425B (en) 2014-08-25 2014-08-25 The method, apparatus and system of file access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410421369.XA CN104239425B (en) 2014-08-25 2014-08-25 The method, apparatus and system of file access

Publications (2)

Publication Number Publication Date
CN104239425A true CN104239425A (en) 2014-12-24
CN104239425B CN104239425B (en) 2017-11-17

Family

ID=52227485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410421369.XA Active CN104239425B (en) 2014-08-25 2014-08-25 The method, apparatus and system of file access

Country Status (1)

Country Link
CN (1) CN104239425B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557390A (en) * 2016-11-15 2017-04-05 郑州云海信息技术有限公司 A kind of distributed storage file connected reference method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101059807A (en) * 2007-01-26 2007-10-24 华中科技大学 Method and system for promoting metadata service reliability
CN101692226A (en) * 2009-09-25 2010-04-07 中国人民解放军国防科学技术大学 Storage method of mass filing stream data
CN102346779A (en) * 2011-10-18 2012-02-08 中国联合网络通信集团有限公司 Distributed file system and master control node backup method
US20130110874A1 (en) * 2008-10-14 2013-05-02 Camstar Systems, Inc. System and method for combination-based data analysis

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101059807A (en) * 2007-01-26 2007-10-24 华中科技大学 Method and system for promoting metadata service reliability
US20130110874A1 (en) * 2008-10-14 2013-05-02 Camstar Systems, Inc. System and method for combination-based data analysis
CN101692226A (en) * 2009-09-25 2010-04-07 中国人民解放军国防科学技术大学 Storage method of mass filing stream data
CN102346779A (en) * 2011-10-18 2012-02-08 中国联合网络通信集团有限公司 Distributed file system and master control node backup method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557390A (en) * 2016-11-15 2017-04-05 郑州云海信息技术有限公司 A kind of distributed storage file connected reference method and system

Also Published As

Publication number Publication date
CN104239425B (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN102223394B (en) Methods and servers to provide remote direct access of solid-state storage
CN101022363B (en) Network storage equipment fault protecting method and device
US11307776B2 (en) Method for accessing distributed storage system, related apparatus, and related system
US8626936B2 (en) Protocol independent server replacement and replication in a storage area network
CN103392167A (en) Caching method of distributed storage system, nodes and computer readable medium
CN110535692A (en) Fault handling method, device, computer equipment, storage medium and storage system
EP2723017A1 (en) Method, apparatus and system for implementing distributed auto-incrementing counting
CN105159795A (en) Data synchronization method, apparatus and system
CN104252466A (en) Stream computing processing method, equipment and system
CN103986779B (en) A kind of application data transmission method, device and terminal device
CN103780417A (en) Database failure transfer method based on cloud hard disk and device thereof
CN101594256A (en) Disaster recovery method, device and system
CN103716174A (en) Test log acquisition system and method for the same
CN103544095A (en) Server program monitoring method and system of server program
CN114003439B (en) Data backup method, device, equipment and storage medium
CN107864209B (en) Data writing method and device and server
CN108205482B (en) File mount restoration methods
US20140115112A1 (en) Server system and message processing method thereof
CN103324554A (en) Standby system device, a control method, and a program thereof
CN101217591A (en) A method and system realizing snooping data storage
CN105573872A (en) Hardware maintenance method and device of data storage system
CN104407806B (en) The amending method and device of RAID group hard disc information
CN103714059A (en) Data updating method and device
CN101986703A (en) Video recording method, network video surveillance system and front end as well as scheduling server
CN110879760B (en) Unified storage system and method and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant