CN107885461A - Method and apparatus are locally stored in a kind of data - Google Patents
Method and apparatus are locally stored in a kind of data Download PDFInfo
- Publication number
- CN107885461A CN107885461A CN201710976082.7A CN201710976082A CN107885461A CN 107885461 A CN107885461 A CN 107885461A CN 201710976082 A CN201710976082 A CN 201710976082A CN 107885461 A CN107885461 A CN 107885461A
- Authority
- CN
- China
- Prior art keywords
- lvm
- container
- logical volume
- physical machine
- perform
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
- G06F3/0676—Magnetic disk device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/22—Procedural
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention provides a kind of data and method and apparatus is locally stored, and is related to field of computer technology.One embodiment of this method includes:Container is created in physical machine, calls LVM plug-in units to create the logical volume of designated capabilities;The logical volume is mounted under the catalogue of the container;Data are write into the catalogue of the container.The embodiment creates the logical volume of designated capabilities by a LVM plug-in unit, and then provides a kind of new implementation for being locally stored for container data, reduces the risk of physical machine collapse.
Description
Technical field
The present invention relates to computer realm, more particularly to a kind of data to be locally stored method and apparatus.
Background technology
When using container operation business, having some business datums and daily record needs to store.Prior art is by container number
According to storage being achieved in that to local:Take foundation as container wound of the unique mark of container when creating container in physical machine
Build a local directory;A catalogue being tied to local directory using bind methods in container;The catalogue into container
Write data.Realize through the above way to the local directory in physical machine and write data.
In process of the present invention is realized, inventor has found that at least there are the following problems in the prior art:
(1) data storage is only realized by catalogue binding in the prior art, can not determines that can the disk size of physical machine
Meet container demand, the risk of physical machine collapse is very high.
(2) data in same physical machine between each container can not be effectively isolated.
(3) easily cause the disk in physical machine to be made, influence other progress in physical machine.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of data and method and apparatus is locally stored, and is created by a LVM plug-in unit
The logical volume of designated capabilities has been built, and then a kind of new implementation is provided for being locally stored for container data, has reduced thing
The risk of reason machine collapse.
To achieve the above object, one side according to embodiments of the present invention, there is provided method is locally stored in a kind of data.
Method is locally stored in a kind of data of the embodiment of the present invention, including:Container is created in physical machine, calls LVM to insert
Part is to create the logical volume of designated capabilities;The logical volume is mounted under the catalogue of the container;To the catalogue of the container
In write data.
Alternatively, before the step of LVM plug-in units are to create the logical volume of designated capabilities is called, methods described also includes:
LVM perform scripts are write, write the LVM plug-in units for calling the LVM perform scripts.
Alternatively, the calling LVM plug-in units to be to create the logical volume of designated capabilities, including:LVM plug-in units are called, pass through institute
State the logical volume that LVM plug-in units call the lvcreate orders in the LVM perform scripts to create designated capabilities;Wherein, the LVM
Perform script includes lvcreate command statements.
Alternatively, it is described to be mounted to the logical volume under the catalogue of the container, including:The LVM is called to perform pin
The logical volume is mounted under the catalogue of the container by the mount orders in this;Wherein, the LVM perform scripts include
Mount command statements.
Alternatively, calling the step of LVM plug-in units are to create the logical volume of designated capabilities and be wrapping with by the logic
It is downloaded between the step under the catalogue of the container, methods described also includes:Call the lvcreate in the LVM perform scripts
Order and add unique mark for the logical volume;Wherein, the unique mark is to be generated according to the nanoseconds of the physical machine
General unique identifier.
Alternatively, methods described also includes:Calculate the disk size of the physical machine;Determine that the disk size is more than institute
The disk size of container application is stated, the container is dispatched in the physical machine.
Alternatively, the disk size for calculating the physical machine, including:Call in the LVM perform scripts
Vgdisplay orders calculate the disk size of the physical machine;Wherein, the LVM perform scripts include vgdisplay orders
Sentence.
Alternatively, methods described also includes:When the container is deleted, the logical volume of the container carry is unloaded it
After deleted.
Alternatively, deleted after the logical volume unloading by the container carry, including:The LVM is called to hold
Umount orders in traveling far and wide originally unload the logical volume of the container carry;Call the lvremove in the LVM perform scripts
The logical volume of the container carry is deleted in order;Wherein, the LVM perform scripts include umount command statements and
Lvremove command statements.
To achieve the above object, a kind of another aspect according to embodiments of the present invention, there is provided data local storage.
A kind of data local storage of the embodiment of the present invention, including:Creation module, hold for being created in physical machine
Device, LVM plug-in units are called to create the logical volume of designated capabilities;Carry module, for the logical volume to be mounted into the container
Catalogue under;Writing module, for writing data into the catalogue of the container.
Alternatively, described device also includes:Module is write, for writing LVM perform scripts, writes and calls the LVM to hold
The LVM plug-in units for sheet of traveling far and wide.
Alternatively, the creation module, is additionally operable to:LVM plug-in units are called, call the LVM to perform by the LVM plug-in units
Lvcreate orders in script are to create the logical volume of designated capabilities;Wherein, the LVM perform scripts include lvcreate
Command statement.
Alternatively, the carry module, is additionally operable to:Mount orders in the LVM perform scripts are called by the logic
It is wrapping with and is downloaded under the catalogue of the container;Wherein, the LVM perform scripts include mount command statements.
Alternatively, described device also includes:Add module is identified, for calling in the LVM perform scripts
Lvcreate orders are that the logical volume adds unique mark;Wherein, the unique mark is the nanosecond according to the physical machine
The general unique identifier of time generation.
Alternatively, described device also includes:Scheduler module is calculated, for calculating the disk size of the physical machine;And
Confirm that the disk size is more than the disk size of the container application, the container is dispatched in the physical machine.
Alternatively, the calculating scheduler module, is additionally operable to:The vgdisplay orders in the LVM perform scripts are called to count
Calculate the disk size of the physical machine;Wherein, the LVM perform scripts include vgdisplay command statements.
Alternatively, described device also includes:Unload removing module, for when the container be deleted when, by the container
Deleted after the logical volume unloading of carry.
Alternatively, the unloading removing module, is additionally operable to:The umount orders in the LVM perform scripts are called to unload
The logical volume of the container carry;And the lvremove orders in the LVM perform scripts are called to delete the container carry
Logical volume;Wherein, the LVM perform scripts include umount command statements and lvremove command statements.
To achieve the above object, another further aspect according to embodiments of the present invention, there is provided a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention, including:One or more processors;Storage device, for storing one
Individual or multiple programs, when one or more of programs are by one or more of computing devices so that one or more
Individual processor realizes that method is locally stored in a kind of data of the embodiment of the present invention.
To achieve the above object, a kind of another further aspect according to embodiments of the present invention, there is provided computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed
Device realizes that method is locally stored in a kind of data of the embodiment of the present invention when performing.
One embodiment in foregoing invention has the following advantages that or beneficial effect:Finger is created by a LVM plug-in unit
The logical volume of constant volume, and then a kind of new implementation is provided for being locally stored for container data, reduce physical machine and collapse
Routed risk;LVM perform scripts are write, the LVM perform scripts are called by LVM plug-in units, to realize that data are locally stored;Pass through
Call the command statement in LVM perform scripts to create the logical volume of designated capabilities, the data between container have been carried out effectively
Isolation, improve container and use the security and validity being locally stored;By calculating the disk size of physical machine, container is adjusted
Spend in the sufficient physical machine of disk size, the disk for avoiding physical machine is made, and does not influence other processes in physical machine.
Further effect adds hereinafter in conjunction with embodiment possessed by above-mentioned non-usual optional mode
With explanation.
Brief description of the drawings
Accompanying drawing is used to more fully understand the present invention, does not form inappropriate limitation of the present invention.Wherein:
Fig. 1 is the schematic diagram for the key step that method is locally stored in data according to embodiments of the present invention;
Fig. 2 is the main flow schematic diagram that method is locally stored in data according to embodiments of the present invention;
Fig. 3 is the schematic diagram of the main modular of data local storage according to embodiments of the present invention;
Fig. 4 is that the embodiment of the present invention can apply to exemplary system architecture figure therein;
Fig. 5 is applied to realize the structural representation of the computer installation of the electronic equipment of the embodiment of the present invention.
Embodiment
The one exemplary embodiment of the present invention is explained below in conjunction with accompanying drawing, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
Arrive, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
Sample, for clarity and conciseness, the description to known function and structure is eliminated in following description.
The logical volume that method creates designated capabilities based on LVM plug-in units is locally stored in the data of embodiments of the invention, will patrol
Collect to be wrapping with and be loaded under container catalogue, and then container data can be write to the catalogue.This method provides for the storage of container data
A kind of new mode, while the capacity of logical volume can be limited, reduce the risk of physical machine collapse.LVM is Logical
Volume Manager (logical volume management) is write a Chinese character in simplified form, and it is a kind of mechanism being managed under Linux environment to disk partition.
Fig. 1 is the schematic diagram for the key step that method is locally stored in data according to embodiments of the present invention.As shown in figure 1,
Method is locally stored in the data of the embodiment of the present invention, mainly comprises the following steps:
Step S101:Container is created in physical machine, calls LVM plug-in units to create the logical volume of designated capabilities.The present invention
The container created in embodiment is Docker containers, and Docker containers are the application container an increased income engines, and the container is got out of the way
Originator can pack they application and rely on bag into the transplantable container, be then published to any popular Linux
On machine, virtualization can also be realized;The container uses sandbox mechanism completely, between each other without any interface.Calling LVM
During plug-in unit, the lvcreate orders in LVM perform scripts can be called to create the logical volume of designated capabilities.
Step S102:The logical volume is mounted under the catalogue of the container.In (SuSE) Linux OS, carry is
Refer to and an equipment (being typically storage device) is articulated in an already present catalogue.Carry uses Linux's in embodiment
Mount orders are realized.
Step S103:Data are write into the catalogue of the container.After the execution of carry step terminates, it is possible to the container
Catalogue in write data, writing data to the catalogue is equivalent to write data to logical volume.Specified appearance is created by said process
The logical volume of amount, reduce the risk that physical machine is collapsed in container group system.
In addition, before the step of LVM plug-in units are to create the logical volume of designated capabilities is called, the data of the embodiment of the present invention
Method, which is locally stored, also to be included:Write LVM perform scripts and write the LVM plug-in units for calling the LVM perform scripts.Should
Lvcreate command statements, mount command statements, vgdisplay command statements, umount can be included in LVM perform scripts
Command statement and lvremove command statements.LVM perform scripts are called by calling LVM plug-in units, to perform LVM perform scripts
In command statement, realize create designated capabilities logical volumes, addition unique mark, calculate physical machine disk size, unloading is deleted
The function of logical volume.
Each imperatival specific implementation in LVM perform scripts is illustrated below.
Lvcreate command statements are used for creating specified size and the logical volume added with unique mark, are implemented as:
lvcreate-L SIZE-n VOLUMEID VG.In the command statement, SIZE refers to the size of logical volume to be created;
VOLUMEID refers to the unique mark of logical volume, and the unique mark is the general unique knowledge generated according to the nanoseconds of physical machine
Other code UUID (Universally Unique Identifier), the nanoseconds of physical machine refer to from 1970-01-0100:
00:00 arrives the nanosecond number of current time;VG is Volume Group, refers to the volume group created in advance, and logical volume needs to create
In volume group, therefore need before logical volume is created first to create volume group.
Mount command statements are used for logical volume being mounted under container catalogue, are implemented as:mount LVPATH
MNTPATH.LVPATH refers to the path of the logical volume created using lvcreate orders in the command statement;MNTPATH is
Refer to mount directory corresponding to container catalogue.
Vgdisplay command statements are used for calculating the disk size of physical machine, are implemented as:Vgdisplay VG orders
VG Size in implementing result.VG refers to the volume group created in advance in the command statement.
Umount command statements are used for unloading the logical volume created with mount command statements, are implemented as:umount
MNTPATH.MNTPATH refers to mount directory corresponding to container catalogue in the command statement.
Lvremove command statements are used for deleting the logical volume of establishment, are implemented as:lvremove LVPATH.The life
LVPATH in sentence is made to refer to the path with identical logical volume in mount orders.
Fig. 2 is the main flow schematic diagram that method is locally stored in data according to embodiments of the present invention.As shown in Fig. 2 this
The data of inventive embodiments are locally stored method and call LVM plug-in units to realize by Container Management platform, Container Management platform fortune
Row is in physical machine.The LVM plug-in units of embodiment include three components, be respectively Mounter components, UnMounter components and
StorageCapacity components.Mounter components are responsible for creating and carry logical volume, UnMounter components are responsible for unloading and deleted
Except logical volume, StorageCapacity components are responsible for collecting the disk size of physical machine.
Method, which is locally stored, in the data of the embodiment of the present invention needs to write LVM perform scripts in advance and write LVM plug-in units,
The command statement included in LVM perform scripts is as described above, LVM plug-in units are used for calling LVM perform scripts.In physics in embodiment
After machine creates container, LVM perform scripts and LVM plug-in units are write before invocation component.
After the container that designated disk capacity is created in physical machine, Container Management platform can call Mounter components,
Mounter components can recall the lvcreate orders in LVM perform scripts to create the logical volume of a designated capabilities, the appearance
Amount is equal to the disk size for creating and being specified during container.Often a lvcreate order is called to create a logical volume, in order to protect
The mark of each logical volume created in card physical machine is different, can generate one according to the nanoseconds of physical machine
UUID, the unique mark using the UUID as logical volume.Each container possess different logical volume cans be effectively isolated it is same
The data of different vessels in individual physical machine.
After creating logical volume, Mounter components can recall the mount orders in LVM perform scripts, by patrolling for generation
Collect and be wrapping with a catalogue for being downloaded to container.Data are write to the catalogue of container to be equivalent to write data to logical volume, so that will
Data Cun Chudao local disks.
When the container for having designated disk capacity is deleted, Container Management platform can call the Unmounter groups of LVM plug-in units
Part, Unmounter components can recall LVM perform scripts umount orders unloading logical volume, that is, release logical volume and
The association of container;Then Unmounter components recall the lvremove orders deletion logical volume of LVM perform scripts.
In order to prevent that the disk of physical machine from being made, at regular intervals (time interval can be with self-defined),
StorageCapacity components can call the disk size of the vgdisplay orders calculating physical machine in LVM perform scripts,
It is exactly the size of volume group.The disk size of each physical machine is reported Container Management platform by StorageCapacity components, on
The data of report include disk total capacity, allocated disk size and remaining disk size.Container Management platform records these numbers
According to, when receiving container request to create, if the remaining disk size for being more than the container application of the disk size of some physical machine,
So the physical machine is exactly to meet disk request.If the physical machine can also meet other resource requirements, such as CPU, internal memory,
So container is created in the physical machine by can by dispatching.
By the data of the embodiment of the present invention be locally stored method can be seen that created by a LVM plug-in unit it is specified
The logical volume of capacity, and then a kind of new implementation is provided for being locally stored for container data, reduce physical machine collapse
Risk;LVM perform scripts are write, the LVM perform scripts are called by LVM plug-in units, to realize that data are locally stored;Pass through tune
The logical volume of designated capabilities is created with the command statement in LVM perform scripts, by the data between container carried out effectively every
From improving container and use the security and validity that are locally stored;By calculating the disk size of physical machine, container is dispatched
In the physical machine sufficient to disk size, the disk for avoiding physical machine is made, and does not influence other processes in physical machine.
Fig. 3 is the schematic diagram of the main modular of data local storage according to embodiments of the present invention.As shown in figure 3,
The data local storage 300 of the embodiment of the present invention, mainly includes:
Creation module 301, for creating container in physical machine, LVM plug-in units are called to create the logical volume of designated capabilities.
The container created in the embodiment of the present invention is Docker containers.When calling LVM plug-in units, it can call in LVM perform scripts
Lvcreate orders create the logical volume of designated capabilities.
Carry module 302, for the logical volume to be mounted under the catalogue of the container.Carry uses in embodiment
Linux mount orders are realized, after carry, are write data to the catalogue and are equivalent to write data to logical volume.
Writing module 303, for writing data into the catalogue of the container.Finger is created by above three functional module
The logical volume of constant volume, reduce the risk that physical machine is collapsed in container group system.
In addition, the data local storage of the embodiment of the present invention can also include:Write module, mark add module,
Calculate scheduler module and unloading removing module (not shown in above-mentioned module map).
Module is write, for writing LVM perform scripts, writes the LVM plug-in units for calling the LVM perform scripts.Should
Lvcreate command statements, mount command statements, vgdisplay command statements, umount can be included in LVM perform scripts
Command statement and lvremove command statements.LVM perform scripts are called by calling LVM plug-in units, to perform LVM perform scripts
In command statement, realize create designated capabilities logical volumes, addition unique mark, calculate physical machine disk size, unloading is deleted
The function of logical volume.
Add module is identified, is added for calling the lvcreate orders in the LVM perform scripts for the logical volume
Unique mark.The unique mark is the general unique identifier generated according to the nanoseconds of the physical machine.
Scheduler module is calculated, for calling the vgdisplay orders in the LVM perform scripts to calculate the physical machine
Disk size;And confirm that the disk size is more than the disk size of the container application, the container is dispatched to institute
State in physical machine.
Removing module is unloaded, for when the container is deleted, calling the umount orders in the LVM perform scripts
The logical volume of the container carry is unloaded, calls the lvremove orders in the LVM perform scripts to delete the container afterwards
The logical volume of carry.
From the above, it can be seen that creating the logical volume of designated capabilities by a LVM plug-in unit, and then it is container number
According to be locally stored and provide a kind of new implementation, reduce the risk of physical machine collapse;LVM perform scripts are write, are led to
Cross LVM plug-in units and call the LVM perform scripts, to realize that data are locally stored;By calling the command statement in LVM perform scripts
The logical volume of designated capabilities is created, the data between container are effectively isolated, container use is improved and is locally stored
Security and validity;By calculating the disk size of physical machine, container is dispatched in the sufficient physical machine of disk size,
The disk for avoiding physical machine is made, and does not influence other processes in physical machine.
Fig. 4 shows that showing for method or data local storage is locally stored in the data that can apply the embodiment of the present invention
Example sexual system framework 400.
As shown in figure 4, system architecture 400 can include terminal device 401,402,403, network 404 and server 405.
Network 404 between terminal device 401,402,403 and server 405 provide communication link medium.Network 404 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be interacted with using terminal equipment 401,402,403 by network 404 with server 405, to receive or send out
Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403
(merely illustrative) such as the application of page browsing device, searching class application, JICQ, mailbox client, social platform softwares.
Terminal device 401,402,403 can have a display screen and a various electronic equipments that supported web page browses, bag
Include but be not limited to smart mobile phone, tablet personal computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user
Caused click event provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to receiving
Click data, the data such as content of text analyze etc. processing, and (such as target push information, product are believed by result
Breath -- merely illustrative) feed back to terminal device.
Typically performed it should be noted that method is locally stored in the data that the embodiment of the present application is provided by server 405,
Correspondingly, data local storage is generally positioned in server 405.
It should be understood that the number of the terminal device, network and server in Fig. 4 is only schematical.According to realizing need
Will, can have any number of terminal device, network and server.
According to an embodiment of the invention, present invention also offers a kind of electronic equipment and a kind of computer-readable medium.
The electronic equipment of the present invention includes:One or more processors;Storage device, for storing one or more journeys
Sequence, when one or more of programs are by one or more of computing devices so that one or more of processors are real
Method is locally stored in a kind of data of the existing embodiment of the present invention.
The computer-readable medium of the present invention, is stored thereon with computer program, real when described program is executed by processor
Method is locally stored in a kind of data of the existing embodiment of the present invention.
Below with reference to Fig. 5, it illustrates suitable for realizing the computer system 500 of the electronic equipment of the embodiment of the present invention
Structural representation.Electronic equipment shown in Fig. 5 is only an example, to the function of the embodiment of the present invention and should not use model
Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes CPU (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into program in random access storage device (RAM) 503 from storage part 508 and
Perform various appropriate actions and processing.In RAM 503, also it is stored with computer system 500 and operates required various programs
And data.CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505
It is connected to bus 504.
I/O interfaces 505 are connected to lower component:Importation 506 including keyboard, mouse etc.;Penetrated including such as negative electrode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage part 508 including hard disk etc.;
And the communications portion 509 of the NIC including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net performs communication process.Driver 510 is also according to needing to be connected to I/O interfaces 505.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc., it is arranged on as needed on driver 510, in order to read from it
Computer program be mounted into as needed storage part 508.
Especially, may be implemented as counting according to embodiment disclosed by the invention, the process of key step figure description above
Calculation machine software program.For example, embodiment of the disclosure includes a kind of computer program product, it includes being carried on computer-readable
Computer program on medium, the computer program include the program code for being used for performing the method shown in key step figure.
In such embodiment, the computer program can be downloaded and installed by communications portion 509 from network, and/or from can
Medium 511 is dismantled to be mounted.When the computer program is performed by CPU (CPU) 501, system of the invention is performed
The above-mentioned function of middle restriction.
It should be noted that the computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer-readable recording medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, system, device or the device of infrared ray or semiconductor, or it is any more than combination.Meter
The more specifically example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more wires, just
Take formula computer disk, hard disk, random access storage device (RAM), read-only storage (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only storage (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer-readable recording medium can any include or store journey
The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this
In invention, computer-readable signal media can include in a base band or as carrier wave a part propagation data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium beyond storage medium is read, the computer-readable medium, which can send, propagates or transmit, to be used for
By instruction execution system, device either device use or program in connection.Included on computer-readable medium
Program code can be transmitted with any appropriate medium, be included but is not limited to:Wirelessly, electric wire, optical cable, RF etc., or it is above-mentioned
Any appropriate combination.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of various embodiments of the invention, method and computer journey
Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation
The part of one module of table, program segment or code, a part for above-mentioned module, program segment or code include one or more
For realizing the executable instruction of defined logic function.It should also be noted that some as replace realization in, institute in square frame
The function of mark can also be with different from the order marked in accompanying drawing generation.For example, two square frames succeedingly represented are actual
On can perform substantially in parallel, they can also be performed in the opposite order sometimes, and this is depending on involved function.Also
It is noted that the combination of each square frame and block diagram in block diagram or flow chart or the square frame in flow chart, can use and perform rule
Fixed function or the special hardware based system of operation are realized, or can use the group of specialized hardware and computer instruction
Close to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part is realized.Described module can also be set within a processor, for example, can be described as:A kind of processor bag
Include creation module, carry module and writing module.Wherein, the title of these modules is not formed to the module under certain conditions
The restriction of itself, for example, creation module is also described as " creating container in physical machine, calling LVM plug-in units to create to refer to
The module of the logical volume of constant volume ".
As on the other hand, present invention also offers a kind of computer-readable medium, the computer-readable medium can be
Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned calculating
Machine computer-readable recording medium carries one or more program, when said one or multiple programs are performed by the equipment, makes
Obtaining the equipment includes:Container is created in physical machine, calls LVM plug-in units to create the logical volume of designated capabilities;By the logic
It is wrapping with and is downloaded under the catalogue of the container;Data are write into the catalogue of the container.
Technique according to the invention scheme, the logical volume of designated capabilities is created by a LVM plug-in unit, and then be container
Being locally stored for data provides a kind of new implementation, reduces the risk of physical machine collapse;LVM perform scripts are write,
The LVM perform scripts are called by LVM plug-in units, to realize that data are locally stored;By calling the order language in LVM perform scripts
Sentence creates the logical volume of designated capabilities, and the data between container are effectively isolated, and improves container and is deposited using local
The security and validity of storage;By calculating the disk size of physical machine, container is dispatched to the sufficient physical machine of disk size
On, the disk for avoiding physical machine is made, and does not influence other processes in physical machine.
The said goods can perform the method that the embodiment of the present invention is provided, and possesses the corresponding functional module of execution method and has
Beneficial effect.Not ins and outs of detailed description in the present embodiment, reference can be made to the method that the embodiment of the present invention is provided.
Above-mentioned embodiment, does not form limiting the scope of the invention.Those skilled in the art should be bright
It is white, depending on design requirement and other factors, various modifications, combination, sub-portfolio and replacement can occur.It is any
Modifications, equivalent substitutions and improvements made within the spirit and principles in the present invention etc., should be included in the scope of the present invention
Within.
Claims (20)
1. method is locally stored in a kind of data, it is characterised in that including:
Container is created in physical machine, calls LVM plug-in units to create the logical volume of designated capabilities;
The logical volume is mounted under the catalogue of the container;
Data are write into the catalogue of the container.
2. according to the method for claim 1, it is characterised in that calling LVM plug-in units to create the logical volume of designated capabilities
The step of before, methods described also includes:LVM perform scripts are write, writes and calls the LVM of the LVM perform scripts to insert
Part.
3. according to the method for claim 2, it is characterised in that the calling LVM plug-in units are to create the logic of designated capabilities
Volume, including:LVM plug-in units are called, call the lvcreate order establishments in the LVM perform scripts to refer to by the LVM plug-in units
The logical volume of constant volume;Wherein, the LVM perform scripts include lvcreate command statements.
4. according to the method for claim 2, it is characterised in that the catalogue that the logical volume is mounted to the container
Under, including:The mount orders in the LVM perform scripts are called to be mounted to the logical volume under the catalogue of the container;Its
In, the LVM perform scripts include mount command statements.
5. according to the method for claim 3, it is characterised in that calling LVM plug-in units to create the logical volume of designated capabilities
The step of and the logical volume is being mounted between the step under the catalogue of the container, methods described also includes:Call
Lvcreate orders in the LVM perform scripts add unique mark for the logical volume;Wherein, the unique mark is root
The general unique identifier generated according to the nanoseconds of the physical machine.
6. according to the method for claim 2, it is characterised in that methods described also includes:
Calculate the disk size of the physical machine;
Determine that the disk size is more than the disk size of the container application, the container is dispatched to the physical machine
On.
7. according to the method for claim 6, it is characterised in that the disk size for calculating the physical machine, including:Adjust
The disk size of the physical machine is calculated with the vgdisplay orders in the LVM perform scripts;Wherein, the LVM performs pin
This includes vgdisplay command statements.
8. according to the method for claim 2, it is characterised in that methods described also includes:, will when the container is deleted
Deleted after the logical volume unloading of the container carry.
9. according to the method for claim 8, it is characterised in that the logical volume by the container carry unloads laggard
Row is deleted, including:
The umount orders in the LVM perform scripts are called to unload the logical volume of the container carry;
The lvremove orders in the LVM perform scripts are called to delete the logical volume of the container carry;Wherein, the LVM
Perform script includes umount command statements and lvremove command statements.
A kind of 10. data local storage, it is characterised in that including:
Creation module, for creating container in physical machine, LVM plug-in units are called to create the logical volume of designated capabilities;
Carry module, for the logical volume to be mounted under the catalogue of the container;
Writing module, for writing data into the catalogue of the container.
11. device according to claim 10, it is characterised in that described device also includes:Module is write, for writing
LVM perform scripts, write the LVM plug-in units for calling the LVM perform scripts.
12. device according to claim 11, it is characterised in that the creation module, be additionally operable to:LVM plug-in units are called, are led to
Crossing the LVM plug-in units calls the lvcreate orders in the LVM perform scripts to create the logical volume of designated capabilities;Wherein,
The LVM perform scripts include lvcreate command statements.
13. device according to claim 11, it is characterised in that the carry module, be additionally operable to:The LVM is called to hold
The logical volume is mounted under the catalogue of the container by the mount orders in traveling far and wide originally;Wherein, in the LVM perform scripts
Including mount command statements.
14. device according to claim 12, it is characterised in that described device also includes:Add module is identified, for adjusting
It is that the logical volume adds unique mark with the lvcreate orders in the LVM perform scripts;Wherein, the unique mark is
The general unique identifier generated according to the nanoseconds of the physical machine.
15. device according to claim 11, it is characterised in that described device also includes:Scheduler module is calculated, based on
Calculate the disk size of the physical machine;And
Confirm that the disk size is more than the disk size of the container application, the container is dispatched to the physical machine
On.
16. device according to claim 15, it is characterised in that the calculating scheduler module, be additionally operable to:Described in calling
Vgdisplay orders in LVM perform scripts calculate the disk size of the physical machine;Wherein, wrapped in the LVM perform scripts
Include vgdisplay command statements.
17. device according to claim 11, it is characterised in that described device also includes:Removing module is unloaded, for working as
When the container is deleted, it will be deleted after the logical volume unloading of the container carry.
18. device according to claim 17, it is characterised in that the unloading removing module, be additionally operable to:
The umount orders in the LVM perform scripts are called to unload the logical volume of the container carry;And
The lvremove orders in the LVM perform scripts are called to delete the logical volume of the container carry;Wherein, the LVM
Perform script includes umount command statements and lvremove command statements.
19. a kind of electronic equipment, it is characterised in that including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are by one or more of computing devices so that one or more of processors are real
The now method as described in any in claim 1-9.
20. a kind of computer-readable medium, is stored thereon with computer program, it is characterised in that described program is held by processor
The method as described in any in claim 1-9 is realized during row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710976082.7A CN107885461B (en) | 2017-10-19 | 2017-10-19 | Data local storage method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710976082.7A CN107885461B (en) | 2017-10-19 | 2017-10-19 | Data local storage method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107885461A true CN107885461A (en) | 2018-04-06 |
CN107885461B CN107885461B (en) | 2022-02-01 |
Family
ID=61781853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710976082.7A Active CN107885461B (en) | 2017-10-19 | 2017-10-19 | Data local storage method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107885461B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113504954A (en) * | 2021-07-08 | 2021-10-15 | 华云数据控股集团有限公司 | Method, system and medium for calling CSI LVM plug-in, dynamic persistent volume provisioning |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7650366B1 (en) * | 2005-09-09 | 2010-01-19 | Netapp, Inc. | System and method for generating a crash consistent persistent consistency point image set |
CN102833334A (en) * | 2012-08-23 | 2012-12-19 | 广东电子工业研究院有限公司 | Logical volume management method |
US20140082281A1 (en) * | 2004-04-30 | 2014-03-20 | Netapp, Inc. | Extension of write anywhere file system layout |
CN104111800A (en) * | 2013-04-18 | 2014-10-22 | 阿里巴巴集团控股有限公司 | Virtual disk IO port scheduling method and scheduling device |
CN104991815A (en) * | 2015-06-19 | 2015-10-21 | 北京奇虎科技有限公司 | Docker container management method and system |
CN105573819A (en) * | 2015-12-11 | 2016-05-11 | 国云科技股份有限公司 | Method for obtaining disk capacity information of virtual machine directly through host machine |
CN106126123A (en) * | 2016-06-28 | 2016-11-16 | 浪潮电子信息产业股份有限公司 | The method of a kind of host volume distribution, Apparatus and system |
CN106201357A (en) * | 2016-07-18 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | The construction method of a kind of storage pool and system |
CN106446275A (en) * | 2016-10-21 | 2017-02-22 | 国云科技股份有限公司 | Method for achieving container supporting file system expansion |
CN107066310A (en) * | 2017-03-11 | 2017-08-18 | 郑州云海信息技术有限公司 | It is a kind of to build and using the method and device in the privately owned warehouses of safe Docker |
CN107193506A (en) * | 2017-06-22 | 2017-09-22 | 山东超越数控电子有限公司 | A kind of implementation method for kylin system root partition dilatation of getting the bid |
-
2017
- 2017-10-19 CN CN201710976082.7A patent/CN107885461B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140082281A1 (en) * | 2004-04-30 | 2014-03-20 | Netapp, Inc. | Extension of write anywhere file system layout |
US7650366B1 (en) * | 2005-09-09 | 2010-01-19 | Netapp, Inc. | System and method for generating a crash consistent persistent consistency point image set |
CN102833334A (en) * | 2012-08-23 | 2012-12-19 | 广东电子工业研究院有限公司 | Logical volume management method |
CN104111800A (en) * | 2013-04-18 | 2014-10-22 | 阿里巴巴集团控股有限公司 | Virtual disk IO port scheduling method and scheduling device |
CN104991815A (en) * | 2015-06-19 | 2015-10-21 | 北京奇虎科技有限公司 | Docker container management method and system |
CN105573819A (en) * | 2015-12-11 | 2016-05-11 | 国云科技股份有限公司 | Method for obtaining disk capacity information of virtual machine directly through host machine |
CN106126123A (en) * | 2016-06-28 | 2016-11-16 | 浪潮电子信息产业股份有限公司 | The method of a kind of host volume distribution, Apparatus and system |
CN106201357A (en) * | 2016-07-18 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | The construction method of a kind of storage pool and system |
CN106446275A (en) * | 2016-10-21 | 2017-02-22 | 国云科技股份有限公司 | Method for achieving container supporting file system expansion |
CN107066310A (en) * | 2017-03-11 | 2017-08-18 | 郑州云海信息技术有限公司 | It is a kind of to build and using the method and device in the privately owned warehouses of safe Docker |
CN107193506A (en) * | 2017-06-22 | 2017-09-22 | 山东超越数控电子有限公司 | A kind of implementation method for kylin system root partition dilatation of getting the bid |
Non-Patent Citations (1)
Title |
---|
SHISHIR MAHAJAN: "Working with Docker LVM Plugin", 《PROJECTATOMIC网站》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113504954A (en) * | 2021-07-08 | 2021-10-15 | 华云数据控股集团有限公司 | Method, system and medium for calling CSI LVM plug-in, dynamic persistent volume provisioning |
CN113504954B (en) * | 2021-07-08 | 2024-02-06 | 华云数据控股集团有限公司 | Method, system and medium for calling CSI LVM plug in and dynamic persistent volume supply |
Also Published As
Publication number | Publication date |
---|---|
CN107885461B (en) | 2022-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107590186B (en) | Method for managing and executing data processing policy and policy engine system | |
CN107844324A (en) | Customer terminal webpage redirects treating method and apparatus | |
CN110245011A (en) | A kind of method for scheduling task and device | |
CN108874506A (en) | Virtual machine leads directly to the thermomigration process and device of equipment | |
CN110019125A (en) | The method and apparatus of data base administration | |
CN110113408A (en) | A kind of block synchronous method, equipment and storage medium | |
CN107480205A (en) | A kind of method and apparatus for carrying out data partition | |
CN107862044A (en) | The method and apparatus of displayed page | |
CN108874513A (en) | Handle method, system, electronic equipment and the computer-readable medium of timed task | |
CN107506218A (en) | The management method and management system of a kind of configuration file | |
CN110135925A (en) | Order processing system, method and apparatus | |
CN110019123A (en) | A kind of data migration method and device | |
CN110427304A (en) | O&M method, apparatus, electronic equipment and medium for banking system | |
CN110473036A (en) | A kind of method and apparatus generating order number | |
CN110019263A (en) | Information storage means and device | |
US20240126417A1 (en) | Method, form data processing method, apparatus, and electronic device for form generation | |
CN110019437A (en) | A kind of method and system exporting data | |
CN108804295A (en) | log information recording method and device | |
CN110020376A (en) | Data linkage method and system | |
CN107644075A (en) | The method and apparatus for collecting page info | |
CN109840116A (en) | A kind of method and apparatus loading resource file | |
CN110109983A (en) | A kind of method and apparatus operating Redis database | |
CN107800779A (en) | Optimize the method and system of load balancing | |
CN108845864A (en) | A kind of JVM rubbish recovering method and device based on spring frame | |
CN110147184A (en) | Navigate the method to retract and control |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |