Specific embodiment
The feature and exemplary embodiment of the various aspects of the application is described more fully below, in order to make the mesh of the application
, technical solution and advantage be more clearly understood, with reference to the accompanying drawings and embodiments, the application is further retouched in detail
It states.It should be understood that specific embodiment described herein is only configured to explain the application, it is not configured as limiting the application.
To those skilled in the art, the application can be real in the case where not needing some details in these details
It applies.Below the description of embodiment is used for the purpose of better understanding the application to provide by showing the example of the application.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence " including ... ", it is not excluded that including
There is also other identical elements in the process, method, article or equipment of the element.
It should be noted that since read request of the user to data in distributed system (reads number from distributed system
According to state, referred to as " read request ") change distributed system in data state, therefore, to data in distributed system
Read request can with generate snapshot carry out simultaneously, namely to generate distributed system snapshot when, do not influence to distribution
The normal execution of data read request in system.The embodiment of the present application is mainly illustrated by taking write request as an example, still, this field skill
Art personnel it should be understood that in the embodiment of the present application related to write request part, can be extended to and read request and write
Request.
Traditional snapshot generates scheme, in order to guarantee the consistency of snapshot, it is desirable that receives the institute after snapshot generation request
There is write request to the change of data mode not in snapshot, while receiving snapshot and generating all write request logarithms before request
According to the change of state in snapshot.Therefore, it is generated after receiving snapshot and generating request to snapshot during completing, it can be to user
Write request blocked, and this certainly will will affect the normal use of user, for some applications for needing to be continuously written into data
Scene, traditional snapshot generate scheme and cannot be applicable in.
Inventor has found during realizing the application, after user submits a write request, if system not to
User returns to the completed calculated result of the write request, and it is complete to the change of data mode that user is not generally regarded as this write request
At, namely before system does not return to the completed calculated result of the request to user, user is not aware that this write request
To the progress of data mode change.
Based on this, inventors have found that in a distributed system, user asks for receiving snapshot generation in distributed system
It is submitting before asking and receive snapshot in distributed system and generate not yet to return after request and writing for calculated result is completed asks
It asks, since user is not aware that the progress that the write request changes data mode, user is not to be especially concerned about that this is write to ask
Ask the change to data mode whether in snapshot.
In view of this, the snapshot that the embodiment of the present application provides a kind of distributed system generates scheme, receive for distribution
The write request of formula system;If write request receives after receiving the snapshot for distributed system and generating request, to record
The original metadata of object storage location is backed up in distributed system, obtains backup metadata;It is held for original metadata
The write request that row receives after receiving snapshot generation request, executes snapshot for backup metadata and generates request.
The snapshot of distributed system provided by the embodiments of the present application generates scheme, by object in record distributed system
The original metadata of storage location is backed up, and backup metadata is obtained, and makes it possible to receiving for original metadata execution
Snapshot generates the write request received after request, while executing snapshot for backup metadata and generating request, namely realizing
While generating distributed system snapshot, response user is directed to the write request of distributed system.
In one example, the write request for being directed to distributed system is received, which can be user and be sent directly to
Distributed system, it is also possible to user by other equipment and is sent to distributed system, the application does not limit this.Its
In, distributed system can include but is not limited to: distributed file system, distributed memory system, distributed data base system
Deng.
It in one embodiment, in order to facilitate the determining write request received is sent out before receiving snapshot and generating request
The write request sent, or the write request sent after request is generated receiving snapshot, if user can know that distributed system connects
At the time of receiving snapshot generation request, then user can receive when sending write request to distributed system in distributed system
Preset mark is added in the write request sent after generating the request moment to snapshot, receives snapshot to facilitate distributed system to distinguish
Generate the write request of request front and back.
In one embodiment, special symbol or character can be used as preset mark, also can be used to write and ask
Middle finger is asked to determine the numerical value of data bit as preset mark.
For example, when using special symbol or character as preset mark, preset mark is " * * * ", is added with
The write request of " * * * " is that distributed system receives the write request sent after snapshot generation request, and does not include in write request
" * * * " is the write request that distributed system receives that snapshot generates transmission before request.
For another example, when write request middle finger being used to determine the numerical value of data bit as preset mark, write request middle finger determines data bit
Numerical value when being the first numerical value, indicate the write request be distributed system receive snapshot generate send after request write and ask
It asks, write request middle finger determines the numerical value of data bit when being second value, and it is raw to indicate that the write request is that distributed system receives snapshot
At the write request sent before request.Wherein, the first numerical value is only used for distinguishing two different numerical value from second value, for example,
First numerical value is 1, second value 0.
It certainly, can also be by user if user can not know that distributed system receives snapshot generation request
The other equipment or other modules in distributed system for forwarding write request between distributed system, connect in distributed system
It receives in the write request sent after snapshot generation request and adds preset mark, the application does not limit this.
In one embodiment, it is generated in the write request sent after request due to receiving snapshot in distributed system
Added with preset mark, therefore, after receiving the write request for distributed system, whether can be wrapped according in write request
Containing preset mark, judges whether write request receives after snapshot generates request in distributed system and receive.
In one example, however, it is determined that include preset mark in write request, it is determined that write request is received in distributed system
It is received after generating request to snapshot;If it is determined that not including preset mark in write request, it is determined that write request is in distribution system
System is received before snapshot generates request and is received.
For example, the example that above-mentioned preset mark is " * * * " is still continued to use, after receiving write request, however, it is determined that write and ask
Include in asking " * * * ", it is determined that write request is received after snapshot generates request in distributed system and received;It is asked if it is determined that writing
Do not include in asking " * * * ", it is determined that write request is received before snapshot generates request in distributed system and received.
It can be carried out simultaneously to guarantee to generate snapshot with write request, and guarantee to receive all after snapshot generation is requested
Write request not in snapshot, receives snapshot and generates all write requests before request to data mode to the change of data mode
Change in snapshot.In one embodiment, for the write request received after receiving snapshot generation request, then
The original metadata of object storage location in record distributed system is backed up, backup metadata is obtained, for original member
Data execute the write request received after receiving snapshot generation request;For being received before receiving snapshot and generating request
Write request, execute the write request that receives before receiving snapshot and generating request for backup metadata.Wherein, distributed system
Object in system, can include but is not limited to: the file in data, distributed system in distributed system.
In one embodiment, the write request received after receiving snapshot generation request, comprising: receiving snapshot
The write request submitted for the first time after request is generated, and/or is submitted before receiving snapshot and generating request and executes failure and mentioned again
The write request of friendship.
It in one example, is to generate request in reception snapshot receiving snapshot to generate the write request received after request
When the write request submitted for the first time later, change of the write request to data mode in database, there can be no in snapshot, because
This executes the write request for original metadata when executing the write request.
It in one example, is to generate request in reception snapshot receiving snapshot to generate the write request received after request
Before submit and execute unsuccessfully resubmit write request when, although the write request receive snapshot generate request before once
It submitted, but was resubmited after receiving snapshot and generating request since it executes failure, then this is write and ask
Seek the write request for being considered as and submitting after receiving snapshot generation request.Therefore, when executing the write request, for original first number
According to the execution write request.Namely the write request does not appear in snapshot the change of data mode.
In one embodiment, executed for original metadata receive snapshot generate receive after request write and ask
When asking, the write request for receiving and receiving before snapshot generation request can be executed for backup metadata, and first for backup
Data execute snapshot and generate request.
In one embodiment, if in write request including the Data Identification of data to be changed, determining that write request is
It receives snapshot and generates the write request received after request, to the original metadata of object storage location in record distributed system
It is backed up, when obtaining backup metadata, can first determine the data block of storing data mark corresponding data in distributed system,
And the original metadata of object storage location in record data block is backed up, backup metadata is obtained, to reduce calculation amount.
Wherein, database is by multiple data chunks at data block is made of multiple storage units, and data are stored in a storage unit.
In one embodiment, fast to read when reading the data in distributed system after generating snapshot
Data according in can then be routed based on backup metadata, and to read real time data, then it can be based on original first number
According to being routed.
Currently, in order to provide a user the unrestricted data service of memory capacity, often being adopted in cloud computing service
With the calculating system architecture isolated with storage.
As shown in Figure 1, the program (for example, MySQL calculate node) or process of user operates in cloud computing service
In host (host 1, host 2 and host 3 shown in fig. 1).Cloud virtual disk interchanger (Cloud Virtual on host
Disk Switch) disk (namely cloud disk 10) is simulated in host, it is accessed for user program, while making user's
Data can be stored in cloud disk 10 by communication network.The memory space of cloud disk 10 is unrestricted, the data to user into
When row physical store, the data in cloud disk 10 are stored in distributed memory system.
For example, cloud disk 10 can be divided into multiple data blocks (data block 1 shown in Fig. 1, data block 2, data block
3 ... ..., data block N, wherein N is natural number), each data block can be divided into multiple storage units again, finally with storage
The data of user are stored in the distributed storage server (storage shown in Fig. 1 independently of host deployments for unit by unit
Server 1, storage server 2 and storage server 3) in.The provider of cloud computing service can be right by cloud disk console 11
Data in the host and cloud disk 10 of 10 carry of cloud disk are managed, for example, generating the snapshot of data in cloud disk 10.Above system
There can be one or more hosts in framework, there can also be one or more storage servers.
In one embodiment, host can be movable equipment.For example, it may be mobile phone, tablet computer etc..Host
It can also be desk device, such as: all-in-one machine etc..
In one embodiment, cloud virtual disk interchanger receives the read request and/or write request that user sends, and root
Corresponding storage server is routed requests to according to the offset (offset) in read request and/or write request.
In one embodiment, cloud disk 10 can be simultaneously by multiple main frames carry, but 10 permission quilts of cloud disk
For one host with read-write mode carry, other hosts can only be with read-only mode carry.
In the system architecture of cloud computing service, as shown in Fig. 2, the provider (user 20) of cloud computing service can be in cloud
The snapshot that disk console 11 initiates to generate data in cloud disk 10 snapshot generates request, and snapshot, which generates, carries cloud disk mark in request
Know.Wherein, cloud disk mark all has unique cloud disk mark for distinguishing different cloud disks, each cloud disk.For example, cloud disk
Mark can be the sequence number of cloud disk.
After cloud disk console 11 receives the snapshot generation request comprising cloud disk mark, is generated in request and wrapped according to snapshot
The cloud disk mark contained, determines the cloud disk for needing to generate snapshot, for example, determining that the cloud disk for needing to generate snapshot is to show in Fig. 1
Cloud disk 10.Determine need to generate snapshot cloud disk be cloud disk 10 after, due to read-write mode carry in cloud disk 10
Host may the change to the data mode in cloud disk 10 in generating snapshot processes, therefore, cloud disk console 11, which determines, to be hung
The carry mode of the host and each host that are loaded in cloud disk 10, and asked to snapshot generation is sent with the host of read-write mode carry
It asks, so as to know to generate snapshot to the data in cloud disk 10 with the host of read-write mode carry.
For example, host 1, host 2 and the equal carry of host 3 are in cloud disk 10 in Fig. 1, if host 1 is hung with read-only mode
It carries, host 2 and host 3 are determining that the cloud disk for needing to generate snapshot is cloud disk in cloud disk console 11 with read-only mode carry
10, and determine host 1 with read-only mode carry in cloud disk 10 after, to host 1 send snapshot generate request.
After host 1 receives snapshot generation request, at the time of record receives snapshot generation request, if host 1 is connecing
After receiving at the time of snapshot generation is requested, the write request of the transmission of user 21 is received, then host 1 can add in the write request
Adding for identifying the write request is the label for receiving snapshot and generating the write request received after request, and will be added with label
Write request be forwarded to storage server.For example, " * * * " is added in write request, is to receive for identifying write request
Snapshot generates the write request received after request.
In one embodiment, host 1 according to receive snapshot generate request at the time of with receive write request when
Relationship between quarter judges whether write request is the write request received after snapshot generation request.
In one example, if host 1 determine receive snapshot generate request at the time of earlier than receive write request when
It carves, then host 1 determines that the write request is the write request received after snapshot generation request;If the determination of host 1 receives snapshot
It is later than at the time of receive write request at the time of generating request, then host 1 determines that the write request is to receive snapshot to generate request
Write request before.
For example, as shown in figure 3, having moment A, moment B, moment C, moment D, moment E and moment on moment axis
F totally six moment, and moment F is later than moment A, if host 1 receives write request 1 in moment A, receives write request in moment B
2, write request 3 is received in moment C, snapshot is received in moment D and generates request, write request 4 is received in moment E, in moment F
Receive write request 5, then host 1 determine the time of reception of write request 4 and write request 5 be later than receive snapshot generate request when
It carves, host 1 is to receive after snapshot generates request to receive by addition is used to identify write request in write request 4 and write request 5
The label of the write request arrived.
As shown in figure 4, if executing failure in the write request 2 that moment B is submitted, G at the time of after moment F, 21 weight of user
Write request 2 newly is had submitted, then host 1 determines that the time of reception for the write request 2 that moment G is submitted is later than and receives snapshot generation request
At the moment, it is to receive snapshot to generate being followed by for request that host 1, which is added in the write request 2 that moment G is submitted for identifying write request,
The label of the write request received.
After storage server receives the markd write request of addition, determine that the write request generates request to receive snapshot
The write request received later, then in duplicated record storage server data storage location original metadata, generate backup member
Data, and the markd write request of addition received is executed for original metadata.
In one embodiment, after storage server receives the markd write request of addition, if being taken in write request
With Data Identification, storage server can first determine the data block for storing above-mentioned Data Identification corresponding data, and duplicated record
The original metadata of data storage location in above-mentioned data block generates backup metadata, and executes reception for original metadata
The markd write request of the addition arrived.
In one embodiment, storage server executes for original metadata and receives being followed by for snapshot generation request
When the write request received, the write request for receiving and receiving before snapshot generation request can be executed for backup metadata, and
Snapshot is executed for backup metadata and generates request, is realized while generating snapshot, is responded the write request of user.
It should be noted that snapshot provided by the embodiments of the present application generates scheme, it is applicable not only to distributed system, it is same
The snapshot that sample is suitable for other data-storage systems generates.For example, the application reality also can be used in standalone storage system
The snapshot for applying example generates scheme.
Below with reference to specific system process flow to the implementation procedure of the snapshot creation method of above-mentioned distributed system into
Row explanation, it should be noted, however, that the specific embodiment merely to the application is better described, is not constituted to this Shen
Improper restriction please.
For overall flow, as shown in figure 5, the snapshot creation method 500 of distributed system, may include following step
It is rapid:
Step S501 receives the write request for being directed to distributed system.
Step S502, if write request receives after receiving the snapshot for distributed system and generating request, to note
The original metadata of object storage location is backed up in record distributed system, obtains backup metadata.
Step S503 executes the write request received after receiving snapshot generation request for original metadata, for
Backup metadata executes snapshot and generates request.
According in the embodiment of the present application, carried out by the original metadata to object storage location in record distributed system
Backup, obtains backup metadata, makes it possible to receive after receiving snapshot and generating request for original metadata execution
Write request, while executing snapshot for backup metadata and generating request, namely realizing and generating the same of distributed system snapshot
When, response user is directed to the write request of distributed system.
When realizing, the snapshot creation method of the distributed system in above-described embodiment can pass through distributed system
Snapshot generating means realize.As shown in fig. 6, the snapshot generating means 600 of distributed system, may include:
Receiving module 601, for receiving the write request for being directed to distributed system.
Metadata backup module 602, for determining snapshot generation request of the write request in reception for distributed system
When receiving later, the original metadata of object storage location in record distributed system is backed up, obtains backing up first number
According to.
Processing module 603, for executed for original metadata received after receiving snapshot and generating request write and ask
It asks, executes snapshot for backup metadata and generate request.
In one embodiment, metadata backup module 602, is also used to: determining that write request is being received for distribution
The snapshot of system receives before generating request;Processing module 603, is also used to: executing for backup metadata and is receiving snapshot
Generate the write request received before request.
In one embodiment, receiving module 601 are specifically used for: receiving the write request for being directed to distributed system;According to
Whether include preset mark in write request, judges whether write request receives after receiving snapshot and generating request.
In one embodiment, receiving module 601 are specifically used for: if it is determined that including preset mark in write request, then really
Determine write request to receive after receiving snapshot and generating request;If it is determined that not including preset mark in write request, it is determined that write and ask
It asks and is received before receiving snapshot and generating request.
In one embodiment, distributed system includes any of the following or a variety of: distributed file system is divided
Cloth storage system, distributed data base system.
In one embodiment, receiving module 601 are specifically used for: receive calculating equipment transmission is directed to distributed system
The write request of system is calculated equipment and is connected with distributed system with read-write mode.
In one embodiment, calculate equipment be according to write request whether receive snapshot generate request after receive
It arrives, judges whether to add preset mark in write request.
In one embodiment, calculating equipment is at the time of generating request according to reception snapshot and when receiving write request
Relationship between quarter, judges whether write request receives after receiving snapshot and generating request.
It in one embodiment, include the Data Identification of data to be changed in write request;Metadata backup module 602,
It is specifically used for: determines the data block of storing data mark corresponding data in distributed system, and object in record data block is deposited
The original metadata that storage space is set is backed up, and backup metadata is obtained.
In one embodiment, the write request received after receiving snapshot generation request, comprising: receiving snapshot
The write request submitted for the first time after request is generated, and/or is submitted before receiving snapshot and generating request and executes failure and mentioned again
The write request of friendship.
Fig. 7 shows the meter that can be realized snapshot creation method and device according to the distributed system of the embodiment of the present application
Calculate the structure chart of the exemplary hardware architecture of equipment.As shown in fig. 7, calculating equipment 700 includes input equipment 701, input interface
702, central processing unit 703, memory 704, output interface 705 and output equipment 706.Wherein, input interface 702, center
Processor 703, memory 704 and output interface 705 are connected with each other by bus 710, input equipment 701 and output equipment
706 are connect by input interface 702 and output interface 705 with bus 710 respectively, and then the other assemblies with calculating equipment 700
Connection.
Specifically, input equipment 701 is received from external input information, and will input information by input interface 702
It is transmitted to central processing unit 703;Central processing unit 703 is based on the computer executable instructions stored in memory 704 to input
Information is handled to generate output information, and output information is temporarily or permanently stored in memory 704, is then passed through
Output information is transmitted to output equipment 706 by output interface 705;Output information is output to and calculates equipment 700 by output equipment 706
Outside for users to use.
That is, the equipment shown in Fig. 7 that calculates also may be implemented as the snapshot generating device of distributed system, this point
The snapshot generating device of cloth system may include: the memory for being stored with computer executable instructions;And processor, at this
Reason device may be implemented to combine the snapshot creation method of the distributed system of Fig. 1-Fig. 6 description when executing computer executable instructions
And device.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.It when implemented in software, can be entirely or partly with the shape of computer program product or computer readable storage medium
Formula is realized.The computer program product or computer readable storage medium include one or more computer instructions.It is calculating
When being loaded on machine and executing the computer program instructions, entirely or partly generate according to process described in the embodiment of the present application
Or function.The computer can be general purpose computer, special purpose computer, computer network or other programmable devices.Institute
Stating computer instruction may be stored in a computer readable storage medium, or from a computer readable storage medium to another
A computer readable storage medium transmission, for example, the computer instruction can be from web-site, computer, a server
Or data center passes through wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (for example, infrared, wireless, micro-
Wave etc.) mode transmitted to another web-site, computer, server or data center.The computer-readable storage
Medium can be any usable medium that computer can access or include the integrated service of one or more usable mediums
The data storage devices such as device, data center.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), light
Medium (for example, DVD) or semiconductor medium (for example, solid state hard disk Solid State Disk (SSD)) etc..
In addition, in conjunction with the snapshot creation method of the distributed system in above-described embodiment, the embodiment of the present application can provide one
Computer readable storage medium is planted to realize.Computer program instructions are stored on the computer readable storage medium;The calculating
Machine program instruction realizes the snapshot creation method of any one distributed system in above-described embodiment when being executed by processor.
It should be clear that the application is not limited to specific configuration described above and shown in figure and processing.
For brevity, it is omitted here the detailed description to known method.In the above-described embodiments, several tools have been described and illustrated
The step of body, is as example.But the present processes process is not limited to described and illustrated specific steps, this field
Technical staff can be variously modified, modification and addition after understanding spirit herein, or suitable between changing the step
Sequence.
It should also be noted that, the exemplary embodiment referred in the application, is retouched based on a series of step or device
State certain methods or system.But the application is not limited to the sequence of above-mentioned steps, that is to say, that can be according in embodiment
The sequence referred to executes step, may also be distinct from that the sequence in embodiment or several steps are performed simultaneously.
The above, the only specific embodiment of the application, it is apparent to those skilled in the art that,
For convenience of description and succinctly, the system, module of foregoing description and the specific work process of unit can refer to preceding method
Corresponding process in embodiment, details are not described herein.It should be understood that the protection scope of the application is not limited thereto, it is any to be familiar with
Those skilled in the art within the technical scope of the present application, can readily occur in various equivalent modifications or substitutions,
These modifications or substitutions should all cover within the scope of protection of this application.