CN115017117A - Local disk-based container file system online capacity expansion method and system - Google Patents

Local disk-based container file system online capacity expansion method and system Download PDF

Info

Publication number
CN115017117A
CN115017117A CN202210937542.6A CN202210937542A CN115017117A CN 115017117 A CN115017117 A CN 115017117A CN 202210937542 A CN202210937542 A CN 202210937542A CN 115017117 A CN115017117 A CN 115017117A
Authority
CN
China
Prior art keywords
volume
capacity expansion
file system
weight
host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210937542.6A
Other languages
Chinese (zh)
Other versions
CN115017117B (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.)
Whale Cloud Technology Co Ltd
Original Assignee
Whale Cloud Technology 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 Whale Cloud Technology Co Ltd filed Critical Whale Cloud Technology Co Ltd
Priority to CN202210937542.6A priority Critical patent/CN115017117B/en
Publication of CN115017117A publication Critical patent/CN115017117A/en
Application granted granted Critical
Publication of CN115017117B publication Critical patent/CN115017117B/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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • 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/17Details of further file system functions
    • G06F16/1737Details of further file system functions for reducing power consumption or coping with limited storage space, e.g. in mobile devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • 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/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • 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]

Landscapes

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

Abstract

The invention discloses a method and a system for online capacity expansion of a container file system based on a local disk, wherein the method comprises the following steps: receiving a request of a user for expanding a Kubernets container file system; pre-allocating the persistent volume needing capacity expansion; preprocessing a persistent volume needing capacity expansion and judging whether local storage resources meet the capacity expansion requirement or not; sending a request for expanding the persistent volume applied by the Kubernetes container file system to a host machine to which the persistent volume belongs; capacity expansion is carried out on a corresponding storage volume through a host machine to which the persistent volume belongs; and carrying out online capacity expansion on the Kubernets container file system at the host side where the Kubernets container file system is located. The invention can perform online capacity expansion according to the local disk resources of the host, ensure the external availability of the application service in the container during capacity expansion, and ensure that the application service with high priority can obtain the capacity expansion of the file system preferentially.

Description

Local disk-based container file system online capacity expansion method and system
Technical Field
The invention relates to the field of Kubernetes container file system online capacity expansion, in particular to a container file system online capacity expansion method and system based on a local disk.
Background
Kubernets is a container-based cluster management system, is constructed on container operating environments such as docker and container, is used for managing containerized workload and services, is a portable and extensible open-source platform, has a large and rapidly-growing ecosystem, and is widely available in services, support and tools.
Pod is the smallest deployable computing unit created and managed in kubernets, containing one or more containers that share storage, a network, and a declaration of how to run the containers. Pod models an application-specific "logical host" that contains one or more application containers that are relatively tightly coupled together.
The PV (Persistent Volume) is a piece of Storage in the cluster, and may be provisioned beforehand by an administrator or dynamically using a Storage Class (Storage Class). Persistent volumes are cluster resources, just as nodes are also cluster resources. PV persistent volumes, like ordinary volumes, are also implemented using Volume plug-ins, except that they have a life cycle that is independent of any Pod using the PV.
The PVC (Persistent Volume Claim) expresses a user request for storage. Conceptually similar to Pod. Pod consumes node resources and PVC claiming consumes PV resources. A Pod may request a certain amount of resources (CPU and memory); also the PVC claim may request a specific size and access mode.
Storage Class provides a way for administrators to describe the Storage "classes". Different types may map to different quality of service levels or backup policies, or any policy made by the cluster administrator.
With the continuous improvement of the cost performance of self-contained storage media such as a hardware server, a private virtual machine, a public cloud ECS and the like, more and more enterprise clients select to store application service data based on a host local disk, and with the continuous energization of new technologies such as big data, AI and the like, the data scale of the application service of the enterprise clients is also larger and larger, so that the system can be used as a container storage resource system based on the local disk to provide application service with the high-cost-performance storage resource capable of conveniently using the host local disk for online capacity expansion, and can preferentially ensure the capacity expansion capability of the important application service, and the problem is urgently needed to be solved. The conventional Kubernetes storage subsystem cannot realize online capacity expansion of a file system from a local disk of a host, can only be completed by stopping application service and manually operating, and is difficult to accurately manage the priority of the application service manually.
An effective solution to the problems in the related art has not been proposed yet.
Disclosure of Invention
Aiming at the problems in the related art, the invention provides a method and a system for online capacity expansion of a container file system based on a local disk, so as to overcome the technical problems in the prior related art.
Therefore, the invention adopts the following specific technical scheme:
according to an aspect of the present invention, there is provided a method for online capacity expansion of a container file system based on a local disk, the method including the steps of:
s1, receiving a request of a user for expanding a Kubernets container file system;
s2, pre-distributing the persistent volumes needing capacity expansion;
s3, preprocessing the persistent volume needing capacity expansion and judging whether the local storage resource meets the capacity expansion requirement;
s4, sending a request for expanding the persistent volume applied by a Kubernetes container file system to a host to which the persistent volume belongs;
s5, expanding the capacity of the corresponding storage volume through the host machine to which the persistent volume belongs;
s6, carrying out online capacity expansion on the Kubernets container file system at the host side where the Kubernets container file system is located.
Further, the request for receiving the user expansion of the kubernets container file system includes a required value for storage capacity expansion.
Further, the pre-allocating the persistent volume that needs capacity expansion includes the following steps:
s21, acquiring the ID of the storage volume according to the persistent volume needing capacity expansion, and inquiring which host containing local storage resources allocates the storage volume according to the ID of the storage volume;
and S22, calculating list information of the allocated storage volumes on the host machine, and then calculating a total priority weight value.
Further, the calculation formula for calculating the list information of the allocated storage volumes on the host and then calculating the total value of the total priority weight is as follows:
Total_Volumes_Weight=sum(Volume1_Weight,Volume2_Weight,…, VolumeN_Weight)
the Volume N _ Weight represents the priority Weight value of the Nth Volume of the local disk allocated by the host, the default value is 1, and the value range is a positive integer;
volume1_ Weight, Volume2_ Weight, …, Volume N _ Weight represents the list of Volume priority weights that the host has assigned to the local disk.
Further, the preprocessing the persistent volume that needs to be expanded and determining whether the local storage resource meets the expansion requirement includes the following steps:
s31, calculating the weight ratio of the priority weight value of the capacity expansion storage volume of the current application in the storage volume distributed by the host machine to which the capacity expansion storage volume belongs, wherein the calculation formula is as follows:
Weight_Ratio=Need_Extend_Volume_Weight/sum(Volume_1_Weight,Volume_2_Weight,Volume_3_Weight,…,Volume_N_Weight)
wherein Need _ Extend _ Volume _ Weight represents the priority Weight value of the Volume of the current application expansion;
the Volume _ N _ Weight represents the Nth Volume priority Weight value on the host node where the Volume expansion Volume is located in the current application, and the value of N is a positive integer greater than 0;
weight _ Ratio represents the Weight Ratio of the priority Weight value in the storage volume distributed by the host machine to which the priority Weight value belongs, and the value range is 0-1;
s32, inquiring the remaining available expansion capacity Free _ Extend _ Size on the host machine;
s33, calculating the maximum capacity expansion capacity which can be applied by the capacity expansion storage volume of the current application, wherein the calculation formula is as follows:
Max_Volume_Extend_Size=Weight_Ratio*Free_Extend_Size
wherein, Weight _ Ratio represents the Weight proportion of the priority Weight value in the distributed storage volume of the host machine to which the priority Weight value belongs, and the value range is 0-1;
free _ Extend _ Size represents the remaining available expansion capacity of the host machine to which the expansion Volume belongs in the current application, and the unit is GB;
s34, comparing the required size of the capacity expansion storage volume of the current application with the maximum allowable capacity expansion capacity of the storage volume, and judging whether the capacity expansion application can be allowed or not.
Further, the sending the request for expanding the persistent volume, which is applied by the kubernets container file system, to the host to which the persistent volume belongs includes the following steps:
s41, sending the request information of the storage volume needing to be expanded to the host machine to which the storage volume belongs;
s42, inquiring a gPRC interface of a host to which the storage volume belongs through host information, and sending request information for expanding the storage volume to the gPRC interface.
Further, the expanding the capacity of the corresponding storage volume by the host to which the persistent volume belongs includes the following steps:
s51, receiving a capacity expansion request of a file system storage volume applied by the container;
s52, analyzing the capacity expansion request of the storage volume, and acquiring the volume group, the logical volume, the capacity expansion capacity and the file system type of the storage volume, wherein the file system type comprises xfs and ext 4;
s53, capacity expansion is carried out on the logical volume according to the capacity expansion requirement;
and S54, generating the expanded storage volume information, and adding a container needing to be refreshed in the information.
Further, the online capacity expansion of the kubernets container file system at the host side where the kubernets container file system is located includes the following steps:
s61, returning the generated and expanded storage volume information to a Kubernets container file system;
s62, triggering a host machine to expand the container file system through the Kubernetes container file system;
s63, detecting whether the storage volume is mounted on the host side;
s64, expanding the size of the Kubernets container file system according to the file system type.
According to another aspect of the present invention, a system for online capacity expansion of a container file system based on a local disk is provided, where the system includes a capacity expansion management service unit, a local disk capacity expansion management unit, and a node capacity expansion management unit;
the capacity expansion management service unit is used for realizing the capacity expansion management function of the storage volume resources;
the local disk capacity expansion management unit is used for realizing the capacity expansion management function of the host local disk;
and the node capacity expansion management unit is used for realizing the function of online capacity expansion of the file system.
Further, the host type of the host machine comprises at least one of a bare metal server, a private cloud virtual machine or a public cloud ECS server.
The invention has the beneficial effects that:
1. the method for managing the maximum expandable space of the online expansion of the container file system according to the priority weight ratio of the application service can effectively filter the online expansion application of the container file system, screen out the requirement that the application service has low priority weight but overlarge expansion capacity, avoid the available expansion storage resources of the local disk of the host from being rapidly consumed, and ensure that the expansion requirement of the file system of the application service with high priority weight can be effectively met.
2. The invention adopts a method for expanding the local disk of the host machine, and adopts a layered expansion mode on the basis that the expansion application of the file system with high priority weight of the container application service can be ensured, namely, the online expansion of the storage terminal equipment is realized by the method for expanding the local disk logical volume of the host machine online, and then the online expansion of the container file system is realized by the method for carrying out mounting heavy load and size refreshing on the container file system of the host machine, thereby avoiding the problem that the container application service needs to be stopped when the whole expansion is carried out by manual operation, and ensuring the online effectiveness of the application service when the container file system based on the local disk is expanded.
3. The invention aims to provide an automatic response system for the capacity expansion requirement of a Kubernets container file system, effectively ensure the requirement with high priority weight and realize the online capacity expansion of the container file system based on a local disk by receiving and analyzing the requirement of the container file system on-line capacity expansion application, pre-distributing the storage capacity expansion, preprocessing the storage capacity expansion, capacity expansion storage, reloading the file system and a method for adjusting the size of the file system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described 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 without creative efforts.
FIG. 1 is a flowchart illustrating a method for online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention;
FIG. 2 is a second flowchart of a method for online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention;
FIG. 3 is a third flowchart of a method for online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a fourth method for online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention;
FIG. 5 is a fifth flowchart of a method for online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a sixth method for online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention;
fig. 7 is a system functional diagram of online capacity expansion of a container file system based on a local disk according to an embodiment of the present invention.
Detailed Description
For further explanation of the various embodiments, the drawings which form a part of the disclosure and which are incorporated in and constitute a part of this specification, illustrate embodiments and, together with the description, serve to explain the principles of operation of the embodiments, and to enable others of ordinary skill in the art to understand the various embodiments and advantages of the invention, and, by reference to these figures, reference is made to the accompanying drawings, which are not to scale and wherein like reference numerals generally refer to like elements.
According to the embodiment of the invention, a method and a system for online capacity expansion of a container file system based on a local disk are provided.
Referring now to the drawings and the detailed description, in accordance with an embodiment of the present invention, a method for online capacity expansion of a container file system based on a local disk is provided, as shown in fig. 1, the method includes the following steps:
s1, receiving a request of a user for expanding a Kubernets container file system;
wherein, the request for receiving the user capacity expansion Kubernets container file system comprises a required value of storage capacity expansion;
specifically, a request for modifying the size of the kubernets PVC by a user is received and analyzed, as shown in fig. 2, a kubernets cluster is responsible for monitoring a request for PVC size adjustment initiated by the user to the kubernets in real time, and the kubernets cluster analyzes a storage resource requirement of a container for the request, where key information included in the storage resource application requirement in this step is shown in table 1 below:
TABLE 1 Key information
Figure 583303DEST_PATH_IMAGE001
S2, pre-distributing the persistent volumes needing capacity expansion;
as shown in fig. 3, the pre-allocating the persistent volume that needs to be expanded includes the following steps:
s21, acquiring the ID of the storage volume according to the persistent volume needing capacity expansion, and inquiring which host containing local storage resources distributes the storage volume through the ID of the storage volume;
s22, calculating the list information of the distributed storage volumes on the host machine, and then calculating the total priority weight value;
specifically, the calculation formula for calculating the list information of the storage volumes allocated to the host and then calculating the total value of the total priority weight is as follows:
Total_Volumes_Weight=sum(Volume1_Weight,Volume2_Weight,…, VolumeN_Weight)
the Volume N _ Weight represents the priority Weight value of the Nth Volume of the local disk allocated by the host, the default value is 1, and the value range is a positive integer; the larger the value of VolumeN _ Weight is, the higher the capacity expansion priority owned by the storage volume is, and the larger the capacity which can be expanded is;
volume1_ Weight, Volume2_ Weight, …, Volume N _ Weight represents the list of Volume priority weights that the host has assigned to the local disk.
Specifically, a statistical list of priority weight values and total priority weight values of a plurality of created volumes on a plurality of hosts is shown in table 2 below:
TABLE 2 statistical List
Figure 286555DEST_PATH_IMAGE002
S3, preprocessing the persistent volume needing capacity expansion and judging whether the local storage resource meets the capacity expansion requirement;
as shown in fig. 4, the preprocessing the persistent volume that needs to be expanded and determining whether the local storage resource meets the expansion requirement includes the following steps:
s31, calculating the weight ratio of the priority weight value of the capacity expansion storage volume of the current application in the storage volume distributed by the host machine to which the capacity expansion storage volume belongs, wherein the calculation formula is as follows:
Weight_Ratio=Need_Extend_Volume_Weight/sum(Volume_1_Weight,Volume_2_Weight,Volume_3_Weight,…,Volume_N_Weight)
wherein Need _ Extend _ Volume _ Weight represents the priority Weight value of the Volume of the current application expansion;
the Volume _ N _ Weight represents the Nth Volume priority Weight value on the host node where the Volume expansion Volume is located in the current application, and the value of N is a positive integer greater than 0;
weight _ Ratio represents the Weight Ratio of the priority Weight value in the storage volume distributed by the host machine to which the priority Weight value belongs, and the value range is 0-1;
s32, inquiring the remaining available expansion capacity Free _ Extend _ Size on the host machine;
s33, calculating the maximum capacity expansion capacity which can be applied by the capacity expansion storage volume of the current application, wherein the calculation formula is as follows:
Max_Volume_Extend_Size=Weight_Ratio*Free_Extend_Size
wherein, Weight _ Ratio represents the Weight Ratio of the priority Weight value in the storage volume distributed by the host machine to which the Weight value belongs, and the value range is 0-1;
free _ Extend _ Size represents the remaining available expansion capacity of the host to which the expansion Volume belongs in the current application, and the unit is GB (gigabyte);
in addition, in order to ensure that the capacity of the container file system of the application service with high running priority can be successfully expanded as much as possible, the host machine reserves a certain proportion (for example, 20%) of available expansion capacity;
s34, comparing the required size of the capacity expansion storage volume of the current application with the maximum allowable capacity expansion capacity of the storage volume, and judging whether the capacity expansion application can be allowed or not;
specifically, the logic for determining whether the current capacity expansion application is allowed is shown in the following algorithm 1:
algorithm 1: evaluating whether the current capacity expansion application can be allowed
Input: NE (NE) with size required by Volume expansion of application sizes (ii) a ME is the maximum allowable Volume capacity of the Volume sizes
Output: whether or not it can be allowed to expandCapacity EX is
1. if ME sizes >= NE sizes then
2. EX is = True
3. else
4. EX is = False
5. end
Wherein, if a certain application expands ME of Volume sizes >= NESize, then the expansion of the application is allowed, EX is used is Setting as True; otherwise, the EX is is Set to False.
As shown in the following table 3, it is a list of whether each Volume in the example of table 1 in step S1 is satisfied when applying for capacity expansion:
table 3 satisfaction list
Figure 485455DEST_PATH_IMAGE003
S4, sending a request of capacity expansion of a persistent volume applied by a Kubernets container file system to a host machine to which the persistent volume belongs;
wherein, the sending the request of the Kubernets container file system for expanding the persistent volume to the host machine to which the persistent volume belongs comprises the following steps:
s41, sending the request information of the storage volume needing to be expanded to the host machine to which the storage volume belongs;
s42, inquiring a gPC (an open source remote process call system initiated by Google and based on HTTP/2 protocol transmission) interface of a host to which the storage volume belongs through host information, and sending request information for expanding the storage volume to the gPC interface.
S5, expanding the capacity of the corresponding storage volume through the host machine to which the persistent volume belongs;
as shown in fig. 5, the expanding the capacity of the corresponding storage volume by the host to which the persistent volume belongs includes the following steps:
s51, receiving a capacity expansion request of a file system storage volume applied by the container;
s52, analyzing a capacity expansion request of a storage volume, and acquiring a Volume Group (VG), a Logical Volume (LV), capacity expansion capacity and file system types of the storage volume, wherein the file system types comprise xfs and ext 4;
s53, capacity expansion is carried out on the logical volume according to the capacity expansion requirement;
specifically, the volume management command used in capacity expansion of the logical volume according to the capacity expansion requirement is as follows:
Lvresize -L <New_Vol_Size> -n <Vol_name>
wherein, New _ Vol _ Size represents the Size of the Volume after expansion, and the default unit is m (megabyte);
vol _ name represents the name of the Volume containing VG information;
and S54, generating the expanded storage volume information, and adding a container needing to be refreshed in the information.
Specifically, Volume information after expansion is returned to kubernets in a Controller expanded Volume Response (a return message format for expanding the Volume provided by CSI) message format, where the Volume is mounted and used in a file system manner in a container, so that node _ expansion _ required needs to be set to True in the return information to tell the kubernets that file system expansion operation needs to be triggered;
s6, carrying out online capacity expansion on the Kubernets container file system at the host side where the Kubernets container file system is located.
As shown in fig. 6, the online capacity expansion of the kubernets container file system at the host side where the kubernets container file system is located includes the following steps:
s61, returning the generated and expanded storage volume information to a Kubernets container file system;
s62, triggering a host machine to expand the container file system through the Kubernetes container file system;
s63, detecting whether the storage volume is mounted on the host side;
the detection command for detecting whether the storage volume is mounted at the host side is as follows:
findmnt -o source --noheadings --target <Volume_Mount_Path>
wherein, the Volume _ Mount _ Path is a file directory Path mounted by the Volume;
s64, expanding the size of the Kubernetes container file system according to the type of the file system;
the capacity expansion command for expanding the capacity of the Kubernets container file system according to the file system type is as follows:
the xfs file system type: xfs _ growth-d < Volume _ Path >
ext4 file system type: resize2fs < Volume _ Mount _ Path >
Wherein, the Volume _ Path is represented as a block device Path of the Volume on the host;
the Volume _ Mount _ Path represents a file directory Path on which the Volume is mounted.
According to another embodiment of the present invention, as shown in fig. 7, a system for online capacity expansion of a container file system based on a local disk is provided, where the system includes a capacity expansion management service unit, a local disk capacity expansion management unit, and a node capacity expansion management unit;
the capacity expansion management service unit is used for realizing the capacity expansion management function of the storage volume resources;
specifically, by instantiating a Volume expansion interface function of a CSI Controller of kubernets, a function of storing Volume resource expansion management is realized, which mainly includes functions of detecting the Volume validity, querying a single Volume priority weight value, querying a total value of priority rights of all allocated volumes belonging to a single host, and the like, and an operating Pod type thereof is deployment (a Pod type of kubernets);
the capacity expansion management service unit comprises a container file system capacity expansion pre-distribution module and a storage capacity expansion scheduling module;
the system comprises a container file system capacity expansion preallocation module, a Kubernets container file system capacity expansion module, a storage volume management module and a host computer node information management module, wherein the container file system capacity expansion preallocation module is used for receiving a Kubernets container file system capacity expansion request, checking whether a storage volume applying capacity expansion of a persistent volume is real and effective or not, and finding out the host computer node information to which the storage volume belongs according to the received ID information of the storage volume of the capacity expansion persistent volume required by a container; therefore, the request of the expansion Volume can be truly and effectively distributed to the correct host machine;
the storage capacity expansion scheduling module is used for inquiring a gPRC interface address of the host storage capacity expansion module according to the host node information to which the storage volume belongs, inquiring all distributed storage volume information on the host node through the gPRC interface, calculating whether the capacity of the requested capacity expansion storage volume is allowed or not, and finally sending a capacity expansion request of the container side to the storage volume to the host local disk capacity expansion module in time;
the local disk capacity expansion management unit is used for realizing the capacity expansion management function of the host local disk;
specifically, interface functions such as list query, capacity expansion, residual space query and the like of a storage volume based on a local disk are provided for other units through gPRC interface service;
the local disk capacity expansion management unit comprises a host local disk capacity expansion module and a host storage capacity expansion module;
specifically, the host computer local disk capacity expansion module is configured to receive a capacity expansion request for a storage volume from a container side;
the host storage capacity expansion module is used for providing a logical volume capacity expansion function of local disk storage resources of the host and providing a storage volume list and an interface calling service of available capacity expansion capacity for other functional modules;
the node capacity expansion management unit is used for realizing the function of online capacity expansion of the file system;
specifically, the function of online capacity expansion of the file system is realized by instantiating a capacity expansion interface function of a CSI Node (Node) of Kubernetes, and the functions of Volume mount state detection, online capacity expansion of the file system and the like are provided;
the node capacity expansion management unit comprises a host machine container file system management module;
and the host machine container file system management module is used for detecting whether the storage volume on the host machine is normally mounted and carrying out online capacity expansion on the size of the file system mounted by the storage volume according to the type of the file system.
Specifically, the host type of the host includes at least one of a bare metal Server, a private Cloud virtual machine, or a public Cloud ECS Server (Elastic Cloud Server).
In addition, the CSI plugin (CSI, which is called Container Storage Interface as a whole, is a Container Storage Interface, and is used to expose any block and file Storage system to the standard of containerization workload on a Container arrangement system (CO) such as kubernets, and a set of standard Storage call interfaces is established between the Container arrangement engine and the Storage system, and the Storage service can be provided for the Container arrangement engine through the interfaces), so that not only can a system providing automatic response to the capacity expansion requirement of the kubernets Container file system be realized, the requirement of high priority weight can be effectively ensured, and the capacity expansion online of the Container file system based on a local disk is realized, but also the CSI plugin is one of the preferred modes of realizing the online capacity expansion of the kubernets Container file system at present.
In summary, with the above technical solution of the present invention, the method for performing maximum volume-expandable space management on online volume expansion of a container file system according to an application service priority weight ratio adopted by the present invention can effectively filter online volume expansion applications of the container file system, and screen out a requirement that an application service has a low priority weight but an excessively large volume expansion capacity, so as to avoid that available volume-expandable storage resources of a host local disk are not consumed quickly, and ensure that a file system volume expansion requirement of an application service having a high priority weight can be satisfied effectively; the invention adopts a method for expanding the local disk of the host machine, and adopts a layered expansion mode on the basis that the file system expansion application with high priority weight of the container application service can be ensured, namely, firstly, the online expansion of the storage end equipment is realized by a method for the online expansion of the local disk logical volume of the host machine, and then, the online expansion of the container file system is realized by a method for carrying out mounting overload and size refreshing on the container file system of the host machine, thereby avoiding the problem that the container application service needs to be stopped when the integral expansion is carried out due to manual operation, and ensuring the online effectiveness of the application service when the container file system based on the local disk is expanded; the invention aims to provide an automatic response system for the capacity expansion requirement of a Kubernets container file system, effectively ensure the requirement with high priority weight and realize the online capacity expansion of the container file system based on a local disk by receiving and analyzing the requirement of the container file system on-line capacity expansion application, pre-distributing the storage capacity expansion, preprocessing the storage capacity expansion, capacity expansion storage, reloading the file system and a method for adjusting the size of the file system.
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 (9)

1. A method for online capacity expansion of a container file system based on a local disk is characterized by comprising the following steps:
s1, receiving a request of a user for expanding a Kubernets container file system;
s2, pre-distributing the persistent volumes needing capacity expansion;
s3, preprocessing the persistent volume needing capacity expansion and judging whether the local storage resource meets the capacity expansion requirement;
s4, sending a request for expanding the persistent volume applied by a Kubernetes container file system to a host to which the persistent volume belongs;
wherein, the sending the request of the Kubernets container file system for expanding the persistent volume to the host machine to which the persistent volume belongs comprises the following steps:
s41, sending the request information of the storage volume needing to be expanded to the host machine to which the storage volume belongs;
s42, inquiring a gPRC interface of a host to which the storage volume belongs through host information, and sending request information for expanding the storage volume to the gPRC interface;
s5, expanding the capacity of the corresponding storage volume through the host machine to which the persistent volume belongs;
s6, carrying out online capacity expansion on the Kubernets container file system at the host side where the Kubernets container file system is located.
2. The method according to claim 1, wherein the request for accepting a user to expand the kubernets container file system includes a required value for expansion of storage capacity.
3. The method for online capacity expansion of a container file system based on a local disk according to claim 1, wherein the pre-allocating the persistent volume to be expanded comprises the following steps:
s21, acquiring the ID of the storage volume according to the persistent volume needing capacity expansion, and inquiring which host containing local storage resources distributes the storage volume through the ID of the storage volume;
and S22, calculating list information of the allocated storage volumes on the host machine, and then calculating a total priority weight value.
4. The method according to claim 3, wherein the calculation formula for calculating the list information of the allocated storage volumes on the host and then calculating the total value of the total priority weight is as follows:
Total_Volumes_Weight=sum(Volume1_Weight,Volume2_Weight,…, VolumeN_Weight)
the Volume N _ Weight represents the priority Weight value of the Nth Volume of the local disk allocated by the host, the default value is 1, and the value range is a positive integer;
volume1_ Weight, Volume2_ Weight, …, Volume N _ Weight represents the list of Volume priority weights that the host has assigned to the local disk.
5. The method according to claim 4, wherein the preprocessing the persistent volume that needs to be expanded and determining whether the local storage resource meets the expansion requirement includes:
s31, calculating the weight ratio of the priority weight value of the capacity expansion storage volume of the current application in the storage volume distributed by the host machine to which the capacity expansion storage volume belongs, wherein the calculation formula is as follows:
Weight_Ratio=Need_Extend_Volume_Weight/sum(Volume_1_Weight,Volume_2_Weight,Volume_3_Weight,…,Volume_N_Weight)
wherein Need _ Extend _ Volume _ Weight represents the priority Weight value of the Volume of the current application expansion;
the Volume _ N _ Weight represents the Nth Volume priority Weight value on the host node where the Volume expansion Volume is located in the current application, and the value of N is a positive integer greater than 0;
weight _ Ratio represents the Weight Ratio of the priority Weight value in the storage volume distributed by the host machine to which the priority Weight value belongs, and the value range is 0-1;
s32, inquiring the remaining available expansion capacity Free _ Extend _ Size on the host machine;
s33, calculating the maximum capacity expansion capacity which can be applied by the capacity expansion storage volume of the current application, wherein the calculation formula is as follows:
Max_Volume_Extend_Size=Weight_Ratio*Free_Extend_Size
wherein, Weight _ Ratio represents the Weight Ratio of the priority Weight value in the storage volume distributed by the host machine to which the Weight value belongs, and the value range is 0-1;
free _ Extend _ Size represents the remaining available expansion capacity of the host machine to which the expansion Volume belongs in the current application, and the unit is GB;
s34, comparing the required size of the capacity expansion storage volume of the current application with the maximum allowable capacity expansion capacity of the storage volume, and judging whether the capacity expansion application can be allowed or not.
6. The method according to claim 1, wherein the expanding the capacity of the corresponding storage volume through the host to which the persistent volume belongs comprises:
s51, receiving a capacity expansion request of a file system storage volume applied by the container;
s52, analyzing the capacity expansion request of the storage volume, and acquiring the volume group, the logical volume, the capacity expansion capacity and the file system type of the storage volume, wherein the file system type comprises xfs and ext 4;
s53, capacity expansion is carried out on the logical volume according to the capacity expansion requirement;
and S54, generating the expanded storage volume information, and adding a container needing to be refreshed in the information.
7. The method for online capacity expansion of a container file system based on a local disk according to claim 6, wherein the online capacity expansion of the kubernets container file system on a host side where the kubernets container file system is located includes the following steps:
s61, returning the generated and expanded storage volume information to a Kubernets container file system;
s62, triggering a host machine to expand the container file system through the Kubernetes container file system;
s63, detecting whether the storage volume is mounted on the host side;
s64, expanding the size of the Kubernets container file system according to the file system type.
8. A system for online capacity expansion of a container file system based on a local disk is used for realizing the method for online capacity expansion of the container file system based on the local disk in any one of claims 1 to 7, and is characterized in that the system comprises a capacity expansion management service unit, a local disk capacity expansion management unit and a node capacity expansion management unit;
the capacity expansion management service unit is used for realizing the capacity expansion management function of the storage volume resources;
the local disk capacity expansion management unit is used for realizing the capacity expansion management function of the host local disk;
and the node capacity expansion management unit is used for realizing the function of online capacity expansion of the file system.
9. The system for online capacity expansion of the local disk-based container file system according to claim 8, wherein the host type of the host includes at least one of a bare metal server, a private cloud virtual machine, or a public cloud ECS server.
CN202210937542.6A 2022-08-05 2022-08-05 Local disk-based container file system online capacity expansion method and system Active CN115017117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210937542.6A CN115017117B (en) 2022-08-05 2022-08-05 Local disk-based container file system online capacity expansion method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210937542.6A CN115017117B (en) 2022-08-05 2022-08-05 Local disk-based container file system online capacity expansion method and system

Publications (2)

Publication Number Publication Date
CN115017117A true CN115017117A (en) 2022-09-06
CN115017117B CN115017117B (en) 2022-11-11

Family

ID=83066303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210937542.6A Active CN115017117B (en) 2022-08-05 2022-08-05 Local disk-based container file system online capacity expansion method and system

Country Status (1)

Country Link
CN (1) CN115017117B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019015288A1 (en) * 2017-07-20 2019-01-24 中兴通讯股份有限公司 Method, device and system for persistent data processing, and readable storage medium
CN111966305A (en) * 2020-10-22 2020-11-20 腾讯科技(深圳)有限公司 Persistent volume allocation method and device, computer equipment and storage medium
US20210103395A1 (en) * 2019-10-04 2021-04-08 Zettaset, Inc. Dynamic Provisioning of Container Storage
CN113641311A (en) * 2021-10-18 2021-11-12 浩鲸云计算科技股份有限公司 Method and system for dynamically allocating container storage resources based on local disk

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019015288A1 (en) * 2017-07-20 2019-01-24 中兴通讯股份有限公司 Method, device and system for persistent data processing, and readable storage medium
US20210103395A1 (en) * 2019-10-04 2021-04-08 Zettaset, Inc. Dynamic Provisioning of Container Storage
CN111966305A (en) * 2020-10-22 2020-11-20 腾讯科技(深圳)有限公司 Persistent volume allocation method and device, computer equipment and storage medium
CN113641311A (en) * 2021-10-18 2021-11-12 浩鲸云计算科技股份有限公司 Method and system for dynamically allocating container storage resources based on local disk

Also Published As

Publication number Publication date
CN115017117B (en) 2022-11-11

Similar Documents

Publication Publication Date Title
WO2020253347A1 (en) Container cluster management method, device and system
US11010188B1 (en) Simulated data object storage using on-demand computation of data objects
CN113641311B (en) Method and system for dynamically allocating container storage resources based on local disk
US9971823B2 (en) Dynamic replica failure detection and healing
US8305911B2 (en) System and method for identifying and managing service disruptions using network and systems data
CN107087031B (en) Storage resource load balancing method and device
CN111290828A (en) Dynamic routing using container orchestration services
CN113687795A (en) Method and system for realizing isolation allocation of storage volumes of stateful application
US11922059B2 (en) Method and device for distributed data storage
US20220329651A1 (en) Apparatus for container orchestration in geographically distributed multi-cloud environment and method using the same
US8930518B2 (en) Processing of write requests in application server clusters
US20220318071A1 (en) Load balancing method and related device
CN113946276A (en) Disk management method and device in cluster and server
EP3672203A1 (en) Distribution method for distributed data computing, device, server and storage medium
CN115017117B (en) Local disk-based container file system online capacity expansion method and system
CN109286532B (en) Management method and device for alarm information in cloud computing system
CN110011850B (en) Management method and device for services in cloud computing system
US20230063541A1 (en) Determining computer resource usage at multiple levels of a container orchestration system hierarchy
CN115225645A (en) Service updating method, device, system and storage medium
TWI766387B (en) Reverse proxy method and storage device with delay sensing and load balancing
CN114995762A (en) Thick backup roll capacity expansion method, device, equipment and storage medium
US11768704B2 (en) Increase assignment effectiveness of kubernetes pods by reducing repetitive pod mis-scheduling
CN113032153B (en) Dynamic capacity expansion method, system and device for container service resources and storage medium
CN115495023B (en) Data request method, device, equipment and storage medium
CN117032905B (en) Method and system for associating container cluster with block storage and virtual machine

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