CN104205780B - A kind of method and apparatus of data storage - Google Patents

A kind of method and apparatus of data storage Download PDF

Info

Publication number
CN104205780B
CN104205780B CN201480000338.5A CN201480000338A CN104205780B CN 104205780 B CN104205780 B CN 104205780B CN 201480000338 A CN201480000338 A CN 201480000338A CN 104205780 B CN104205780 B CN 104205780B
Authority
CN
China
Prior art keywords
server
data
memory space
residual
shared
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.)
Active
Application number
CN201480000338.5A
Other languages
Chinese (zh)
Other versions
CN104205780A (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 Cloud Computing 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
Publication of CN104205780A publication Critical patent/CN104205780A/en
Application granted granted Critical
Publication of CN104205780B publication Critical patent/CN104205780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems

Abstract

The embodiment of the invention discloses a kind of method and apparatus of data storage, it is related to technical field of memory, is used to reduce time delay when reading data, so as to improve systematic function.Method provided in an embodiment of the present invention, is applied to distributed memory system, and the distributed memory system includes first server and other servers, and methods described includes:Determine the first data of the first server generation;Judge the residual memory space of the first server and the magnitude relationship of the memory space shared by first data;If the residual memory space of the first server is more than or equal to the memory space shared by first data, and when having used the minimum that memory space is more than other servers to use memory space of the first server, by first data storage in the residual memory space of the first server.

Description

A kind of method and apparatus of data storage
Technical field
The present invention relates to technical field of memory, more particularly to a kind of method and apparatus of data storage.
Background technology
Distributed memory system focus as research so that reliability is high, availability strong, the features such as be easy to extension.It is distributed Storage system is made up of multiple servers, and one or more virtual machine can be installed on each server, each server pair Answer a part of memory space on RAID (Redundant Arrays of Independent Disks, disk array).
At present, in distributed memory system, generally according to " load balancing " principle for install on server application/ The data distribution amount of physical memory of virtual machine generation, i.e. according to " each server in HDFS has used memory space equal The data distribution amount of physical memory that the principle of weighing apparatus " is generated for the application/virtual machine installed on server;Wherein, physical store Space is memory space and/or the server the memory space in itself of the corresponding disk array of a certain server.Specifically, with Distributed memory system be HDFS (Hadoop Distributed File System, distributed file system) as a example by said It is bright:
In HDFS, minimum memory unit is block (block), and the maximum of each block is 64M.When what is installed on server When being more than 64M using the memory space shared by the data that/virtual machine is generated, the server carries out piecemeal, one to the data first As, at most there is the memory space shared by 1 block less than 64M, the memory space shared by remaining block is equal to 64M;Secondly according to The principle of " each server in HDFS used memory space balanced ", each piece is mapped in HDFS one or more On the memory space of server.When the application/virtual machine generation installed on server data shared by memory space be equal to or When person is less than 64M, according to the principle of " use memory space equilibrium of each server in HDFS ", map the data to In HDFS, use on the memory space of the minimum server of memory space.
Due to the number generated for the application/virtual machine installed on server according to the principle of " load balancing " in such scheme According to distribution physical location, therefore, the part/total data in the data is potentially stored in other clothes in distributed memory system It is engaged on the memory space of device.So, the server generally requires to read the data from the memory space of other servers, so that Cause to read the big problem of data delay, and then cause systematic function poor.
The content of the invention
The embodiment of the present invention provides a kind of method and apparatus of data storage, is used to reduce time delay when reading data, from And improve systematic function.
To reach above-mentioned purpose, embodiments of the invention are adopted the following technical scheme that:
A kind of first aspect, there is provided method of data storage, is applied to distributed memory system, the distributed storage system System includes first server and other servers, and methods described includes:
Determine the first data of the first server generation;
Judge that the residual memory space of the first server is closed with the size of the memory space shared by first data System;
If the residual memory space of the first server is empty more than or equal to the storage shared by first data Between, and when having used the minimum that memory space is more than other servers to use memory space of the first server, By first data storage in the residual memory space of the first server.
With reference in a first aspect, in the first possible implementation, the first server includes a virtual machine, described First data are the data of the virtual machine generation;Described other servers include second server;Methods described also includes:
If the residual memory space of the first server is less than the memory space shared by first data, to institute State second server and send the first instruction message comprising first data;The first instruction message is used to indicate described the Two servers are by first data storage in the residual memory space of the second server;
The memory space shared by corresponding other data in addition to first data of the virtual machine be less than or Equal to the second server residual memory space when, by the virtual machine and described other Data Migrations to the described second clothes On business device.
With reference in a first aspect, in second possible implementation, described other servers include second server;Institute Stating method also includes:
If the residual memory space of the first server is less than the memory space shared by first data, to institute State second server and send the first instruction message comprising first data;The first instruction message is used to indicate described the Two servers are by first data storage in the residual memory space of the second server;
Update the residual memory space of the first server;
The residual memory space after first server updates is more than or equal to depositing shared by first data During storage space, send second to the second server and indicate message;The second instruction message is used to indicate second clothes Business device is by first Data Migration to the first server;
Receive first data that the second server sends;
By in residual memory space of first data storage after first server renewal.
Appoint with reference to the first possible implementation or second possible implementation of first aspect, first aspect One kind, in the third possible implementation, described other servers also include the 3rd server, and methods described also includes:
The 3rd instruction message of the copy comprising first data is sent to the 3rd server, the described 3rd indicates Message is used to indicate the 3rd server to store the copy storage of first data in the residue of the 3rd server In space.
A kind of second aspect, there is provided method of data storage, is applied to distributed memory system, the distributed storage system System includes first server and other servers, and methods described includes:
Determine the first data of the first server generation;Memory space shared by first data is more than described point The maximum of the minimum memory unit of cloth storage system;
Judge that the residual memory space of the first server is closed with the size of the memory space shared by first data System;
If the residual memory space of the first server is empty more than or equal to the storage shared by first data Between, and the minimum that memory space is less than or equal to other servers that used of the first server has used storage During space, by first data storage in the residual memory space of the first server.
A kind of third aspect, there is provided server, is applied to distributed memory system, and the distributed memory system also includes Other servers, the server includes:
Determining module, the first data for determining the server generation;
Judge module, residual memory space and the memory space shared by first data for judging the server Magnitude relationship;
Memory module, the residual memory space for determining the server in the judge module is more than or equal to institute The memory space shared by the first data is stated, and the memory space that used of the server is more than the minimum of other servers When having used memory space, by first data storage in the residual memory space of the server.
With reference to the third aspect, in the first possible implementation, the server includes a virtual machine, described first Data are the data of the virtual machine generation;Described other servers include second server, and the server also includes:
Sending module, for determining the residual memory space of the server less than the described first number in the judge module During according to shared memory space, the first instruction message comprising first data is sent to the second server;Described One instruction message is used to indicate residue of the second server by first data storage in the second server to store In space;
Transferring module, in the storage shared by corresponding other data in addition to first data of the virtual machine When space is less than or equal to the residual memory space of the second server, by the virtual machine and described other Data Migrations Onto the second server.
With reference to the third aspect, in second possible implementation, described other servers include second server, institute Stating server also includes:
Sending module, for determining the residual memory space of the server less than the described first number in the judge module During according to shared memory space, the first instruction message comprising first data is sent to the second server;Described One instruction message is used to indicate residue of the second server by first data storage in the second server to store In space;
Update module, the residual memory space for updating the server;
The sending module is additionally operable to, and the residual memory space after server update is more than or equal to described the During memory space shared by one data, send second to the second server and indicate message;The second instruction message is used for The second server is indicated by first Data Migration to the server;
Receiver module, for receiving first data that the second server sends;
The memory module is additionally operable to, by residual memory space of first data storage after the server update In.
It is possible with reference to the first possible implementation of the third aspect, the third aspect or second of the third aspect Implementation any one, in the third possible implementation, described other servers also include the 3rd server;
The sending module is additionally operable to, and the 3rd finger of the copy comprising first data is sent to the 3rd server Show message, the 3rd instruction message is used to indicating the 3rd server by the copy storage of first data described the In the residual memory space of three servers.
A kind of fourth aspect, there is provided server, is applied to distributed memory system, and the distributed memory system also includes Other servers, the server includes:
Processor, the first data for determining the server generation;And judge the remaining storage of the server The magnitude relationship of space and the memory space shared by first data;
Memory, for determining the residual memory space of the server more than or equal to described the in the processor Memory space shared by one data, and the minimum for being more than other servers using memory space of the server made When using memory space, under the control of the processor by first data storage the server residual memory space In.
With reference to fourth aspect, in the first possible implementation, the server includes a virtual machine, described first Data are the data of the virtual machine generation;Described other servers include second server, and the server also includes:
Transmitter, the residual memory space for determining the server in the processor is less than the first data institute During the memory space for accounting for, the first instruction message comprising first data is sent to the second server;Described first refers to Show message for indicate the second server by first data storage the second server residual memory space In;
The processor is additionally operable to, shared by corresponding other data in addition to first data of the virtual machine When memory space is less than or equal to the residual memory space of the second server, by the virtual machine and described other data Move on the second server.
With reference to fourth aspect, in second possible implementation, described other servers include second server;
The processor is additionally operable to, and updates the residual memory space of the server;
The transmitter is additionally operable to, and the residual memory space after server update is more than or equal to described first During memory space shared by data, send second to the second server and indicate message;The second instruction message is used to refer to Show the second server by first Data Migration to the server;
The server also includes:Receiver, for receiving first data that the second server sends;
The memory is additionally operable to, under the control of the processor by first data storage in the server more In residual memory space after new.
It is possible with reference to the first possible implementation of fourth aspect, fourth aspect or second of fourth aspect Implementation any one, in the third possible implementation, described other servers also include the 3rd server;
The transmitter is additionally operable to, and the 3rd instruction of the copy comprising first data is sent to the 3rd server Message, the 3rd instruction message is used to indicate the 3rd server to store the described 3rd copy of first data In the residual memory space of server.
A kind of 5th aspect, there is provided server, is applied to distributed memory system, and the distributed memory system also includes Other servers, the server includes:
Determining module, the first data for determining the server generation;Memory space shared by first data More than the maximum of the minimum memory unit of the distributed memory system;
Judge module, residual memory space and the memory space shared by first data for judging the server Magnitude relationship;
Memory module, the residual memory space for determining the server in the judge module is more than or equal to institute The memory space shared by the first data is stated, and the memory space that used of the server is serviced less than or equal to described other When the minimum of device has used memory space, by first data storage in the residual memory space of the server.
A kind of 6th aspect, there is provided server, is applied to distributed memory system, and the distributed memory system also includes Other servers, the server includes:
Processor, the first data for determining the server generation;And judge the remaining storage of the server The magnitude relationship of space and the memory space shared by first data;Memory space shared by first data is more than described The maximum of the minimum memory unit of distributed memory system;
Memory, for determining the residual memory space of the server more than or equal to described the in the processor Memory space shared by one data, and the memory space that used of the server is less than or equal to other servers Minimum has been when having used memory space, under the control of the processor by first data storage the server residue In memory space.
Above-mentioned technical proposal, is applied to distributed memory system, a server determine its residual memory space be more than or Person be equal to its generation a data shared by memory space when, preferentially by the data storage the server residual memory space In.So, the server can directly from the data are locally read, should without being read from other servers in network Data, so as to reach the beneficial effect for shortening time delay, improving systematic function.Solve in the prior art, because by a network Other servers on extension, systematic function poor problem when reading caused by data.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also Other accompanying drawings are obtained with according to these accompanying drawings.
Fig. 1 is a kind of flow chart of the method for data storage that the embodiment of the present invention one is provided;
Fig. 2 is a kind of flow chart of the method for data storage that the embodiment of the present invention two is provided;
Fig. 3 is a kind of flow chart of the method for data storage that the embodiment of the present invention 1 is provided;
Fig. 4 is a kind of flow chart of the method for data storage that the embodiment of the present invention 2 is provided;
Fig. 5 is a kind of structural representation of server that the embodiment of the present invention three is provided;
Fig. 6 is the structural representation of another server that the embodiment of the present invention three is provided;
Fig. 7 is a kind of structural representation of server that the embodiment of the present invention four is provided;
Fig. 8 is the structural representation of another server that the embodiment of the present invention four is provided;
Fig. 9 is a kind of structural representation of server that the embodiment of the present invention five is provided;
Figure 10 is a kind of structural representation of server that the embodiment of the present invention six is provided.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
The terms " system " and " network " are often used interchangeably herein.The terms "and/or", only It is a kind of incidence relation for describing affiliated partner, expression there may be three kinds of relations, for example, A and/or B, can represent:Individually There is A, while there is A and B, individualism B these three situations.Character "/" herein, typicallys represent forward-backward correlation pair as if one Plant the relation of "or".
Embodiment one
As shown in figure 1, a kind of method of the data storage provided for the present embodiment, is applied to distributed memory system, institute Stating distributed memory system includes first server and other servers, and methods described includes:
101:Determine the first data of the first server generation.
Wherein, " first server " can be any server in distributed memory system;" other servers " refers to Servers-all in the distributed memory system, in addition to first server." the first data " can give birth to for first server Into any data.The executive agent of the present embodiment can be " first server ".
Server in distributed memory system can install one or more virtual machine, it is also possible to not install virtual Machine.When virtual machine is provided with server, the server and the virtual machine installed thereon share the corresponding disk of the server Array.In addition, when one or more virtual machine is provided with server, the first data of server generation can be: The data of the application generation installed on the server (physical machine);It can also be the virtual machine generation installed on the server Data.
Further, when the data that a data are the application generation installed on server, the server can record this Corresponding relation between data and the server;When the data that a data are the virtual machine generation installed on server, should Server can record the corresponding relation between the data and the virtual machine.This specifically can be recorded by generating data routing table Corresponding relation.Usually, each server in distributed memory system can share the data routing table.Herein, when Server where generating the application/virtual machine of a data and the server corresponding to the memory space for storing the data are same During server, it is believed that realize the localization to the data.
102:Judge that the residual memory space of the first server is big with the memory space shared by first data Small relation.
Wherein, " residual memory space of server " refers to the corresponding disk array of the server and/or the server sheet Non- data storage, free memory in the memory space of body.The size of residual memory space can be 0, it is also possible to including One or more memory cell.The residual memory space of each server may be because deleting the data that stored, increasing and wait to deposit The data of storage, the size for changing the corresponding disk array of the server etc. and update.Server can include but is not limited to according to Following several ways obtain its residual memory space:Its residual memory space periodically is obtained, its residue storage is periodically obtained empty Between, obtain its residual memory space etc. during one data of generation.
The present embodiment is not defined to the size of " memory space shared by the first data ".
Before step 102, the method can also include:Obtain the memory space shared by first data, Yi Jisuo State the residual memory space of first server.
103:If the residual memory space of the first server is more than or equal to depositing shared by first data Storage space, and the minimum that memory space is more than other servers that used of the first server has used memory space When, by first data storage in the residual memory space of the first server.
Wherein, step 103 can specifically include:The first server is it is determined that its residual memory space is more than or waits Serviced more than described other in the memory space that used of the memory space shared by first data, and the first server It is the first data distribution storage address when the minimum of device has used memory space, and by first data storage in institute In stating the corresponding memory cell of storage address;The storage address is in the residual memory space of the first server Or the corresponding storage address of multiple memory cell.
Exemplary, " minimum of other servers uses memory space " is illustrated by a specific example: Assuming that other servers are made up of server 1, server 2, server 3, the size for having used memory space of 3 servers Respectively:A, B, C, and A > B > C;So, it is C that the minimum of other servers has used memory space.
Further, in order to carry out detailed comparisons with prior art, the memory space shared by the first data below Angle with the magnitude relationship of the maximum of the minimum memory unit of distributed memory system is illustrated to step 103.Specifically , in the feelings comprising feature " residual memory space of first server is more than or equal to the memory space shared by the first data " Under condition, step 103 can include following scene 1 and scene 2:
Scene 1:Maximum of the memory space more than the minimum memory unit of distributed memory system shared by first data, And the memory space that used of first server has used memory space more than the minimum of other servers.
Scene 2:Minimum memory unit of the memory space less than or equal to distributed memory system shared by first data Maximum, and first server used memory space more than other servers minimum used memory space.
Wherein, for scene 1, in the prior art scheme, first server needs to carry out piecemeal to the first data, and presses According to the principle of " load balancing ", each block is stored the residual memory space of the multiple servers in distributed memory system respectively In.For scene 2, in the prior art scheme, first server need by the first data storage in other servers most In big residual memory space.
It should be noted that when actually realizing, it is also possible to following scenario A and scenario B occur:
Scenario A:Maximum of the memory space more than the minimum memory unit of distributed memory system shared by first data, And the memory space that used of first server has used memory space less than or equal to the minimum of other servers.
Scenario B:Minimum memory unit of the memory space less than or equal to distributed memory system shared by first data Maximum, and first server used memory space less than or equal to other servers minimum use storage sky Between.
Wherein, the implementation method for scenario A is provided herein, there is corresponding description in following embodiments two.For Scenario B, the implementation method with prior art is identical, specifically, first server deposits the first data storage in its residue In storage space.
Summary, it is provided in an embodiment of the present invention when actually realizing from above-mentioned scene 1, scene 2, scenario A and scenario B The method of data storage need not limit the size of the memory space shared by the first data, it is not required that limit first server The magnitude relationship for having used memory space of memory space and other servers is used.Specific implementation is included but is not limited to Method shown in following embodiments 1 and embodiment 2.
In one embodiment of the invention, the first server includes a virtual machine, and first data are described The data of virtual machine generation;Described other servers include second server;Methods described also comprises the steps A1-A2:
Step A1:If the residual memory space of the first server is empty less than the storage shared by first data Between, then the first instruction message comprising first data is sent to the second server;The first instruction message is used for Indicate the second server by first data storage in the residual memory space of the second server.
Step A2:It is small in the memory space shared by corresponding other data in addition to first data of the virtual machine In or equal to the second server residual memory space when, by the virtual machine and described other Data Migrations to described On second server.
Wherein, " second server " can be in the distributed memory system, in addition to first server, satisfaction " residual memory space is empty more than or equal to the storage shared by corresponding other data in addition to the first data of the virtual machine Between " any server of condition.
Step A1 can include:A11) if the first server is it is determined that its residual memory space is less than described first Memory space shared by data, it is determined that shared by other data in addition to first data corresponding with the virtual machine The size of memory space;A12) server using residual memory space more than or equal to the memory space is used as second service Device;A13 the first instruction message comprising first data) is sent to the second server.
It is exemplary, " by the virtual machine and corresponding other Data Migrations of the virtual machine to the second server On " specific implementation such as prior art, no longer describe herein.
It should be noted that when actually realizing, step A2 can be immediately performed after step A1;Can also be in the void Plan machine is performed when needing to read the first data.Wherein, the former can be described as:The reality when second server is write first data into The localization of existing first data;The latter can be described as:First is realized when the virtual machine needs and reads first data The localization of data.
It is described virtual after " first server is by the virtual machine (vm) migration to second server " in the embodiment Machine turns into the virtual machine on second server, no longer there is the virtual machine in first server.In " first service Device will with described other Data Migrations to second server on " after, described other data are stored in depositing for second server In storage space.Furthermore it is possible to the optional embodiment is referred to as by way of virtual machine (vm) migration to realize the local of the first data Change.
In another embodiment of the present invention, described other servers include second server;Methods described also includes Following step B1-B4:
Step B1:If the residual memory space of the first server is empty less than the storage shared by first data Between, then the first instruction message comprising first data is sent to the second server;The first instruction message is used for Indicate the second server by first data storage in the residual memory space of the second server.
Step B2:Update the residual memory space of the first server.
Step B3:The residual memory space after first server updates is more than or equal to the first data institute During the memory space for accounting for, send second to the second server and indicate message;The second instruction message is described for indicating Second server is by first Data Migration to the first server.
Step B4:Receive first data that the second server sends;By first data storage described In residual memory space after first server renewal.
Wherein, in this embodiment, second server to first server send the first data after, second server The first data that will can be locally stored are deleted, it is also possible to do not deleted.In the former implementation, the present embodiment can be claimed It is the localization that the first data are realized by way of the first Data Migration;In the implementation of the latter, it is believed that distribution The copy of the first data stored in formula storage system becomes n+1 copies by n copies, wherein, store the copy of the first data Method may refer to hereafter related embodiment.It should be noted that in order to corresponding with above-mentioned optional embodiment, hereinafter The optional embodiment is referred to as by way of the first Data Migration realizing the localization of the first data.
In another embodiment of the present invention:The first server includes a virtual machine, and first data are described The data of virtual machine generation, described other servers also include the 3rd server, the further comprising the steps of C of methods described:
Step C:The first server sends the 3rd of the copy comprising first data to the 3rd server Indicating message, the 3rd instruction message is used to indicate the 3rd server to store described the copy of first data In the residual memory space of the 3rd server.
Wherein, " the 3rd server " can be used for storing the copy of the first data, can be included in distributed memory system One or more the 3rd server.When actually realizing, each server in distributed memory system would know that the distribution The residual memory space of Servers-all in formula storage system.In the embodiment, first server can be according to " load balancing " Principle, selection distributed memory system in one or more server as the 3rd server.
The embodiment by store the first data copy, can reach enhancing distributed memory system performance it is beneficial Effect.Specifically:When the first corrupted data or loss, distributed storage system can be made by calling the copy of the first data The normal operation of system, so that the stability of strengthening system.
The method of data storage provided in an embodiment of the present invention, be applied to comprising first server and other servers point In cloth storage system, determine that its residual memory space is more than or equal to shared by a data of its generation in first server Memory space, and when having used memory space to use memory space more than the minimum of other servers of first server, it is excellent First by the data storage in the residual memory space of the server.So, first server directly can be somebody's turn to do from local reading Data, without reading the data from other servers in network, so as to reach shortening time delay, improve systematic function Beneficial effect.Solve in the prior art, extension, systematicness during because caused by reading data on other servers in a network The poor problem of energy.
Embodiment two
The method of the data storage that the present embodiment is provided, is applied to distributed memory system, the distributed memory system Including first server and other servers.The present embodiment describes data storage under the scenario A in above-described embodiment one Method.
As shown in Fig. 2 including:
201:Determine the first data of the first server generation;Memory space shared by first data is more than institute State the maximum of the minimum memory unit of distributed memory system.
202:Judge that the residual memory space of the first server is big with the memory space shared by first data Small relation.
203:If the residual memory space of the first server is more than or equal to depositing shared by first data Space is stored up, and the minimum for being less than or equal to other servers using memory space of the first server has been used During memory space, by first data storage in the residual memory space of the first server.
Further, for the scene (i.e. scenario A) of the present embodiment, in the prior art scheme, first server needs First data are carried out with piecemeal, and according to the principle of " load balancing ", respectively by the storage of each block in distributed memory system In the residual memory space of multiple servers.
Optionally, in one embodiment of the invention, methods described can also include:Step in above-described embodiment one Step B1-B4 in A1-A2, or above-described embodiment one;Furthermore it is also possible to including the step C in above-described embodiment one.
It should be noted that the relevant explanation in the present embodiment may be referred to the relevant portion of above-described embodiment one.
The method of data storage provided in an embodiment of the present invention, be applied to comprising first server and other servers point In cloth storage system, determine that its residual memory space is more than or equal to shared by a data of its generation in first server Memory space, and the memory space that used of first server has used storage empty less than or equal to the minimum of other servers Between when, preferentially by the data storage in the residual memory space of the server;Wherein, the memory space shared by the data is more than The maximum of the minimum memory unit of distributed memory system.So, first server can directly from locally reading the data, Without reading the data from other servers in network, so as to reach shortening time delay, improve the beneficial of systematic function Effect.Solve in the prior art, because on other servers in a network read data caused by when extension, systematic function compared with Poor problem.
The method of the data storage provided above-described embodiment one and embodiment two below by several specific embodiments It is illustrative:
Embodiment 1
Virtual machine is not included in the present embodiment in first server." local " in the present embodiment refers to generate answering for data With the server at place.
As shown in figure 3, a kind of method of the data storage provided for the present embodiment, including:
301:Application one data of generation installed in first server (physical machine).
Exemplary, " application " here can be any application of the prior art, for example, word processing should Application, computer controls application, CAD application, scientific simulations are processed with, audio frequency process application, video pictures to answer With etc..
Assuming that performing the step 301 for 4 times, the application symbiosis installed in first server (physical machine) divides into 4 data Wei not D1, D2, D3, D4.
302:First server obtains the residual memory space and memory space shared by the data of first server.
Specifically, step 302 can be implemented as:Distributed storage program in first server obtains first server Residual memory space and memory space shared by the data
Exemplary, according to the example in step 301,4 execution steps 302, the residue of the first server of acquisition is deposited Storage space is respectively:X1、X2、X3、X4;The size in the space shared by data D1, D2, D3, D4 is respectively:M1、M2、M3、M4.
303:Whether first server judges its residual memory space more than or equal to memory space shared by the data.
If so, then performing step 304;If it is not, then performing step 305.
Specifically, step 303 can be implemented as:Distributed storage program in first server judges first server Whether residual memory space is more than or equal to memory space shared by the data.
Exemplary, according to the example in step 302, it is assumed that:X1 > M1, X2 > M2, X3=M3, X4 ﹤ M4.
304:First server is by the data storage in the residual memory space of first server.Specifically include:First Distributed storage program on server is the data distribution storage address, and the data storage is corresponding in the storage address In memory module;The storage address is corresponding for one or more memory module in the residual memory space of first server Storage address.
After step 304 is performed, then terminate.
Exemplary, according to the example in step 303, (residue) storage that D1, D2, D3 store first server respectively is empty Between in.Assuming that the storage address that first server is D1, D2, D3 distribution is respectively:S1/D1/offset1、S1/D2/ offset2、S1/D2/offset3.Wherein, S1 represents first server, and S1/D1/offset1 is represented:The storage of data D1 Location is located at the offset1 of the memory space of first server S1, and other storage address are no longer explained one by one.
Perform for 3rd time after step 301-306, the data routing table recorded in distributed memory system is as shown in table 1:
Table 1
Data Locally Residual memory space Address data memory
D1 S1 X1 S1/D1/offset1
D2 S1 X2 S1/D2/offset2
D3 S1 X3 S1/D3/offset3
305:First server sends the first instruction message comprising the data to second server;First indicates message to use In indicate second server by the data storage in the residual memory space of second server.
After step 305 is performed, step 306 is performed.
306:Second server according to first indicate message by the data storage second server residual memory space In.Specifically include:Distributed storage program on second server is the data distribution storage address, and the data storage is existed In the corresponding memory module of the storage address;The storage address is in the residual memory space of second server or many The corresponding storage address of individual memory module.
Exemplary, according to the example in step 303, D4 is stored in (residue) memory space of second server.It is false If second server is the storage address of D4 distribution being respectively:S2/D4/offset4.Wherein, S2 represents second server, S2/ D4/offset4 represents that the storage address of data D4 is located at the offset4 of the memory space of second server S2.
The 4th is performed after step 301-306, and the data routing table recorded in distributed memory system is as shown in table 2:
Table 2
Data Locally Residual memory space Address data memory
D1 S1 X1 S1/D1/offset1
D2 S1 X2 S1/D2/offset2
D3 S1 X3 S1/D3/offset3
D4 S1 X4 S2/D4/offset4
As shown in Table 2, it is same server to obtain the server of data D4 with the server of data storage D4.
307:First server updates the residual memory space of first server, and is periodically detected first server renewal Residual memory space afterwards.
Specifically, step 307 can be implemented as:Distributed storage program in first server updates first server Residual memory space, and it is periodically detected the residual memory space after first server updates.
Exemplary, according to the example in step 306, after the 4th execution step 301-306, execution step 307 When, the residual memory space after the first server of acquisition updates is expressed as X4 '.Assuming that X4 ' > M4.
308:Whether first server judges the residual memory space after its renewal more than or equal to shared by the data Memory space.
If it is not, then return to step 307;If so, then performing step 309.
Specifically, step 308 can be implemented as:Distributed storage program in first server judges first server more Whether the residual memory space after new is more than or equal to the memory space shared by the data.
Exemplary, according to the example in step 307, step 308 is specially:First server judges whether X4 ' is more than Or equal to M4.
309:First server sends second and indicates message to second server;Second indicates message to be used for instruction second takes Business device transmits this data to first server.
310:Second server sends the data according to the second instruction message to first server.
311:In residual memory space of the first server by the data storage after first server renewal.
Perform after step 311, then terminate.
Specifically, step 311 can be implemented as:Distributed storage program in first server is by the data storage In residual memory space after one server update.
Exemplary, according to the example in step 307, after execution step 311, the number recorded in distributed memory system It is as shown in table 3 according to routing table:
Table 3
Data Locally Residual memory space Address data memory
D1 S1 X1 S1/D1/offset1
D2 S1 X2 S1/D2/offset2
D3 S1 X3 S1/D3/offset3
D4 S1 X4′ S1/D4/offset4
As shown in Table 3, the server of the server and data storage D4 that obtain data D4 is same server.Wherein, S1/ D4/offset4 represents that the storage address of data D4 is located at the offset4 of first server S1.
Optionally, after step 301, the method can also comprise the following steps A and step B:
Step A:First server sends the 3rd instruction message of the copy comprising the data to the 3rd server, and the 3rd refers to Show message for indicate the 3rd server by the storage of the copy of the data in the residual memory space of the 3rd server.
Exemplary, according to the example in embodiment 1, the copy of D1, D2, D3, D4 is expressed as:D1′、D2′、 D3′、D4′。
Step B:3rd server indicates message that the copy of the data is stored the residue in the 3rd server according to the 3rd In memory space.
Specifically, step B can be implemented as:Distributed storage program on 3rd server will according to the 3rd instruction message The copy of the data is stored in the residual memory space of the 3rd server.
Exemplary, according to the example in embodiment 1, it is assumed that the 3rd server is the storage of D1, D2, D3, D4 distribution Location is respectively:S3/D1 '/offset1, S3/D2 '/offset2, S3/D3 '/offset3, S3/D4 '/offset4, wherein, S3 The 3rd server is represented, S3/D1 '/offset1 is represented.Copy D1 ' the storage address of data D1 is located at depositing for the 3rd server S 3 Store up at the offset1 in space, other storage address are no longer explained one by one.
After the 3rd time performs step 301-306 and step A, step B, the data recorded in distributed memory system Routing table is as shown in table 4:
Table 4
Data Locally Residual memory space Address data memory Copy Copy storage address
D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
After the 4th performs step 301-306 and step A, step B, the data recorded in distributed memory system Routing table is as shown in table 5:
Table 5
Data Locally Residual memory space Address data memory Copy Copy storage address
D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
D4 S1 X4 S2/D4/offset4 D4′ S3/D4′/offset3
Further, step A and step B is used for the stability of strengthening system, if specifically, the storage of second server When the loss of data or damage for being stored in space, first server can be sent the copy of the data to the 3rd server Send to the instruction message of first server;So that the 3rd server is somebody's turn to do according to according to the instruction message to first server transmission The copy of data;In residual memory space of the first server by the copy storage of the data after first server renewal.
The method of data storage provided in an embodiment of the present invention, first server determine its residual memory space be more than or When person is equal to the memory space shared by a data of an application generation of its installation, preferentially by the data storage in the server In residual memory space;When first server determines that its residual memory space is less than the memory space shared by the data, by this Data storage in the residual memory space of second server, and it is determined that first server update after residual memory space it is big When memory space shared by the data, by residual memory space of the data storage after first server renewal In.So, the application installed in first server directly can read the data from local (memory space of first server), The data need not be read from other servers in network, so as to reach the beneficial effect for shortening time delay, improving systematic function Really.Solve in the prior art, extension, systematic function are poor during because caused by reading data on other servers in a network Problem.
Embodiment 2
Virtual machine is included in the present embodiment in first server." local " in the present embodiment refers to the virtual of generation data Server where machine.
As shown in figure 4, a kind of method of the data storage provided for the present embodiment, including:
401:The virtual machine installed in first server generates a data.
Exemplary, it is assumed that 4 virtual machines (VM1, VM2, VM3, VM4) are installed, 4 perform the step in first server 401, specially:VM1, VM2, VM3, VM4 obtain data D1, D2, D3, D4 respectively.
402:First server obtains the residual memory space and memory space shared by the data of first server.
403:Whether first server judges its residual memory space more than or equal to memory space shared by the data.
If so, then performing step 404;If it is not, then performing step 405.
404:First server is by the data storage in the residual memory space of first server.
After step 404 is performed, then terminate.
It should be noted that the example of step 402- steps 404 may be referred to the step 302-304 in above-described embodiment 1, Here is omitted.
405:First server determines other numbers in addition to first data corresponding with the virtual machine in step 401 According to the size of shared memory space, W is marked as.
406:During first server determines distributed memory system, server of the residual memory space more than or equal to W, As second server.
407:First server sends the first instruction message comprising the data to second server;First indicates message to use In indicate second server by the data storage in the residual memory space of second server.
408:Second server according to first indicate message by the data storage second server residual memory space In.
It should be noted that the specific example in step 407-408 may be referred to the step 305- in above-described embodiment 1 306 is identical, and here is omitted.In addition, the Tables 1 and 2 in embodiment 1 is readily adaptable for use in the corresponding step of this implementation.
Further, in order to understand comparative example 1 and embodiment 2, in the present embodiment, above-mentioned Tables 1 and 2 can divide Table 1 below ' and table 2 ' are not expressed as:
Table 1 '
Virtual machine Data Locally Residual memory space Address data memory
VM1 D1 S1 X1 S1/D1/offset1
VM2 D2 S1 X2 S1/D2/offset2
VM3 D3 S1 X3 S1/D3/offset3
Table 2 '
Virtual machine Data Locally Residual memory space Address data memory
VM1 D1 S1 X1 S1/D1/offset1
VM2 D2 S1 X2 S1/D2/offset2
VM3 D3 S1 X3 S1/D3/offset3
VM4 D4 S1 X4 S2/D4/offset4
From table 2 ', server S 1 and the server S 2 of storage D4 where obtaining the virtual machine VM4 of D4 are not same Server.
409:First server is by the virtual machine and other Data Migrations of virtual machine generation on second server.
Perform after step 409, then terminate.
It is exemplary, it is assumed that all data that recorded in the data routing table and virtual machine has corresponding relation are: D1, D2, D3, D4, then step 409 be specially:First server moves on second server the virtual machine and D1, D2, D3.
Exemplary, according to the example in step 408, after execution step 409, the number recorded in distributed memory system According to routing table as shown in table 3 ':
Table 3 '
Virtual machine Data Locally Residual memory space Address data memory
VM1 D1 S1 X1 S1/D1/offset1
VM2 D2 S1 X2 S1/D2/offset2
VM3 D3 S1 X3 S1/D3/offset3
VM4 D4 S2 X4 S2/D4/offset4
From table 3 ', server S 2 and the server S 2 of storage D4 where obtaining the virtual machine VM4 of D4 are same clothes Business device.
Optionally, the method can also include the step A and step B in above-described embodiment 1.
In order to understand comparative example 1 and embodiment 2, in the present embodiment, above-mentioned table 4 and table 5 can be expressed as Table 4 below ' and table 5 ':
Table 4 '
Virtual machine Data Locally Residual memory space Address data memory Copy Copy storage address
VM1 D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
VM2 D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
VM3 D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
Table 5 '
Virtual machine Data Locally Residual memory space Address data memory Copy Copy storage address
VM1 D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
VM2 D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
VM3 D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
VM4 D4 S1 X4 S2/D4/offset4 D4′ S3/D4′/offset3
The method of data storage provided in an embodiment of the present invention, first server determine its residual memory space be more than or Person etc. thereon a virtual machine generation a data shared by memory space when, preferentially by the data storage in the server In residual memory space;When first server determines that its residual memory space is less than the memory space shared by the data, by this Data storage in the memory space of second server, and by the virtual machine (vm) migration to second server.So, virtual machine can Directly to read data from local (memory space of second server), it is not necessary to the receive data from other servers in network According to so as to reach the beneficial effect for shortening time delay, improving systematic function.Solve in the prior art, because of in a network other Extension, systematic function poor problem when on server caused by reading data.
Embodiment three
As shown in figure 5, a kind of server 1 provided for the present embodiment, is applied to distributed memory system, the distribution Storage system also includes other servers, and the server 1 is used to perform the method for the data storage shown in Fig. 1, the service Device 1 includes:
Determining module 51, the first data for determining the generation of the server 1;
Judge module 52, for judging the residual memory space of the server 1 and the storage shared by first data The magnitude relationship in space;
Memory module 53, for determine in the judge module 52 server 1 residual memory space be more than or The memory space that used equal to the memory space shared by first data, and the server 1 is serviced more than described other When the minimum of device has used memory space, by first data storage in the residual memory space of the server 1.
Optionally, the server 1 includes a virtual machine, and first data are the data of the virtual machine generation;Institute Stating other servers includes second server;As shown in fig. 6, the server 1 also includes:
Sending module 54, for determining the residual memory space of the server 1 less than described in the judge module 52 During memory space shared by the first data, the first instruction message comprising first data is sent to the second server; The first instruction message is used to indicate the second server by first data storage in the surplus of the second server In remaining memory space;
Transferring module 55, in depositing shared by corresponding other data in addition to first data of the virtual machine When storage space is less than or equal to the residual memory space of the second server, the virtual machine and described other data are moved Move on on the second server.
Optionally, described other servers include second server, as shown in fig. 6, the server 1 also includes:
Sending module 54, for determining the residual memory space of the server 1 less than described in the judge module 52 During memory space shared by the first data, the first instruction message comprising first data is sent to the second server; The first instruction message is used to indicate the second server by first data storage in the surplus of the second server In remaining memory space;
Update module 56, the residual memory space for updating the server 1;
The sending module 54 is additionally operable to, and the residual memory space after server 1 updates is more than or equal to institute When stating the memory space shared by the first data, send second to the second server and indicate message;Described second indicates message For indicating the second server by first Data Migration to the server 1;
Receiver module 57, for receiving first data that the second server sends;
The memory module 53 is additionally operable to, the remaining storage by first data storage after the server 1 updates In space.
Optionally, described other servers also include the 3rd server;
The sending module 54 is additionally operable to, and the 3rd of the copy comprising first data the is sent to the 3rd server Indicating message, the 3rd instruction message is used to indicate the 3rd server to store described the copy of first data In the residual memory space of the 3rd server.
Exemplary, the server 1 in the present embodiment is specifically as follows the " first service described in above-described embodiment one Device ", " second server " in the present embodiment can be " second server " described in above-described embodiment one.
Server provided in an embodiment of the present invention 1, is applied in the also distributed memory system comprising other servers, Server 1 determine its residual memory space more than or equal to its generation a data shared by memory space, and server 1 When having used memory space to use memory space more than the minimum of other servers, preferentially by the data storage in the server Residual memory space in.So, server 1 can directly from locally reading the data, without from other in network The data are read on server, so as to reach the beneficial effect for shortening time delay, improving systematic function.Solve in the prior art, Extension, systematic function poor problem during because caused by reading data on other servers in a network.
Example IV
For embodiment three, in hardware realization, sending module therein can be transmitter, and receiver module can be to connect Device is received, and the transmitters and receivers can integrate composition transceiver;Memory module can be memory, determine mould Block, judge module, transferring module etc. can be embedded in the form of hardware or independently of the processor of server 1 in, it is also possible to Software form is stored in the memory of server 1, and the corresponding operation of execution above modules is called in order to processor, should Processor can be CPU (CPU), microprocessor, single-chip microcomputer etc..
As shown in fig. 7, being a kind of server 1 provided in an embodiment of the present invention, distributed memory system, described point are applied to Cloth storage system also includes other servers, and the server 1 is used to perform the method for the data storage shown in Fig. 1, described Server 1 includes:Bus system 71, memory 72, processor 73.
Wherein, it is coupled by bus system 71 between memory 72 and processor 73, wherein bus system 71 in addition to including data/address bus, can also be including power bus, controlling bus and status signal bus in addition etc..But in order to clear For the sake of explanation, various buses are all designated as bus system 71 in figure.
Memory 72, for storing one group of code;
The code stored in memory 72 is used for the first data that control process device 73 determines the generation of the server 1;With And judge the residual memory space of the server 1 and the magnitude relationship of the memory space shared by first data;
Memory 72, be additionally operable to the processor 73 determine the server 1 residual memory space be more than or wait It is more than described other servers in the memory space that used of the memory space shared by first data, and the server 1 Minimum when having used memory space, by first data storage in the server 1 under the control of the processor In residual memory space.
Optionally, the server 1 includes a virtual machine, and first data are the data of the virtual machine generation;Institute Stating other servers includes second server;As shown in figure 8, the server 1 also includes:
Transmitter 74, the residual memory space for determining the server 1 in the processor 73 is less than described first During memory space shared by data, the first instruction message comprising first data is sent to the second server;It is described First instruction message is used to indicate the second server to deposit first data storage in the residue of the second server In storage space;
The processor 73 is additionally operable to, shared by corresponding other data in addition to first data of the virtual machine Memory space less than or equal to the second server residual memory space when, by the virtual machine and it is described other number According to moving on the second server.
Optionally, described other servers include second server;
The processor 73 is additionally operable to, and updates the residual memory space of the server 1;
The transmitter 74 is additionally operable to, and the residual memory space after server 1 updates is more than or equal to described During memory space shared by the first data, send second to the second server and indicate message;Described second indicates message to use In indicating the second server by first Data Migration to the server 1;
As shown in figure 8, the server 1 also includes:Receiver 75, for receiving described in the second server transmission First data;
The memory 72 is additionally operable to, by first data storage in the service under the control of the processor 73 In residual memory space after the renewal of device 1.
Optionally, described other servers also include the 3rd server;
The transmitter 74 is additionally operable to, and the 3rd finger of the copy comprising first data is sent to the 3rd server Show message, the 3rd instruction message is used to indicating the 3rd server by the copy storage of first data described the In the residual memory space of three servers.
Exemplary, the server 1 in the present embodiment is specifically as follows the " first service described in above-described embodiment one Device ", " second server " in the present embodiment can be " second server " described in above-described embodiment one.
Server provided in an embodiment of the present invention 1, is applied in the also distributed memory system comprising other servers, Server 1 determine its residual memory space more than or equal to its generation a data shared by memory space, and server 1 When having used memory space to use memory space more than the minimum of other servers, preferentially by the data storage in the server Residual memory space in.So, server 1 can directly from locally reading the data, without from other in network The data are read on server, so as to reach the beneficial effect for shortening time delay, improving systematic function.Solve in the prior art, Extension, systematic function poor problem during because caused by reading data on other servers in a network.
Embodiment five
As shown in figure 9, a kind of server 2 provided for the present embodiment, is applied to distributed memory system, the distribution Storage system also includes other servers, and the server 2 is used to perform the method for the data storage shown in Fig. 2, the service Device 2 includes:
Determining module 91, the first data for determining the generation of the server 2;Storage shared by first data is empty Between more than the distributed memory system minimum memory unit maximum;
Judge module 92, for judging the residual memory space of the server 2 and the storage shared by first data The magnitude relationship in space;
Memory module 93, for determine in the judge module 92 server 2 residual memory space be more than or Equal to the memory space shared by first data, and the server 2 has used memory space less than or equal to described It is when the minimum of other servers has used memory space, first data storage is empty in the remaining storage of the server 2 Between in.
Exemplary, the server 2 in the present embodiment is specifically as follows the " first service described in above-described embodiment one Device ",
Server provided in an embodiment of the present invention 2, is applied in the also distributed memory system comprising other servers, Server 2 determine its residual memory space more than or equal to its generation a data shared by memory space, and server 2 When having used memory space to use memory space less than or equal to the minimum of other servers, preferentially the data storage is existed In the residual memory space of the server;Wherein, the memory space shared by the data is deposited more than the minimum of distributed memory system The maximum of storage unit.So, server 2 can directly from the data are locally read, without from other clothes in network The data are read on business device, so as to reach the beneficial effect for shortening time delay, improving systematic function.Solve in the prior art, because Extension, systematic function poor problem when on other servers in a network caused by reading data.
Embodiment six
For embodiment five, in hardware realization, memory module therein can be memory, determining module, judge mould Block can be embedded in the form of hardware or independently of the processor of server 2 in, it is also possible to be stored in server 2 in a software form Memory in, call the execution corresponding operation of above modules in order to processor, the processor can be managed for centre Unit (CPU), microprocessor, single-chip microcomputer etc..
As shown in Figure 10, it is a kind of server 2 provided in an embodiment of the present invention, is applied to distributed memory system, it is described Distributed memory system also includes other servers, and the server 2 is used to perform the method for the data storage shown in Fig. 2, institute Stating server 1 includes:Bus system 10A, memory 10B, processor 10C.
Wherein, it is coupled by bus system 10A between memory 10B and processor 10C, wherein total linear system System 10A, can also be including power bus, controlling bus and status signal bus in addition etc. in addition to including data/address bus.But in order to For the sake of clear explanation, various buses are all designated as bus system 10A in figure.
Memory 10B, for storing one group of code;
The code stored in memory 10B is used for the first data that control process device 10C determines the generation of the server 2; And judge the residual memory space of the server 2 and the magnitude relationship of the memory space shared by first data;It is described Maximum of the memory space more than the minimum memory unit of the distributed memory system shared by first data;
Memory 10B, be additionally operable to the processor 10C determine the server 2 residual memory space be more than or Equal to the memory space shared by first data, and the server 2 has used memory space less than or equal to described When the minimum of other servers has used memory space, first data storage is existed under the control of the processor 10C In the residual memory space of the server 2.
Exemplary, the server 2 in the present embodiment is specifically as follows the " first service described in above-described embodiment one Device ",
Server provided in an embodiment of the present invention 2, is applied in the also distributed memory system comprising other servers, Server 2 determine its residual memory space more than or equal to its generation a data shared by memory space, and server 2 When having used memory space to use memory space less than or equal to the minimum of other servers, preferentially the data storage is existed In the residual memory space of the server;Wherein, the memory space shared by the data is deposited more than the minimum of distributed memory system The maximum of storage unit.So, server 2 can directly from the data are locally read, without from other clothes in network The data are read on business device, so as to reach the beneficial effect for shortening time delay, improving systematic function.Solve in the prior art, because Extension, systematic function poor problem when on other servers in a network caused by reading data.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description, The specific work process of device and module, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the module Divide, only a kind of division of logic function there can be other dividing mode when actually realizing, such as multiple module or components Can combine or be desirably integrated into another system, or some features can be ignored, or do not perform.It is another, it is shown or The coupling each other for discussing or direct-coupling or communication connection can be the indirect couplings of device or module by some interfaces Close or communicate to connect, can be electrical, mechanical or other forms.
The module that is illustrated as separating component can be or may not be it is physically separate, it is aobvious as module The part for showing can be or may not be physical module, you can with positioned at a place, or can also be distributed to multiple On mixed-media network modules mixed-media.Some or all of module therein can be according to the actual needs selected to realize the mesh of this embodiment scheme 's.
In addition, during each functional module in each embodiment of the invention can be integrated in a processing module, it is also possible to It is that the independent physics of modules includes, it is also possible to which two or more modules are integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, it would however also be possible to employ hardware adds the form of software function module to realize.
The above-mentioned integrated module realized in the form of software function module, can store and be deposited in an embodied on computer readable In storage media.Above-mentioned software function module storage is in a storage medium, including some instructions are used to so that a computer Equipment (can be personal computer, server, or network equipment etc.) performs the portion of each embodiment methods described of the invention Step by step.And foregoing storage medium includes:USB flash disk, mobile hard disk, ROM (Read-Only Memory, read-only storage), RAM (Random Access Memory, random access memory), magnetic disc or CD etc. are various can be with Jie of store program codes Matter.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although The present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those within the art that:It still may be used Modified with to the technical scheme described in foregoing embodiments, or equivalent is carried out to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (12)

1. a kind of method of data storage, it is characterised in that be applied to distributed memory system, the distributed memory system bag First server and other servers are included, methods described includes:
Determine the first data of the first server generation;
Judge the residual memory space of the first server and the magnitude relationship of the memory space shared by first data;
If the residual memory space of the first server is more than or equal to the memory space shared by first data, and When having used the minimum that memory space is more than other servers to use memory space of the first server, will be described First data storage is in the residual memory space of the first server;
The first server includes a virtual machine, and first data are the data of the virtual machine generation;Described other clothes Business device includes second server;Methods described also includes:
If the residual memory space of the first server is less than the memory space shared by first data, to described the Two servers send the first instruction message comprising first data;The first instruction message is used to indicate second clothes Business device is by first data storage in the residual memory space of the second server;
It is less than or equal in the memory space shared by corresponding other data in addition to first data of the virtual machine During the residual memory space of the second server, by the virtual machine and described other Data Migrations to the second server On.
2. method according to claim 1, it is characterised in that methods described also includes:
Update the residual memory space of the first server;
The residual memory space after first server updates is more than or equal to the storage sky shared by first data Between when, to the second server send second indicate message;The second instruction message is used to indicate the second server By first Data Migration to the first server;
Receive first data that the second server sends;
By in residual memory space of first data storage after first server renewal.
3. method according to claim 1 and 2, it is characterised in that described other servers also include the 3rd server, institute Stating method also includes:
The 3rd instruction message of the copy comprising first data is sent to the 3rd server, the described 3rd indicates message For indicating the 3rd server that the copy of first data is stored the residual memory space in the 3rd server In.
4. a kind of method of data storage, it is characterised in that be applied to distributed memory system, the distributed memory system bag First server and other servers are included, methods described includes:
Determine the first data of the first server generation;Memory space shared by first data is more than the distribution The maximum of the minimum memory unit of storage system;
Judge the residual memory space of the first server and the magnitude relationship of the memory space shared by first data;
If the residual memory space of the first server is more than or equal to the memory space shared by first data, and The minimum that memory space is less than or equal to other servers that used of the first server has used memory space When, by first data storage in the residual memory space of the first server;
The first server includes a virtual machine, and first data are the data of the virtual machine generation;Described other clothes Business device includes second server;Methods described also includes:
If the residual memory space of the first server is less than the memory space shared by first data, to described the Two servers send the first instruction message comprising first data;The first instruction message is used to indicate second clothes Business device is by first data storage in the residual memory space of the second server;
It is less than or equal in the memory space shared by corresponding other data in addition to first data of the virtual machine During the residual memory space of the second server, by the virtual machine and described other Data Migrations to the second server On.
5. a kind of server, it is characterised in that be applied to distributed memory system, the distributed memory system also includes other Server, the server includes:
Determining module, the first data for determining the server generation;
Judge module, the residual memory space for judging the server is big with the memory space shared by first data Small relation;
Memory module, for determining the residual memory space of the server more than or equal to described the in the judge module Memory space shared by one data, and the minimum for being more than other servers using memory space of the server made When using memory space, by first data storage in the residual memory space of the server;
The server includes a virtual machine, and first data are the data of the virtual machine generation;Described other servers Including second server, the server also includes:
Sending module, the residual memory space for determining the server in the judge module is less than the first data institute During the memory space for accounting for, the first instruction message comprising first data is sent to the second server;Described first refers to Show message for indicate the second server by first data storage the second server residual memory space In;
Transferring module, in the memory space shared by corresponding other data in addition to first data of the virtual machine Less than or equal to the second server residual memory space when, by the virtual machine and described other Data Migrations to institute State on second server.
6. server according to claim 5, it is characterised in that the server also includes:
Update module, the residual memory space for updating the server;
The sending module is additionally operable to, and the residual memory space after server update is more than or equal to the described first number During according to shared memory space, send second to the second server and indicate message;The second instruction message is used to indicate The second server is by first Data Migration to the server;
Receiver module, for receiving first data that the second server sends;
The memory module is additionally operable to, by residual memory space of first data storage after the server update.
7. the server according to claim 5 or 6, it is characterised in that described other servers also include the 3rd server;
The sending module is additionally operable to, and the 3rd instruction for sending the copy comprising first data to the 3rd server disappears Breath, the 3rd instruction message is used to indicate the 3rd server to store in the 3rd clothes copy of first data It is engaged in the residual memory space of device.
8. a kind of server, it is characterised in that be applied to distributed memory system, the distributed memory system also includes other Server, the server includes:
Processor, the first data for determining the server generation;And judge the residual memory space of the server With the magnitude relationship of the memory space shared by first data;
Memory, for determining the residual memory space of the server more than or equal to the described first number in the processor According to shared memory space, and the server is more than the minimum using depositing of other servers using memory space Storage space when, under the control of the processor by first data storage the server residual memory space;
The server includes a virtual machine, and first data are the data of the virtual machine generation;Described other servers Including second server, the server also includes:
Transmitter, for determining the residual memory space of the server less than shared by first data in the processor During memory space, the first instruction message comprising first data is sent to the second server;Described first indicates to disappear Cease for indicating the second server by first data storage in the residual memory space of the second server;
The processor is additionally operable to, in the storage shared by corresponding other data in addition to first data of the virtual machine When space is less than or equal to the residual memory space of the second server, by the virtual machine and described other Data Migrations Onto the second server.
9. server according to claim 8, it is characterised in that
The processor is additionally operable to, and updates the residual memory space of the server;
The transmitter is additionally operable to, and the residual memory space after server update is more than or equal to first data During shared memory space, send second to the second server and indicate message;The second instruction message is used to indicate institute Second server is stated by first Data Migration to the server;
The server also includes:Receiver, for receiving first data that the second server sends;
The memory is additionally operable to, under the control of the processor by first data storage after the server update Residual memory space in.
10. server according to claim 8 or claim 9, it is characterised in that described other servers also include the 3rd service Device;
The transmitter is additionally operable to, and the 3rd instruction for sending the copy comprising first data to the 3rd server disappears Breath, the 3rd instruction message is used to indicate the 3rd server to store in the 3rd clothes copy of first data It is engaged in the residual memory space of device.
11. a kind of servers, it is characterised in that be applied to distributed memory system, the distributed memory system also includes it His server, the server includes:
Determining module, the first data for determining the server generation;Memory space shared by first data is more than The maximum of the minimum memory unit of the distributed memory system;
Judge module, the residual memory space for judging the server is big with the memory space shared by first data Small relation;
Memory module, for determining the residual memory space of the server more than or equal to described the in the judge module Memory space shared by one data, and the memory space that used of the server is less than or equal to other servers When minimum has used memory space, by first data storage in the residual memory space of the server;
The server includes a virtual machine, and first data are the data of the virtual machine generation;Described other servers Including second server, the server also includes:
Sending module, the residual memory space for determining the server in the judge module is less than the first data institute During the memory space for accounting for, the first instruction message comprising first data is sent to the second server;Described first refers to Show message for indicate the second server by first data storage the second server residual memory space In;
Transferring module, in the memory space shared by corresponding other data in addition to first data of the virtual machine Less than or equal to the second server residual memory space when, by the virtual machine and described other Data Migrations to institute State on second server.
12. a kind of servers, it is characterised in that be applied to distributed memory system, the distributed memory system also includes it His server, the server includes:
Processor, the first data for determining the server generation;And judge the residual memory space of the server With the magnitude relationship of the memory space shared by first data;Memory space shared by first data is more than the distribution The maximum of the minimum memory unit of formula storage system;
Memory, for determining the residual memory space of the server more than or equal to the described first number in the processor The minimum of other servers is less than or equal to according to the memory space that used of shared memory space, and the server When having used memory space, the residue by first data storage in the server under the control of the processor is stored In space;
The server includes a virtual machine, and first data are the data of the virtual machine generation;Described other servers Including second server, the server also includes:
Transmitter, for determining the residual memory space of the server less than shared by first data in the processor During memory space, the first instruction message comprising first data is sent to the second server;Described first indicates to disappear Cease for indicating the second server by first data storage in the residual memory space of the second server;
The processor is additionally operable to, in the storage shared by corresponding other data in addition to first data of the virtual machine When space is less than or equal to the residual memory space of the second server, by the virtual machine and described other Data Migrations Onto the second server.
CN201480000338.5A 2014-01-23 2014-01-23 A kind of method and apparatus of data storage Active CN104205780B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/071224 WO2015109483A1 (en) 2014-01-23 2014-01-23 Data storage method and device

Publications (2)

Publication Number Publication Date
CN104205780A CN104205780A (en) 2014-12-10
CN104205780B true CN104205780B (en) 2017-06-27

Family

ID=52088184

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201480000338.5A Active CN104205780B (en) 2014-01-23 2014-01-23 A kind of method and apparatus of data storage

Country Status (2)

Country Link
CN (1) CN104205780B (en)
WO (1) WO2015109483A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202350A (en) * 2016-07-05 2016-12-07 浪潮(北京)电子信息产业有限公司 A kind of distributed file system simplifies the method and system of configuration automatically
CN106909321A (en) * 2017-02-24 2017-06-30 郑州云海信息技术有限公司 A kind of control method and device based on storage system
CN107092443B (en) * 2017-04-28 2020-04-07 杭州宏杉科技股份有限公司 Data migration method and device
CN107172222A (en) * 2017-07-27 2017-09-15 郑州云海信息技术有限公司 A kind of date storage method and device based on distributed memory system
CN109783576B (en) * 2019-01-02 2022-05-31 佛山市顺德区美的洗涤电器制造有限公司 Household appliance and data storage method and device thereof
CN110109622A (en) * 2019-04-28 2019-08-09 平安科技(深圳)有限公司 A kind of data processing method and relevant apparatus based on middleware
CN110134332B (en) * 2019-04-28 2022-03-08 平安科技(深圳)有限公司 Data storage method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6958881B1 (en) * 2003-11-26 2005-10-25 Western Digital Technologies, Inc. Disk drive control system having a servo processing accelerator circuit
CN101771715A (en) * 2008-12-26 2010-07-07 华为技术有限公司 Method, device and system for establishing distribution type network
CN103064639A (en) * 2012-12-28 2013-04-24 华为技术有限公司 Method and device for storing data
CN103092927A (en) * 2012-12-29 2013-05-08 华中科技大学 File quick reading and writing method under distributed environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7406505B2 (en) * 2004-04-29 2008-07-29 International Business Machines Corporation Managing on-demand email storage
CN102508736A (en) * 2011-10-11 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Backup method of application program in communication terminal and communication terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6958881B1 (en) * 2003-11-26 2005-10-25 Western Digital Technologies, Inc. Disk drive control system having a servo processing accelerator circuit
CN101771715A (en) * 2008-12-26 2010-07-07 华为技术有限公司 Method, device and system for establishing distribution type network
CN103064639A (en) * 2012-12-28 2013-04-24 华为技术有限公司 Method and device for storing data
CN103092927A (en) * 2012-12-29 2013-05-08 华中科技大学 File quick reading and writing method under distributed environment

Also Published As

Publication number Publication date
CN104205780A (en) 2014-12-10
WO2015109483A1 (en) 2015-07-30

Similar Documents

Publication Publication Date Title
CN104205780B (en) A kind of method and apparatus of data storage
CN102546782B (en) Distribution system and data operation method thereof
US9569457B2 (en) Data processing method and apparatus for distributed systems
CN113287286B (en) Input/output processing in distributed storage nodes over RDMA
US9354826B2 (en) Capacity expansion method and device
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
CN105468302B (en) A kind of method, apparatus and system of processing data
EP2637091A1 (en) Management interface for multiple storage subsystems virtualization
CN111290699B (en) Data migration method, device and system
CN107861691B (en) Load balancing method and device of multi-control storage system
CN102831069A (en) Memory processing method and memory management equipment
CN104104705B (en) The cut-in method and equipment of distributed memory system
CN107729536A (en) A kind of date storage method and device
CN103412822A (en) Operation method of non-volatile RAM, data operation method and relevant device
CN102316043A (en) Port virtualization method, switch and communication system
CN111026510A (en) Cross-storage thermal migration method for virtual machine in cloud environment
CN104461706B (en) A kind of method and multiprocessing device that shared global variable is shared
CN103631537A (en) Method and device for managing virtual disk
CN103414764A (en) Cloud platform elastic storage system and elastic storage achieving method thereof
CN103116475B (en) Method of automatic simplifying allocation expansion
CN102419753A (en) Information processing equipment, information processing method and information processing system
CN104102725A (en) Method and system for dynamically creating duplicates of hotspot data files in HDFS (Hadoop distributed file system)
CN104715044A (en) Distributed system and data manipulation method thereof
CN104517067A (en) Method, device and system for data access
CN106383667A (en) Method and apparatus for LUN migration in business operation

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220216

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.