CN106844460B - Method for realizing virtual file system by using Docker container - Google Patents

Method for realizing virtual file system by using Docker container Download PDF

Info

Publication number
CN106844460B
CN106844460B CN201611189176.1A CN201611189176A CN106844460B CN 106844460 B CN106844460 B CN 106844460B CN 201611189176 A CN201611189176 A CN 201611189176A CN 106844460 B CN106844460 B CN 106844460B
Authority
CN
China
Prior art keywords
file
docker container
virtual
container
file system
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
CN201611189176.1A
Other languages
Chinese (zh)
Other versions
CN106844460A (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.)
Shandong Inspur Science Research Institute Co Ltd
Original Assignee
Inspur Group 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 Inspur Group Co Ltd filed Critical Inspur Group Co Ltd
Priority to CN201611189176.1A priority Critical patent/CN106844460B/en
Publication of CN106844460A publication Critical patent/CN106844460A/en
Application granted granted Critical
Publication of CN106844460B publication Critical patent/CN106844460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems

Landscapes

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

Abstract

The invention relates to the technical field of computer virtual storage, in particular to a method for realizing a virtual file system by using a Docker container. The invention relates to a method for realizing a virtual file system by using a Docker container, which comprises the steps of establishing a Docker container virtual environment, mapping physical addresses of disks in the Docker container virtual environment through container configuration, caching the Docker container virtual environment when storing files, and then storing the disks. According to the method for realizing the virtual file system by using the Docker container, the virtual file system can be realized by using the container-level virtualization technology Docker, so that the storage overhead of the conventional virtual file system is reduced, and the file storage efficiency is improved.

Description

Method for realizing virtual file system by using Docker container
Technical Field
The invention relates to the technical field of computer virtual storage, in particular to a method for realizing a virtual file system by using a Docker container.
Background
Operating systems may support a variety of underlying different file systems (e.g., NTFS, FAT, ext3, ext 4), and Linux adds a layer of abstraction between user processes and the underlying file system to provide a unified view of the file system, called a virtual file system, to kernel and user processes. The virtual file system provides a set of uniform interfaces for accessing files, directories and other objects on one hand, and is adaptive to the underlying file system on the other hand.
Virtual file system architecture, as shown in FIG. 1.
Docker shares an operating system, abstracts the concept of containers, and isolates different containers from each other. The Docker technology can enable containers to cross barriers of physical machines, communication mechanisms are established among different containers, the Docker is a virtualization mode on an operating system, management of the containers can be conveniently carried out, and the operating system of the local physical machine can be conveniently used.
The difference between Docker and virtual machine access address is shown in fig. 2.
In the prior art, a virtual file system of a Linux operating system is not a physical file system, but a conversion mechanism, and is a series of data interfaces only stored in a memory space. At present, the virtual file system has high storage cost and low file storage efficiency.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a method for realizing a virtual file system by using a Docker container, which can realize the virtual file system by using a container-level virtualization technology Docker, reduce the storage overhead of the existing virtual file system and improve the file storage efficiency.
The technical scheme adopted by the invention is as follows:
a method for realizing a virtual file system by using a Docker container comprises the steps of creating a Docker container virtual environment, mapping physical addresses of disks in the Docker container virtual environment through container configuration, caching the Docker container virtual environment when storing files, and then storing the disks.
A disk cache region is also arranged between the virtual environment of the Docker container and the disk, and is a virtual region between the container and the disk, a pointer for internally storing files and a file operation queue.
The Docker container virtual environment comprises a file modification content block, a file difference block and a file pointer, when the modification and storage operation of a file is carried out, the operation is carried out in the file modification content block, after the operation is finished, the file modification is compared with the file data in the file difference block, if the file modification and storage operation is different, the file modification is required to be stored in a disk, the file to be stored firstly traverses a disk cache region by using the file pointer, whether a corresponding file exists in the disk cache region is searched, if the disk cache region exists, the whole file is modified and stored in the disk cache region, and after all the file operation is finished, the batch file storage operation is carried out.
The technical scheme provided by the invention has the beneficial effects that:
the invention is realized based on a Linux file system. The basic idea of the invention is: a virtual application environment is constructed by utilizing a container technology, internal management is carried out in the environment through container configuration, the physical addresses of the disks are directly mapped, caching is carried out in the virtual environment when files are stored, the disk storage is directly carried out by adopting a write-back method, the virtual physical addresses are not needed, the disk access times are reduced, and the expense of file storage operation is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a prior art virtual file system architecture diagram;
FIG. 2 is a schematic diagram illustrating differences between a Docker container and a virtual machine access address in the prior art;
fig. 3 is an implementation schematic diagram of a method for implementing a virtual file system by using a Docker container according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
As shown in fig. 3, a virtual environment is created using a Docker container, and the environment has a configuration file, and the container generation is performed using the configuration file. Different file systems at the bottom layer are adapted to different containers, and each container comprises contents such as file modification content blocks, file difference blocks, file pointers and the like.
When the file is modified and stored, the operation is actually carried out in the file modification content block. After the operation is finished, the file data in the file difference block is compared, and if the difference exists, the file is required to be modified and saved in a disk. The file to be stored firstly traverses a disk cache region by using a file pointer, wherein the disk cache region is a virtual region between a container and a disk, and the pointer for internally storing the file and a file operation queue are arranged inside the disk cache region.
And searching whether a corresponding file exists in the disk cache region, modifying the whole file if the disk cache region exists, storing the modified file in the cache region, performing batch file storage operation after all file operations are completed, and performing disk access only once, so that the disk access times are reduced, and the file storage efficiency is improved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (1)

1. A method for realizing a virtual file system by using a Docker container comprises the steps of establishing a Docker container virtual environment, mapping physical addresses of disks in the Docker container virtual environment through container configuration, caching the Docker container virtual environment when storing files, and then storing the disks;
a disk cache region is also arranged between the virtual environment of the Docker container and the disk, and the disk cache region is a virtual region between the container and the disk, and internally stores a pointer of a file and a file operation queue;
the Docker container virtual environment comprises a file modification content block, a file difference block and a file pointer, when modification and storage operations of files are carried out, the operation is carried out in the file modification content block, after the operation is finished, the operation is compared with file data in the file difference block, if the operation is different, the file modification is required to be stored in a disk, the file to be stored firstly traverses a disk cache region by using the file pointer, whether a corresponding file exists in the disk cache region is searched, if the disk cache region exists, the whole file is modified and stored in the disk cache region, and after all the file operations are finished, batch file storage operations are carried out.
CN201611189176.1A 2016-12-21 2016-12-21 Method for realizing virtual file system by using Docker container Active CN106844460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611189176.1A CN106844460B (en) 2016-12-21 2016-12-21 Method for realizing virtual file system by using Docker container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611189176.1A CN106844460B (en) 2016-12-21 2016-12-21 Method for realizing virtual file system by using Docker container

Publications (2)

Publication Number Publication Date
CN106844460A CN106844460A (en) 2017-06-13
CN106844460B true CN106844460B (en) 2020-06-16

Family

ID=59140678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611189176.1A Active CN106844460B (en) 2016-12-21 2016-12-21 Method for realizing virtual file system by using Docker container

Country Status (1)

Country Link
CN (1) CN106844460B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392393B (en) * 2021-06-25 2022-04-15 杉数科技(北京)有限公司 Floating authorization method and device of solver and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309820A (en) * 2013-06-28 2013-09-18 曙光信息产业(北京)有限公司 Implementation method for disk array cache
CN105518693A (en) * 2014-12-29 2016-04-20 华为技术有限公司 Safety protection method and device
KR101644958B1 (en) * 2015-12-23 2016-08-12 한국과학기술정보연구원 An appparatus and method of cluster construction for providing customized computing resources for mutiple users

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309820A (en) * 2013-06-28 2013-09-18 曙光信息产业(北京)有限公司 Implementation method for disk array cache
CN105518693A (en) * 2014-12-29 2016-04-20 华为技术有限公司 Safety protection method and device
KR101644958B1 (en) * 2015-12-23 2016-08-12 한국과학기술정보연구원 An appparatus and method of cluster construction for providing customized computing resources for mutiple users

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Docker 技术的移植性分析研究;于烨 等;《软件》;20150731;全文 *
docker中的存储驱动程序:深入研究;ESTESP;《INTEGRATED CODE BLOG》;20161001;正文第5-10页 *

Also Published As

Publication number Publication date
CN106844460A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
US9760493B1 (en) System and methods of a CPU-efficient cache replacement algorithm
US10140461B2 (en) Reducing resource consumption associated with storage and operation of containers
CN109697016B (en) Method and apparatus for improving storage performance of containers
CN110196757A (en) TLB filling method, device and the storage medium of virtual machine
US9110917B2 (en) Creating a file descriptor independent of an open operation
CN108664523A (en) A kind of virtual disk files format conversion method and device
US20150067005A1 (en) Path resolver for client access to distributed file systems
WO2015043376A1 (en) Page access method and page access device, and server
JP2021517307A (en) Hybrid memory system
JP2021518605A (en) Hybrid memory system
CN105095113A (en) Cache management method and system
US11836087B2 (en) Per-process re-configurable caches
US11500822B2 (en) Virtualized append-only interface
CN116680233A (en) File access method, system, electronic equipment and machine-readable storage medium
US11860792B2 (en) Memory access handling for peripheral component interconnect devices
CN106844460B (en) Method for realizing virtual file system by using Docker container
JP2021516402A (en) Hybrid memory system
CN107209720B (en) System and method for page caching and storage medium
US11900142B2 (en) Improving memory access handling for nested virtual machines
US20230185593A1 (en) Virtual device translation for nested virtual machines
US11249914B2 (en) System and methods of an efficient cache algorithm in a hierarchical storage system
US11093169B1 (en) Lockless metadata binary tree access
US11403212B1 (en) Deduplication assisted caching policy for content based read cache (CBRC)
US11748136B2 (en) Event notification support for nested virtual machines
US11507402B2 (en) Virtualized append-only storage device

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

Effective date of registration: 20200519

Address after: 250100 Ji'nan high tech Zone, Shandong, No. 1036 wave road

Applicant after: INSPUR GROUP Co.,Ltd.

Address before: 250100, Ji'nan province high tech Zone, Sun Village Branch Road, No. 2877, building, floor, building, on the first floor

Applicant before: JINAN INSPUR HIGH-TECH TECHNOLOGY DEVELOPMENT Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230328

Address after: 250000 building S02, No. 1036, Langchao Road, high tech Zone, Jinan City, Shandong Province

Patentee after: Shandong Inspur Scientific Research Institute Co.,Ltd.

Address before: No. 1036, Shandong high tech Zone wave road, Ji'nan, Shandong

Patentee before: INSPUR GROUP Co.,Ltd.

TR01 Transfer of patent right