CN115291797A - Capacity expansion method, capacity expansion device, capacity expansion equipment and readable storage medium - Google Patents
Capacity expansion method, capacity expansion device, capacity expansion equipment and readable storage medium Download PDFInfo
- Publication number
- CN115291797A CN115291797A CN202210910114.4A CN202210910114A CN115291797A CN 115291797 A CN115291797 A CN 115291797A CN 202210910114 A CN202210910114 A CN 202210910114A CN 115291797 A CN115291797 A CN 115291797A
- Authority
- CN
- China
- Prior art keywords
- capacity
- expansion
- capacity expansion
- target volume
- expected
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/0653—Monitoring storage devices or systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/0662—Virtualisation aspects
- G06F3/0665—Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
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)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机技术领域,特别涉及一种扩容方法、装置、设备及可读存储介质。The present application relates to the field of computer technology, in particular to a capacity expansion method, device, equipment and readable storage medium.
背景技术Background technique
随着集群的使用和运行,需要阶段性对集群进行手动扩容。但由于集群运行对存储容量的使用需求是不可预测的,因此手动扩容不仅效率慢,还无法掌握每次扩容的容量大小和时机,可能出现:因扩容不及时使得数据存储故障等异常问题。With the use and operation of the cluster, it is necessary to manually expand the capacity of the cluster in stages. However, since the demand for storage capacity used by cluster operation is unpredictable, manual expansion is not only inefficient, but also unable to grasp the size and timing of each expansion, which may cause abnormal problems such as data storage failure due to untimely expansion.
因此,如何针对集群进行精细化扩容,是本领域技术人员需要解决的问题。Therefore, how to finely expand the capacity of the cluster is a problem to be solved by those skilled in the art.
发明内容Contents of the invention
有鉴于此,本申请的目的在于提供一种扩容方法、装置、设备及可读存储介质,以针对集群进行精细化扩容。其具体方案如下:In view of this, the purpose of the present application is to provide a capacity expansion method, device, device and readable storage medium, so as to perform refined capacity expansion for clusters. The specific plan is as follows:
第一方面,本申请提供了一种扩容方法,包括:In the first aspect, the application provides a capacity expansion method, including:
获取目标集群中预设的扩容策略;Obtain the preset expansion strategy in the target cluster;
若所述扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且所述扩容策略在所述目标集群中对应的目标卷符合扩容要求时,解析所述扩容策略得到扩容触发条件和容量计算方式;If the capacity expansion policy is enabled, when the number of capacity expansions within the preset time period does not exceed the number threshold and the target volume corresponding to the capacity expansion policy in the target cluster meets the capacity expansion requirements, analyze the capacity expansion policy to obtain the capacity expansion trigger condition and capacity calculation method;
若达到所述扩容触发条件,则按照所述容量计算方式确定本次扩容后所述目标卷的期望容量;If the expansion trigger condition is met, the expected capacity of the target volume after this expansion is determined according to the capacity calculation method;
若所述期望容量大于本次扩容前所述目标卷的总容量且所述期望容量小于所述目标卷的容量限制值,则基于所述期望容量对所述目标卷进行扩容。If the expected capacity is greater than the total capacity of the target volume before the current expansion and the expected capacity is smaller than the capacity limit value of the target volume, the target volume is expanded based on the expected capacity.
可选地,还包括:Optionally, also include:
获取所述目标卷的卷使用信息;Acquiring volume usage information of the target volume;
相应地,所述扩容触发条件为:达到所述扩容触发条件设定的定时时间点且所述卷使用信息超过预设限制值、或所述卷使用信息超过预设限制值、或基于所述卷使用信息确定的所述目标卷的剩余耗尽时长低于耗尽时长阈值。Correspondingly, the expansion trigger condition is: the timing time point set by the expansion trigger condition is reached and the volume usage information exceeds a preset limit value, or the volume usage information exceeds a preset limit value, or based on the The remaining exhaustion duration of the target volume determined by the volume usage information is lower than the exhaustion duration threshold.
可选地,所述按照所述容量计算方式确定本次扩容后所述目标卷的期望容量,包括:Optionally, the determining the expected capacity of the target volume after this expansion according to the capacity calculation method includes:
将本次扩容前所述目标卷的总容量与预设固定值的和作为所述期望容量;The sum of the total capacity of the target volume and the preset fixed value before this expansion is taken as the expected capacity;
或or
计算本次扩容前所述目标卷的总容量与预设固定百分比的乘积,并将本次扩容前所述目标卷的总容量与所述乘积之和作为所述期望容量;Calculate the product of the total capacity of the target volume before this expansion and a preset fixed percentage, and use the sum of the total capacity of the target volume before this expansion and the product as the expected capacity;
或or
利用预测模型预测本次扩容容量,并将本次扩容前所述目标卷的总容量与所述本次扩容容量之和作为所述期望容量。A prediction model is used to predict the capacity of this expansion, and the sum of the total capacity of the target volume before this expansion and the capacity of this expansion is used as the expected capacity.
可选地,将所述目标卷在一段时间内的卷使用信息输入多个预测模型,得到多个预测结果;每个预测结果包括:所述目标卷的预测耗尽时长及预测扩容容量;Optionally, the volume usage information of the target volume within a period of time is input into multiple prediction models to obtain multiple prediction results; each prediction result includes: the predicted depletion time and predicted expansion capacity of the target volume;
在多个预测扩容容量中选择数值最大的一个作为本次扩容容量,并将所述本次扩容容量对应的预测结果中的所述预测耗尽时长作为所述剩余耗尽时长。Selecting the one with the largest numerical value among the plurality of predicted expansion capacities is used as the current expansion capacity, and the predicted exhaustion time in the prediction result corresponding to the current expansion capacity is used as the remaining exhaustion time.
可选地,还包括:Optionally, also include:
若所述扩容次数超过所述次数阈值,则生成相应的告警事件,并在所述目标卷符合所述扩容要求时,执行所述解析所述扩容策略得到扩容触发条件和容量计算方式的步骤。If the number of times of capacity expansion exceeds the number of times threshold, a corresponding alarm event is generated, and when the target volume meets the capacity expansion requirement, the step of analyzing the capacity expansion policy to obtain a capacity expansion trigger condition and a capacity calculation method is executed.
可选地,所述扩容要求为:卷存在且卷空间可申请。Optionally, the expansion requirement is: a volume exists and volume space can be applied for.
可选地,所述扩容触发条件为:达到所述扩容触发条件设定的定时时间点。Optionally, the trigger condition for capacity expansion is: reaching a timing time point set by the trigger condition for capacity expansion.
第二方面,本申请提供了一种扩容装置,包括:In a second aspect, the present application provides a capacity expansion device, including:
获取模块,用于获取目标集群中预设的扩容策略;The acquisition module is used to acquire the preset expansion strategy in the target cluster;
执行模块,用于若所述扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且所述扩容策略在所述目标集群中对应的目标卷符合扩容要求时,解析所述扩容策略得到扩容触发条件和容量计算方式;An execution module, configured to analyze the expansion if the capacity expansion policy is enabled, when the number of capacity expansions within a preset period of time does not exceed the number threshold and the target volume corresponding to the capacity expansion policy in the target cluster meets the capacity expansion requirements The strategy gets the expansion trigger condition and capacity calculation method;
计算模块,用于若达到所述扩容触发条件,则按照所述容量计算方式确定本次扩容后所述目标卷的期望容量;A calculation module, configured to determine the expected capacity of the target volume after this expansion according to the capacity calculation method if the expansion trigger condition is met;
扩容模块,用于若所述期望容量大于本次扩容前所述目标卷的总容量且所述期望容量小于所述目标卷的容量限制值,则基于所述期望容量对所述目标卷进行扩容。A capacity expansion module, configured to expand the target volume based on the expected capacity if the expected capacity is greater than the total capacity of the target volume before this expansion and the expected capacity is less than the capacity limit value of the target volume .
可选地,还包括:Optionally, also include:
卷使用信息获取模块,用于获取目标卷的卷使用信息;A volume usage information acquisition module, configured to acquire volume usage information of the target volume;
相应地,扩容触发条件为:达到扩容触发条件设定的定时时间点且卷使用信息超过预设限制值、或卷使用信息超过预设限制值、或基于卷使用信息确定的目标卷的剩余耗尽时长低于耗尽时长阈值。Correspondingly, the expansion trigger condition is: reaching the timing point set by the expansion trigger condition and the volume usage information exceeds the preset limit value, or the volume usage information exceeds the preset limit value, or the remaining consumption of the target volume determined based on the volume usage information The exhausted duration is below the exhausted duration threshold.
可选地,计算模块具体用于:Optionally, the calculation module is specifically used for:
将本次扩容前目标卷的总容量与预设固定值的和作为期望容量;The sum of the total capacity of the target volume before this expansion and the preset fixed value is taken as the expected capacity;
或or
计算本次扩容前目标卷的总容量与预设固定百分比的乘积,并将本次扩容前目标卷的总容量与乘积之和作为期望容量;Calculate the product of the total capacity of the target volume before this expansion and the preset fixed percentage, and use the sum of the total capacity of the target volume before this expansion and the product as the expected capacity;
或or
利用预测模型预测本次扩容容量,并将本次扩容前目标卷的总容量与本次扩容容量之和作为期望容量。The prediction model is used to predict the capacity of this expansion, and the sum of the total capacity of the target volume before this expansion and the capacity of this expansion is taken as the expected capacity.
可选地,还包括:Optionally, also include:
智能预测模块,用于将目标卷在一段时间内的卷使用信息输入多个预测模型,得到多个预测结果;每个预测结果包括:目标卷的预测耗尽时长及预测扩容容量;在多个预测扩容容量中选择数值最大的一个作为本次扩容容量,并将本次扩容容量对应的预测结果中的预测耗尽时长作为剩余耗尽时长。The intelligent prediction module is used to input the volume usage information of the target volume within a period of time into multiple forecasting models to obtain multiple forecasting results; each forecasting result includes: the predicted exhaustion time of the target volume and the predicted expansion capacity; Select the one with the largest numerical value in the predicted expansion capacity as the current expansion capacity, and use the predicted depletion time in the prediction results corresponding to the current expansion capacity as the remaining depletion time.
可选地,还包括:Optionally, also include:
告警模块,用于若扩容次数超过次数阈值,则生成相应的告警事件,并在目标卷符合扩容要求时,执行解析扩容策略得到扩容触发条件和容量计算方式的步骤。The alarm module is used to generate a corresponding alarm event if the number of expansion times exceeds the number threshold, and execute the steps of analyzing the expansion strategy to obtain the expansion trigger condition and the capacity calculation method when the target volume meets the expansion requirements.
第三方面,本申请提供了一种电子设备,包括:In a third aspect, the present application provides an electronic device, including:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序,以实现前述公开的扩容方法。A processor, configured to execute the computer program, so as to implement the capacity expansion method disclosed above.
第四方面,本申请提供了一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述公开的扩容方法。In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the capacity expansion method disclosed above is implemented.
通过以上方案可知,本申请提供了一种扩容方法,包括:获取目标集群中预设的扩容策略;若所述扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且所述扩容策略在所述目标集群中对应的目标卷符合扩容要求时,解析所述扩容策略得到扩容触发条件和容量计算方式;若达到所述扩容触发条件,则按照所述容量计算方式确定本次扩容后所述目标卷的期望容量;若所述期望容量大于本次扩容前所述目标卷的总容量且所述期望容量小于所述目标卷的容量限制值,则基于所述期望容量对所述目标卷进行扩容。From the above solutions, it can be seen that the present application provides a capacity expansion method, including: acquiring the preset capacity expansion policy in the target cluster; When the target volume corresponding to the expansion policy in the target cluster meets the expansion requirements, analyze the expansion policy to obtain the expansion trigger condition and capacity calculation method; if the expansion trigger condition is met, determine the expansion according to the capacity calculation method The expected capacity of the target volume later; if the expected capacity is greater than the total capacity of the target volume before this expansion and the expected capacity is less than the capacity limit value of the target volume, then based on the expected capacity, the The target volume is expanded.
可见,本申请为目标集群预设了扩容策略且可以设定该策略是否使能应用,在扩容策略使能应用时,对扩容次数和扩容策略在目标集群中对应的目标卷进行判断,在预设时长内的扩容次数未超过次数阈值且扩容策略在目标集群中对应的目标卷符合扩容要求时,解析扩容策略得到扩容触发条件和容量计算方式;若达到扩容触发条件,则按照容量计算方式确定本次扩容后目标卷的期望容量;若期望容量大于本次扩容前目标卷的总容量且期望容量小于目标卷的容量限制值,则基于期望容量对目标卷进行扩容。该方案通过扩容触发条件可以掌握扩容时机,通过容量计算方式可以掌握每次的扩容容量,因此可针对集群进行精细化扩容,保障了集群业务的高可用和数据存储的稳定性。It can be seen that this application presets an expansion policy for the target cluster and can set whether the policy is enabled for application. When the expansion policy is enabled for application, the number of expansion times and the target volume corresponding to the expansion policy in the target cluster are judged. When the number of expansion times within the set time does not exceed the threshold and the target volume corresponding to the expansion policy in the target cluster meets the expansion requirements, analyze the expansion policy to obtain the expansion trigger condition and capacity calculation method; if the expansion trigger condition is met, it is determined according to the capacity calculation method The expected capacity of the target volume after this expansion; if the expected capacity is greater than the total capacity of the target volume before this expansion and the expected capacity is less than the capacity limit value of the target volume, then the target volume will be expanded based on the expected capacity. This solution can grasp the expansion opportunity through the expansion trigger conditions, and can grasp the expansion capacity each time through the capacity calculation method, so it can perform refined expansion for the cluster, ensuring the high availability of the cluster business and the stability of data storage.
相应地,本申请提供的一种扩容装置、设备及可读存储介质,也同样具有上述技术效果。Correspondingly, a capacity expansion device, equipment, and readable storage medium provided by the present application also have the above-mentioned technical effects.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1为本申请公开的一种扩容方法流程图;Fig. 1 is a flow chart of a capacity expansion method disclosed in the present application;
图2为本申请公开的一种扩容逻辑示意图;FIG. 2 is a logical schematic diagram of expansion disclosed in the present application;
图3为本申请公开的一种策略应用示意图;FIG. 3 is a schematic diagram of a strategy application disclosed in the present application;
图4为本申请公开的另一种扩容方法流程图;FIG. 4 is a flow chart of another expansion method disclosed in the present application;
图5为本申请公开的一种扩容装置示意图;Fig. 5 is a schematic diagram of a capacity expansion device disclosed in the present application;
图6为本申请公开的一种电子设备示意图。FIG. 6 is a schematic diagram of an electronic device disclosed in the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
目前,随着集群的使用和运行,需要阶段性对集群进行手动扩容。但由于集群运行对存储容量的使用需求是不可预测的,因此手动扩容不仅效率慢,还无法掌握每次扩容的容量大小和时机,可能出现:因扩容不及时使得数据存储故障等异常问题。为此,本申请提供了一种扩容方案,能够掌握扩容时机和扩容容量,以针对集群进行精细化扩容。At present, with the use and operation of the cluster, it is necessary to manually expand the capacity of the cluster in stages. However, since the demand for storage capacity used by cluster operation is unpredictable, manual expansion is not only inefficient, but also unable to grasp the size and timing of each expansion, which may cause abnormal problems such as data storage failure due to untimely expansion. For this reason, the present application provides a capacity expansion solution, which can grasp the expansion opportunity and capacity, so as to perform refined capacity expansion for the cluster.
参见图1所示,本申请实施例公开了一种扩容方法,包括:Referring to Figure 1, the embodiment of the present application discloses a capacity expansion method, including:
S101、获取目标集群中预设的扩容策略。S101. Obtain a preset expansion policy in the target cluster.
其中,目标集群可以是基于Kubernetes的集群。Kubernetes简称K8s,是管理主机中容器的工具,具有高可用和弹性伸缩等优势。扩容策略可以预先设置在集群中,同时设定扩容策略的开关。扩容策略的开关打开时,扩容策略使能,可应用;扩容策略的开关关闭时,扩容策略去使能,不可应用。其中,扩容策略中包括:扩容触发条件、容量计算方式以及所针对的目标卷的ID等信息。也就是说,扩容策略是针对集群中的卷设定的,目标卷为1个或多个。本实施例提供的方法可以被集群中的每个主机执行,也即:本实施例提供的方法可以应用于集群中的每个主机。Wherein, the target cluster may be a cluster based on Kubernetes. Kubernetes, referred to as K8s for short, is a tool for managing containers in hosts, and has the advantages of high availability and elastic scaling. The expansion strategy can be preset in the cluster, and the switch of the expansion strategy can be set at the same time. When the switch of the expansion policy is on, the expansion policy is enabled and applicable; when the switch of the expansion policy is off, the expansion policy is disabled and cannot be applied. Wherein, the capacity expansion strategy includes information such as: capacity expansion trigger conditions, capacity calculation methods, and IDs of targeted target volumes. That is to say, the expansion policy is set for volumes in the cluster, and the target volume is one or more. The method provided in this embodiment can be executed by each host in the cluster, that is, the method provided in this embodiment can be applied to each host in the cluster.
S102、若扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且扩容策略在目标集群中对应的目标卷符合扩容要求时,解析扩容策略得到扩容触发条件和容量计算方式。S102. If the expansion policy is enabled, when the number of expansion times within the preset time period does not exceed the number threshold and the target volume corresponding to the expansion policy in the target cluster meets the expansion requirements, analyze the expansion policy to obtain an expansion trigger condition and a capacity calculation method.
本实施例为避免频繁扩容,在扩容策略可以使能应用时,并不立即进行应用,而是先判断预设时长内的扩容次数是否超过次数阈值,若预设时长内的扩容次数未超过次数阈值,则表明扩容动作不频繁;若预设时长内的扩容次数超过次数阈值,则表明扩容动作频繁,此时可以产生相应告警事件。因此在一种具体实施方式中,若扩容次数超过次数阈值,则生成相应的告警事件,并在目标卷符合扩容要求时,执行解析扩容策略得到扩容触发条件和容量计算方式的步骤,当然还继续执行后续其他步骤,以完成扩容流程。可见,扩容次数超过次数阈值的告警事件用于提醒运维人员关注扩容,并不终止扩容流程。In order to avoid frequent expansion in this embodiment, when the expansion policy can be applied, it is not applied immediately, but first judges whether the number of expansions within the preset duration exceeds the threshold value, if the number of expansions within the preset duration does not exceed the number of times threshold, it indicates that the capacity expansion is not frequent; if the number of expansions within the preset time exceeds the threshold, it indicates that the expansion is frequent, and corresponding alarm events can be generated at this time. Therefore, in a specific implementation, if the number of times of expansion exceeds the number threshold, a corresponding alarm event is generated, and when the target volume meets the expansion requirements, the step of analyzing the expansion strategy to obtain the expansion trigger condition and capacity calculation method is performed, and of course continues Follow the rest of the steps to complete the scaling process. It can be seen that the alarm event that the number of expansion times exceeds the threshold is used to remind the operation and maintenance personnel to pay attention to the expansion, and does not terminate the expansion process.
在一种具体实施方式中,扩容要求为:卷存在且卷空间可申请。也即:当目标卷处于正常使用状态且还有剩余的可申请空间时,认为目标卷符合扩容要求。一般地,集群中的一个卷可对应集群后端的一块磁盘。In a specific implementation manner, the capacity expansion requirement is: a volume exists and volume space can be applied for. That is: when the target volume is in normal use and there is still space available for application, it is considered that the target volume meets the expansion requirements. Generally, a volume in a cluster corresponds to a disk at the back end of the cluster.
S103、若达到扩容触发条件,则按照容量计算方式确定本次扩容后目标卷的期望容量。S103. If the capacity expansion trigger condition is met, determine the expected capacity of the target volume after the current capacity expansion according to the capacity calculation method.
具体的,扩容触发条件可以设定为:定时扩容、阈值扩容等。定时扩容如:每24小时扩容一次。阈值扩容如:当目标卷的剩余空间不足某一阈值时执行扩容动作。因此在一种具体实施方式中,扩容触发条件为:达到扩容触发条件设定的定时时间点。Specifically, the expansion trigger conditions can be set as: scheduled expansion, threshold expansion, etc. Scheduled expansion such as: once every 24 hours. Threshold expansion, such as: when the remaining space of the target volume is less than a certain threshold, the expansion action is performed. Therefore, in a specific implementation manner, the trigger condition for capacity expansion is: reaching the timing time point set by the trigger condition for capacity expansion.
在一种具体实施方式中,按照容量计算方式确定本次扩容后目标卷的期望容量,包括:固定值递增方式:将本次扩容前目标卷的总容量与预设固定值的和作为期望容量;或百分比递增方式:计算本次扩容前目标卷的总容量与预设固定百分比的乘积,并将本次扩容前目标卷的总容量与乘积之和作为期望容量;或智能递增方式:利用预测模型预测本次扩容容量,并将本次扩容前目标卷的总容量与本次扩容容量之和作为期望容量。可见,可以采用上述任一种容量计算方式来确定期望容量。In a specific implementation, the expected capacity of the target volume after the expansion is determined according to the capacity calculation method, including: a fixed value increment method: the sum of the total capacity of the target volume before the expansion and the preset fixed value is used as the expected capacity ; or percentage increment method: calculate the product of the total capacity of the target volume before the current expansion and the preset fixed percentage, and use the sum of the total capacity of the target volume before the current expansion and the product as the expected capacity; or intelligent incremental method: use the forecast The model predicts the capacity of this expansion, and takes the sum of the total capacity of the target volume before this expansion and the capacity of this expansion as the expected capacity. It can be seen that any of the above-mentioned capacity calculation methods can be used to determine the expected capacity.
S104、若期望容量大于本次扩容前目标卷的总容量且期望容量小于目标卷的容量限制值,则基于期望容量对目标卷进行扩容。S104. If the expected capacity is greater than the total capacity of the target volume before the expansion and the expected capacity is less than the capacity limit value of the target volume, expand the target volume based on the expected capacity.
本实施例为避免执行无效的扩容动作,在执行S104步骤中,对本次扩容后可达到的期望容量进行了判断,若期望容量大于本次扩容前目标卷的总容量,则表明本次扩容动作执行后能够扩大集群存储空间,那么本次扩容动作就是有效的。同时,本实施例为了保障集群的稳定运行,除了将期望容量与本次扩容前目标卷的总容量进行比较外,还比较了期望容量与目标卷的容量限制值的大小。若期望容量小于目标卷的容量限制值,则表明本次扩容动作执行完成后,不会导致存储异常情况,也就是:本次扩容动作执行完成后,不会因目标卷的可申请空间耗尽而出现故障。可见,本实施例既可以实现有效扩容,也可以保证扩容前后集群的稳定运行。In this embodiment, in order to avoid invalid expansion actions, in the execution of step S104, the expected capacity that can be achieved after this expansion is judged. If the expected capacity is greater than the total capacity of the target volume before this expansion, it indicates that this expansion If the cluster storage space can be expanded after the action is executed, the expansion action is valid. At the same time, in order to ensure the stable operation of the cluster, this embodiment not only compares the expected capacity with the total capacity of the target volume before the expansion, but also compares the expected capacity with the capacity limit value of the target volume. If the expected capacity is less than the capacity limit value of the target volume, it means that after the completion of the expansion operation, no storage exception will occur, that is, after the completion of the expansion operation, the application space of the target volume will not be exhausted and malfunction. It can be seen that this embodiment can not only achieve effective capacity expansion, but also ensure stable operation of the cluster before and after capacity expansion.
可见,本实施例为目标集群预设了扩容策略且可以设定该策略是否使能应用,在扩容策略使能应用时,对扩容次数和扩容策略在目标集群中对应的目标卷进行判断,在预设时长内的扩容次数未超过次数阈值且扩容策略在目标集群中对应的目标卷符合扩容要求时,解析扩容策略得到扩容触发条件和容量计算方式;若达到扩容触发条件,则按照容量计算方式确定本次扩容后目标卷的期望容量;若期望容量大于本次扩容前目标卷的总容量且期望容量小于目标卷的容量限制值,则基于期望容量对目标卷进行扩容。该方案通过扩容触发条件可以掌握扩容时机,通过容量计算方式可以掌握每次的扩容容量,因此可针对集群进行精细化扩容,保障了集群业务的高可用和数据存储的稳定性。It can be seen that this embodiment presets the expansion policy for the target cluster and can set whether the policy enables the application. When the expansion policy enables the application, the number of expansion times and the target volume corresponding to the expansion policy in the target cluster are judged. When the number of expansion times within the preset time period does not exceed the number threshold and the target volume corresponding to the expansion policy in the target cluster meets the expansion requirements, analyze the expansion policy to obtain the expansion trigger condition and capacity calculation method; if the expansion trigger condition is met, then follow the capacity calculation method Determine the expected capacity of the target volume after this expansion; if the expected capacity is greater than the total capacity of the target volume before this expansion and the expected capacity is less than the capacity limit value of the target volume, then expand the target volume based on the expected capacity. This solution can grasp the expansion opportunity through the expansion trigger conditions, and can grasp the expansion capacity each time through the capacity calculation method, so it can perform refined expansion for the cluster, ensuring the high availability of the cluster business and the stability of data storage.
基于上述实施例,需要说明的是,还可以基于卷的实际使用情况来确定扩容时机。因此在一种具体实施方式中,还包括:获取目标卷的卷使用信息;相应地,扩容触发条件为:达到扩容触发条件设定的定时时间点且卷使用信息超过预设限制值、或卷使用信息超过预设限制值、或基于卷使用信息确定的目标卷的剩余耗尽时长低于耗尽时长阈值。Based on the above-mentioned embodiments, it should be noted that the opportunity for capacity expansion may also be determined based on the actual usage of the volume. Therefore, in a specific implementation manner, it also includes: acquiring the volume usage information of the target volume; correspondingly, the trigger condition for capacity expansion is: reaching the timing time point set by the trigger condition for capacity expansion and the volume usage information exceeds the preset limit value, or the volume The usage information exceeds a preset limit value, or the remaining exhaustion duration of the target volume determined based on the volume usage information is lower than the exhaustion duration threshold.
相应地,当扩容触发条件为达到扩容触发条件设定的定时时间点且卷使用信息超过预设限制值时,容量计算方式可以选择百分比递增方式或固定值递增方式。当扩容触发条件为卷使用信息超过预设限制值时,容量计算方式可以选择:百分比递增方式或固定值递增方式。当扩容触发条件为目标卷的剩余耗尽时长低于耗尽时长阈值时,容量计算方式可以选择:智能递增方式。当扩容触发条件为达到扩容触发条件设定的定时时间点时,容量计算方式可以选择:百分比递增方式或固定值递增方式。当然,上述四个扩容触发条件和三个容量计算方式可以随意匹配使用。Correspondingly, when the trigger condition for capacity expansion is reaching the timing point set by the trigger condition for capacity expansion and the volume usage information exceeds the preset limit value, the capacity calculation method can be a percentage increment method or a fixed value increment method. When the trigger condition for capacity expansion is that the volume usage information exceeds the preset limit value, the capacity calculation method can be selected: percentage increment method or fixed value increment method. When the trigger condition for capacity expansion is that the remaining depletion time of the target volume is lower than the depletion time threshold, the capacity calculation method can be selected: intelligent incremental method. When the expansion trigger condition is reaching the timing time point set by the expansion trigger condition, the capacity calculation method can be selected: percentage increment method or fixed value increment method. Of course, the above four expansion trigger conditions and three capacity calculation methods can be matched and used at will.
在一种具体实施方式中,目标卷的剩余耗尽时长、利用预测模型得到的本次扩容容量可参照下述步骤进行确定。将目标卷在一段时间内的卷使用信息输入多个预测模型,得到多个预测结果;每个预测结果包括:目标卷的预测耗尽时长及预测扩容容量;在多个预测扩容容量中选择数值最大的一个作为本次扩容容量,并将本次扩容容量对应的预测结果中的预测耗尽时长作为剩余耗尽时长。其中,预测模型可以采用三次指数平滑算法、ARIMA算法、STL算法等训练获得。卷使用信息可以是卷使用率等。In a specific implementation manner, the remaining depletion time of the target volume and the current expansion capacity obtained by using the prediction model can be determined by referring to the following steps. Input the volume usage information of the target volume within a period of time into multiple prediction models to obtain multiple prediction results; each prediction result includes: the predicted depletion time of the target volume and the predicted expansion capacity; select the value among multiple predicted expansion capacities The largest one is used as the capacity of this expansion, and the predicted exhaustion time in the prediction result corresponding to the capacity of this expansion is used as the remaining exhaustion time. Among them, the prediction model can be obtained through training such as triple exponential smoothing algorithm, ARIMA algorithm, and STL algorithm. The volume usage information may be a volume usage rate or the like.
下述实施例能够对卷的容量进行密切监控,刻画卷容量变化曲线,对资源耗尽时间进行预判,结合用户设定的扩容时机、扩容容量、单卷容量上限等参数进行支持多种策略的弹性扩容。The following embodiments can closely monitor volume capacity, describe volume capacity change curves, predict resource exhaustion time, and support multiple strategies in combination with user-set expansion timing, expansion capacity, and upper limit of single volume capacity. elastic expansion.
请参见图2,集群中任一主机中部署有图2所示的实现逻辑。主机中包括众多容器,图2针对各容器所用的卷进行监控和扩容。Please refer to Figure 2, the implementation logic shown in Figure 2 is deployed on any host in the cluster. The host includes many containers, and Figure 2 monitors and expands the volumes used by each container.
如图2所示,Node-Exporter接口基于设定的指标收集主机上存储卷的指标信息,监控系统调用Node-Exporter接口获取相应指标信息,主要包括卷使用率以及卷历史曲线。监控系统使用prometheus组件即可实现数据监控。预测系统基于获取的指标信息预测卷耗尽时长和扩容量大小。适配器可适配多种监控系统,能够获取卷使用率、卷使用率历史曲线以及卷趋势预测信息。推荐器定时获取实时指标数据以及趋势预测数据。并且根据获取的监控数据更新期望容量。更新组件根据期望卷容量更新目标卷的容量。弹性扩容业务模型用于设定要扩容的卷、期望扩容容量、扩容策略等信息。当更新组件监听到更新的期望扩容容量,则触发扩容动作。其中,图2所示的控制器与预测系统采用unix domain socket协议进行通信,通信效率高,且易实现。As shown in Figure 2, the Node-Exporter interface collects the indicator information of the storage volume on the host based on the set indicators, and the monitoring system calls the Node-Exporter interface to obtain the corresponding indicator information, mainly including the volume usage rate and volume history curve. The monitoring system can realize data monitoring by using the prometheus component. The prediction system predicts the exhaustion time of the volume and the expansion size based on the obtained indicator information. The adapter can be adapted to a variety of monitoring systems, and can obtain volume usage, volume usage history curves, and volume trend forecast information. The recommender regularly obtains real-time indicator data and trend prediction data. And the expected capacity is updated according to the acquired monitoring data. The update component updates the capacity of the target volume according to the desired volume capacity. The elastic expansion business model is used to set information such as the volume to be expanded, the expected expansion capacity, and the expansion strategy. When the update component monitors the updated expected expansion capacity, it triggers the expansion action. Among them, the controller and forecasting system shown in Figure 2 communicate using the unix domain socket protocol, which has high communication efficiency and is easy to implement.
弹性扩容业务模型支持多种扩容触发策略(如:阈值触发、智能触发、定时触发)以及容量设定策略(固定容量、固定百分比、智能容量调整)。如图3所示,各扩容触发策略和各容量设定策略的匹配应用关系可参图3。当然,还可以根据业务实际需求,抽象出更多扩容触发策略以及容量设定策略。以阈值触发为例:当卷的使用率超过某一阈值时,弹性扩容业务模型基于固定容量方式进行扩容。再以智能触发为例:当预测系统输出的卷耗尽时长低于某一阈值时,弹性扩容业务模型基于预测系统同时输出的支撑N天业务所需的扩容量进行扩容。The elastic expansion business model supports multiple expansion trigger strategies (such as: threshold trigger, intelligent trigger, and timing trigger) and capacity setting strategies (fixed capacity, fixed percentage, and intelligent capacity adjustment). As shown in Figure 3, the matching application relationship between each capacity expansion trigger policy and each capacity setting policy can be referred to in Figure 3 . Of course, more expansion trigger strategies and capacity setting strategies can be abstracted based on actual business needs. Take threshold triggering as an example: when the volume usage exceeds a certain threshold, the elastic capacity expansion business model expands capacity based on a fixed capacity method. Take intelligent triggering as an example again: when the volume exhaustion time output by the prediction system is lower than a certain threshold, the elastic expansion business model expands based on the expansion capacity required to support N days of business output by the prediction system at the same time.
进一步地,还可以设定管理端,该管理端用于配置具体的获取指标、扩容触发策略、容量设定策略。Furthermore, a management terminal can also be set, and the management terminal is used to configure specific acquisition indicators, expansion trigger policies, and capacity setting policies.
其中,预测系统的输入数据为:卷历史使用率,输出结果为:卷剩余容量耗尽时长以及支撑N天业务所需的扩容量。其中,预测系统中的预测模型可采用三次指数平滑算法、ARIMA算法和/或STL算法等构建。当采用多种算法构建有多个预测模型时,选择评价最优的模型输出的结果。Among them, the input data of the prediction system is: volume historical usage rate, and the output result is: the time when the remaining capacity of the volume is exhausted and the expansion capacity required to support N days of business. Wherein, the forecasting model in the forecasting system may be constructed by using a cubic exponential smoothing algorithm, an ARIMA algorithm and/or an STL algorithm, and the like. When multiple prediction models are constructed by using multiple algorithms, the output result of the model with the best evaluation is selected.
具体的,扩容流程可以参照图4。如图4所示,当获取到弹性扩容业务模型中设定的扩容触发策略和容量设定策略后,判断弹性扩容业务模型是否可用;可用时判断其是否使能;不可用时流程结束,未使能时流程结束。若弹性扩容业务模型可用且使能,则判断扩容次数是否超过阈值,无论超过与否都执行下一个判断,但扩容次数超过阈值时增加告警。扩容次数未超过阈值时,判断想要扩容的目标卷是否存在、是否可以进行扩容,若都满足,则解析扩容触发策略和容量设定策略,以便能够触发扩容,并在触发扩容后计算扩容量。计算得到期望容量后,在期望容量小于目标卷实际总可用容量、小于卷最大上限容量、大于卷扩容前容量时,将期望容量更新到弹性扩容业务模型,以便更新组件监听到期望容量执行扩容动作。Specifically, the expansion process may refer to FIG. 4 . As shown in Figure 4, after obtaining the expansion trigger policy and capacity setting policy set in the elastic expansion business model, it is judged whether the elastic expansion business model is available; if it is available, it is judged whether it is enabled; The process ends when possible. If the elastic expansion business model is available and enabled, it is judged whether the number of expansions exceeds the threshold, and the next judgment is executed regardless of whether the number of expansions exceeds the threshold, but an alarm is added when the number of expansions exceeds the threshold. When the number of expansion times does not exceed the threshold, determine whether the target volume to be expanded exists and whether it can be expanded. If both are satisfied, analyze the expansion trigger policy and capacity setting policy so that the expansion can be triggered, and the expansion capacity is calculated after the expansion is triggered. . After the expected capacity is calculated, when the expected capacity is less than the actual total available capacity of the target volume, less than the maximum capacity of the volume, and greater than the capacity before volume expansion, update the expected capacity to the elastic expansion business model so that the update component can monitor the expected capacity and perform expansion actions .
可见,本实施例能够在卷容量不足时,根据配置策略自动完成扩容,保证了应用业务的高可用,解决了因卷容量不足导致的业务中断问题;还解决了因业务数据量无法准确预测而导致的扩容容量不明确问题;扩容不需要人工介入,降低了云平台维护成本,增强了容器存储的稳定性,提高了存储资源利用率,完善了异常处理机制。It can be seen that this embodiment can automatically complete expansion according to the configuration policy when the volume capacity is insufficient, ensuring high availability of application services and solving the problem of service interruption caused by insufficient volume capacity; The resulting expansion capacity is not clear; expansion does not require manual intervention, which reduces the maintenance cost of the cloud platform, enhances the stability of container storage, improves the utilization of storage resources, and improves the exception handling mechanism.
下面对本申请实施例提供的一种扩容装置进行介绍,下文描述的一种扩容装置与上文描述的一种扩容方法可以相互参照。A capacity expansion device provided in the embodiment of the present application is introduced below. The capacity expansion device described below and the capacity expansion method described above may refer to each other.
参见图5所示,本申请实施例公开了一种扩容装置,包括:Referring to Figure 5, the embodiment of the present application discloses a capacity expansion device, including:
获取模块501,用于获取目标集群中预设的扩容策略;An
执行模块502,用于若扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且扩容策略在目标集群中对应的目标卷符合扩容要求时,解析扩容策略得到扩容触发条件和容量计算方式;The
计算模块503,用于若达到扩容触发条件,则按照容量计算方式确定本次扩容后目标卷的期望容量;
扩容模块504,用于若期望容量大于本次扩容前目标卷的总容量且期望容量小于目标卷的容量限制值,则基于期望容量对目标卷进行扩容。The
在一种具体实施方式中,还包括:In a specific embodiment, it also includes:
卷使用信息获取模块,用于获取目标卷的卷使用信息;A volume usage information acquisition module, configured to acquire volume usage information of the target volume;
相应地,扩容触发条件为:达到扩容触发条件设定的定时时间点且卷使用信息超过预设限制值、或卷使用信息超过预设限制值、或基于卷使用信息确定的目标卷的剩余耗尽时长低于耗尽时长阈值。Correspondingly, the expansion trigger condition is: reaching the timing point set by the expansion trigger condition and the volume usage information exceeds the preset limit value, or the volume usage information exceeds the preset limit value, or the remaining consumption of the target volume determined based on the volume usage information The exhausted duration is below the exhausted duration threshold.
在一种具体实施方式中,计算模块具体用于:In a specific implementation manner, the calculation module is specifically used for:
将本次扩容前目标卷的总容量与预设固定值的和作为期望容量;The sum of the total capacity of the target volume before this expansion and the preset fixed value is taken as the expected capacity;
或or
计算本次扩容前目标卷的总容量与预设固定百分比的乘积,并将本次扩容前目标卷的总容量与乘积之和作为期望容量;Calculate the product of the total capacity of the target volume before this expansion and the preset fixed percentage, and use the sum of the total capacity of the target volume before this expansion and the product as the expected capacity;
或or
利用预测模型预测本次扩容容量,并将本次扩容前目标卷的总容量与本次扩容容量之和作为期望容量。The prediction model is used to predict the capacity of this expansion, and the sum of the total capacity of the target volume before this expansion and the capacity of this expansion is taken as the expected capacity.
在一种具体实施方式中,还包括:In a specific embodiment, it also includes:
智能预测模块,用于将目标卷在一段时间内的卷使用信息输入多个预测模型,得到多个预测结果;每个预测结果包括:目标卷的预测耗尽时长及预测扩容容量;在多个预测扩容容量中选择数值最大的一个作为本次扩容容量,并将本次扩容容量对应的预测结果中的预测耗尽时长作为剩余耗尽时长。The intelligent prediction module is used to input the volume usage information of the target volume within a period of time into multiple forecasting models to obtain multiple forecasting results; each forecasting result includes: the predicted exhaustion time of the target volume and the predicted expansion capacity; Select the one with the largest numerical value in the predicted expansion capacity as the current expansion capacity, and use the predicted depletion time in the prediction results corresponding to the current expansion capacity as the remaining depletion time.
在一种具体实施方式中,还包括:In a specific embodiment, it also includes:
告警模块,用于若扩容次数超过次数阈值,则生成相应的告警事件,并在目标卷符合扩容要求时,执行解析扩容策略得到扩容触发条件和容量计算方式的步骤。The alarm module is used to generate a corresponding alarm event if the number of expansion times exceeds the number threshold, and execute the steps of analyzing the expansion strategy to obtain the expansion trigger condition and the capacity calculation method when the target volume meets the expansion requirements.
在一种具体实施方式中,扩容要求为:卷存在且卷空间可申请。也即:当目标卷处于正常使用状态且还有剩余的可申请空间时,认为目标卷符合扩容要求。一般地,集群中的一个卷可对应集群后端的一块磁盘。In a specific implementation manner, the capacity expansion requirement is: a volume exists and volume space can be applied for. That is: when the target volume is in normal use and there is still space available for application, it is considered that the target volume meets the expansion requirements. Generally, a volume in a cluster corresponds to a disk at the back end of the cluster.
在一种具体实施方式中,扩容触发条件为:达到扩容触发条件设定的定时时间点。扩容触发条件可以设定为:定时扩容、阈值扩容等。定时扩容如:每24小时扩容一次。阈值扩容如:当目标卷的剩余空间不足某一阈值时执行扩容动作。因此在一种具体实施方式中,扩容触发条件为:达到扩容触发条件设定的定时时间点。In a specific implementation manner, the trigger condition for capacity expansion is: reaching a timing time point set by the trigger condition for capacity expansion. The expansion trigger conditions can be set as: scheduled expansion, threshold expansion, etc. Scheduled expansion such as: once every 24 hours. Threshold expansion, such as: when the remaining space of the target volume is less than a certain threshold, the expansion action is performed. Therefore, in a specific implementation manner, the trigger condition for capacity expansion is: reaching the timing time point set by the trigger condition for capacity expansion.
其中,关于本实施例中各个模块、单元更加具体的工作过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。For the more specific working process of each module and unit in this embodiment, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.
可见,本实施例提供了一种扩容装置,,能够掌握扩容时机和扩容容量,以针对集群进行精细化扩容。It can be seen that this embodiment provides a capacity expansion device capable of grasping the expansion opportunity and capacity, so as to perform refined capacity expansion for the cluster.
下面对本申请实施例提供的一种电子设备进行介绍,下文描述的一种电子设备与上文描述的一种扩容方法及装置可以相互参照。An electronic device provided by an embodiment of the present application is introduced below, and the electronic device described below and the capacity expansion method and device described above may refer to each other.
参见图6所示,本申请实施例公开了一种电子设备,包括:Referring to Figure 6, the embodiment of the present application discloses an electronic device, including:
存储器601,用于保存计算机程序;
处理器602,用于执行所述计算机程序,以实现上述任意实施例公开的方法。The
在本实施例中,处理器执行的计算机程序可以实现以下步骤:获取目标集群中预设的扩容策略;若扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且扩容策略在目标集群中对应的目标卷符合扩容要求时,解析扩容策略得到扩容触发条件和容量计算方式;若达到扩容触发条件,则按照容量计算方式确定本次扩容后目标卷的期望容量;若期望容量大于本次扩容前目标卷的总容量且期望容量小于目标卷的容量限制值,则基于期望容量对目标卷进行扩容。可选地,扩容要求为:卷存在且卷空间可申请。可选地,扩容触发条件为:达到扩容触发条件设定的定时时间点。In this embodiment, the computer program executed by the processor can implement the following steps: obtain the preset expansion strategy in the target cluster; When the corresponding target volume in the target cluster meets the expansion requirements, analyze the expansion strategy to obtain the expansion trigger condition and capacity calculation method; if the expansion trigger condition is met, determine the expected capacity of the target volume after this expansion according to the capacity calculation method; if the expected capacity is greater than If the total capacity of the target volume before this expansion and the expected capacity is less than the capacity limit value of the target volume, then the target volume is expanded based on the expected capacity. Optionally, the expansion requirement is: the volume exists and the volume space can be applied for. Optionally, the trigger condition for capacity expansion is: reaching a timing time point set by the trigger condition for capacity expansion.
在本实施例中,处理器执行的计算机程序可以实现以下步骤:获取目标卷的卷使用信息;相应地,扩容触发条件为:达到扩容触发条件设定的定时时间点且卷使用信息超过预设限制值、或卷使用信息超过预设限制值、或基于卷使用信息确定的目标卷的剩余耗尽时长低于耗尽时长阈值。In this embodiment, the computer program executed by the processor can implement the following steps: acquire the volume usage information of the target volume; The limit value, or the volume usage information exceeds a preset limit value, or the remaining exhaustion duration of the target volume determined based on the volume usage information is lower than the exhaustion duration threshold.
在本实施例中,处理器执行的计算机程序可以实现以下步骤:将本次扩容前目标卷的总容量与预设固定值的和作为期望容量;或计算本次扩容前目标卷的总容量与预设固定百分比的乘积,并将本次扩容前目标卷的总容量与乘积之和作为期望容量;或利用预测模型预测本次扩容容量,并将本次扩容前目标卷的总容量与本次扩容容量之和作为期望容量。In this embodiment, the computer program executed by the processor can implement the following steps: use the sum of the total capacity of the target volume before the current expansion and the preset fixed value as the expected capacity; or calculate the total capacity of the target volume before the current expansion and Preset the product of a fixed percentage, and use the sum of the total capacity of the target volume before this expansion and the product as the expected capacity; or use the forecasting model to predict the capacity of this expansion, and compare the total capacity of the target volume before this expansion with this The sum of the expansion capacity is used as the expected capacity.
在本实施例中,处理器执行的计算机程序可以实现以下步骤:将目标卷在一段时间内的卷使用信息输入多个预测模型,得到多个预测结果;每个预测结果包括:目标卷的预测耗尽时长及预测扩容容量;在多个预测扩容容量中选择数值最大的一个作为本次扩容容量,并将本次扩容容量对应的预测结果中的预测耗尽时长作为剩余耗尽时长。In this embodiment, the computer program executed by the processor can implement the following steps: input the volume usage information of the target volume within a period of time into multiple prediction models to obtain multiple prediction results; each prediction result includes: the prediction of the target volume Depletion time and predicted expansion capacity; select the one with the largest value among multiple predicted expansion capacities as the current expansion capacity, and use the predicted depletion time in the prediction results corresponding to this expansion capacity as the remaining depletion time.
在本实施例中,处理器执行的计算机程序可以实现以下步骤:若扩容次数超过次数阈值,则生成相应的告警事件,并在目标卷符合扩容要求时,执行解析扩容策略得到扩容触发条件和容量计算方式的步骤。In this embodiment, the computer program executed by the processor can implement the following steps: if the number of times of capacity expansion exceeds the threshold value, a corresponding alarm event is generated, and when the target volume meets the capacity expansion requirements, the parsing expansion policy is executed to obtain the capacity expansion trigger condition and capacity Steps in how to calculate.
进一步的,本申请实施例还提供了一种服务器来作为上述电子设备。该服务器,具体可以包括:至少一个处理器、至少一个存储器、电源、通信接口、输入输出接口和通信总线。其中,存储器用于存储计算机程序,计算机程序由处理器加载并执行,以实现前述任一实施例公开的扩容方法中的相关步骤。Further, the embodiment of the present application also provides a server as the above-mentioned electronic device. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input and output interface, and a communication bus. Wherein, the memory is used to store a computer program, and the computer program is loaded and executed by the processor, so as to implement relevant steps in the capacity expansion method disclosed in any of the foregoing embodiments.
本实施例中,电源用于为服务器上的各硬件设备提供工作电压;通信接口能够为服务器创建与外界设备之间的数据传输通道,其所遵循的通信协议是能够适用于本申请技术方案的任意通信协议,在此不对其进行具体限定;输入输出接口,用于获取外界输入数据或向外界输出数据,其具体的接口类型可以根据具体应用需要进行选取,在此不进行具体限定。In this embodiment, the power supply is used to provide working voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows is applicable to the technical solution of this application Any communication protocol is not specifically limited here; the input/output interface is used to obtain external input data or output data to the external, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
另外,存储器作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源包括操作系统、计算机程序及数据等,存储方式可以是短暂存储或者永久存储。In addition, memory, as a resource storage carrier, can be read-only memory, random access memory, magnetic disk or optical disk, etc. The resources stored on it include operating system, computer program and data, etc., and the storage method can be temporary storage or permanent storage.
其中,操作系统用于管理与控制服务器上的各硬件设备以及计算机程序,以实现处理器对存储器中数据的运算与处理,其可以是Windows Server、Netware、Unix、Linux等。计算机程序除了包括能够用于完成前述任一实施例公开的扩容方法的计算机程序之外,还可以进一步包括能够用于完成其他特定工作的计算机程序。数据除了可以包括虚拟机等数据外,还可以包括虚拟机的开发商信息等数据。Wherein, the operating system is used to manage and control various hardware devices and computer programs on the server, so as to realize the calculation and processing of the data in the memory by the processor, which may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the capacity expansion method disclosed in any of the foregoing embodiments, the computer program can further include a computer program that can be used to complete other specific tasks. In addition to data such as the virtual machine, the data may also include data such as developer information of the virtual machine.
进一步的,本申请实施例还提供了一种终端来作为上述电子设备。该终端具体可以包括但不限于智能手机、平板电脑、笔记本电脑或台式电脑等。Further, the embodiment of the present application also provides a terminal as the above-mentioned electronic device. The terminal specifically may include, but is not limited to, a smart phone, a tablet computer, a notebook computer or a desktop computer, and the like.
通常,本实施例中的终端包括有:处理器和存储器。Generally, the terminal in this embodiment includes: a processor and a memory.
其中,处理器可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器还可以包括AI(ArtificialIntelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。Wherein, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor can be realized by at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) . The processor can also include a main processor and a coprocessor, the main processor is a processor for processing data in the wake-up state, also called a CPU (Central Processing Unit, central processing unit); Low-power processor for processing data in standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor may further include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is configured to process computing operations related to machine learning.
存储器可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。本实施例中,存储器至少用于存储以下计算机程序,其中,该计算机程序被处理器加载并执行之后,能够实现前述任一实施例公开的由终端侧执行的扩容方法中的相关步骤。另外,存储器所存储的资源还可以包括操作系统和数据等,存储方式可以是短暂存储或者永久存储。其中,操作系统可以包括Windows、Unix、Linux等。数据可以包括但不限于应用程序的更新信息。The memory may include one or more computer-readable storage media, which may be non-transitory. Memory may also include high-speed random access memory, and non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor, it can implement the relevant steps in the capacity expansion method performed by the terminal side disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Wherein, the operating system may include Windows, Unix, Linux, and the like. Data may include, but is not limited to, update information for applications.
在一些实施例中,终端还可包括有显示屏、输入输出接口、通信接口、传感器、电源以及通信总线。In some embodiments, the terminal may further include a display screen, an input/output interface, a communication interface, a sensor, a power supply, and a communication bus.
下面对本申请实施例提供的一种可读存储介质进行介绍,下文描述的一种可读存储介质与上文描述的一种扩容方法、装置及设备可以相互参照。A readable storage medium provided by an embodiment of the present application is introduced below, and a readable storage medium described below and a capacity expansion method, device, and device described above may refer to each other.
一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述实施例公开的扩容方法。A readable storage medium is used to store a computer program, wherein when the computer program is executed by a processor, the capacity expansion method disclosed in the foregoing embodiments is implemented.
在本实施例中,可读存储介质保存的计算机程序可以实现以下步骤:获取目标集群中预设的扩容策略;若扩容策略使能,则在预设时长内的扩容次数未超过次数阈值且扩容策略在目标集群中对应的目标卷符合扩容要求时,解析扩容策略得到扩容触发条件和容量计算方式;若达到扩容触发条件,则按照容量计算方式确定本次扩容后目标卷的期望容量;若期望容量大于本次扩容前目标卷的总容量且期望容量小于目标卷的容量限制值,则基于期望容量对目标卷进行扩容。可选地,扩容要求为:卷存在且卷空间可申请。可选地,扩容触发条件为:达到扩容触发条件设定的定时时间点。In this embodiment, the computer program stored in the readable storage medium can implement the following steps: obtain the preset expansion strategy in the target cluster; if the expansion strategy is enabled, the number of times of expansion within the preset duration does not exceed the number threshold When the target volume corresponding to the policy in the target cluster meets the expansion requirements, analyze the expansion policy to obtain the expansion trigger condition and capacity calculation method; if the expansion trigger condition is met, determine the expected capacity of the target volume after this expansion according to the capacity calculation method; If the capacity is greater than the total capacity of the target volume before this expansion and the expected capacity is less than the capacity limit value of the target volume, then the target volume is expanded based on the expected capacity. Optionally, the expansion requirement is: the volume exists and the volume space can be applied for. Optionally, the trigger condition for capacity expansion is: reaching a timing time point set by the trigger condition for capacity expansion.
在本实施例中,可读存储介质保存的计算机程序可以实现以下步骤:获取目标卷的卷使用信息;相应地,扩容触发条件为:达到扩容触发条件设定的定时时间点且卷使用信息超过预设限制值、或卷使用信息超过预设限制值、或基于卷使用信息确定的目标卷的剩余耗尽时长低于耗尽时长阈值。In this embodiment, the computer program stored in the readable storage medium can implement the following steps: obtain the volume usage information of the target volume; The preset limit value, or the volume usage information exceeds the preset limit value, or the remaining exhaustion duration of the target volume determined based on the volume usage information is lower than the exhaustion duration threshold.
在本实施例中,可读存储介质保存的计算机程序可以实现以下步骤:将本次扩容前目标卷的总容量与预设固定值的和作为期望容量;或计算本次扩容前目标卷的总容量与预设固定百分比的乘积,并将本次扩容前目标卷的总容量与乘积之和作为期望容量;或利用预测模型预测本次扩容容量,并将本次扩容前目标卷的总容量与本次扩容容量之和作为期望容量。In this embodiment, the computer program stored in the readable storage medium can implement the following steps: use the sum of the total capacity of the target volume before this expansion and the preset fixed value as the expected capacity; or calculate the total capacity of the target volume before this expansion. The product of the capacity and the preset fixed percentage, and the sum of the total capacity of the target volume before the expansion and the product is the expected capacity; or use the forecasting model to predict the capacity of the expansion, and the total capacity of the target volume before the expansion The sum of the expansion capacity is taken as the expected capacity.
在本实施例中,可读存储介质保存的计算机程序可以实现以下步骤:将目标卷在一段时间内的卷使用信息输入多个预测模型,得到多个预测结果;每个预测结果包括:目标卷的预测耗尽时长及预测扩容容量;在多个预测扩容容量中选择数值最大的一个作为本次扩容容量,并将本次扩容容量对应的预测结果中的预测耗尽时长作为剩余耗尽时长。In this embodiment, the computer program stored in the readable storage medium can implement the following steps: input the volume usage information of the target volume within a period of time into multiple prediction models to obtain multiple prediction results; each prediction result includes: the target volume The predicted depletion time and predicted expansion capacity; among the multiple predicted expansion capacities, select the one with the largest value as the current expansion capacity, and use the predicted depletion time in the prediction results corresponding to this expansion capacity as the remaining depletion time.
在本实施例中,可读存储介质保存的计算机程序可以实现以下步骤:若扩容次数超过次数阈值,则生成相应的告警事件,并在目标卷符合扩容要求时,执行解析扩容策略得到扩容触发条件和容量计算方式的步骤。In this embodiment, the computer program stored in the readable storage medium can implement the following steps: if the number of times of expansion exceeds the number threshold, a corresponding alarm event is generated, and when the target volume meets the expansion requirements, the analysis of the expansion strategy is executed to obtain the expansion trigger condition and the steps of the capacity calculation method.
本申请涉及的“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法或设备固有的其它步骤或单元。"First", "second", "third", "fourth" and the like referred to in the present application, if any, are used to distinguish similar objects and not necessarily to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, e.g. a process, method or apparatus comprising a series of steps or elements is not necessarily limited to those steps or elements explicitly listed , but may include other steps or elements not explicitly listed or inherent to the process, method or apparatus.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions in this application involving "first", "second" and so on are for descriptive purposes only, and should not be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features . Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present application.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的可读存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known readable storage medium.
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。In this paper, specific examples are used to illustrate the principles and implementation methods of the application. The descriptions of the above embodiments are only used to help understand the method and core idea of the application; meanwhile, for those of ordinary skill in the art, according to the application There will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be construed as limiting the application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210910114.4A CN115291797A (en) | 2022-07-29 | 2022-07-29 | Capacity expansion method, capacity expansion device, capacity expansion equipment and readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210910114.4A CN115291797A (en) | 2022-07-29 | 2022-07-29 | Capacity expansion method, capacity expansion device, capacity expansion equipment and readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115291797A true CN115291797A (en) | 2022-11-04 |
Family
ID=83826995
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210910114.4A Pending CN115291797A (en) | 2022-07-29 | 2022-07-29 | Capacity expansion method, capacity expansion device, capacity expansion equipment and readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115291797A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120378310A (en) * | 2025-06-24 | 2025-07-25 | 北京九章云极科技有限公司 | Manual capacity expansion and auditing method and device for computing power of intelligent computing center cloud platform |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103365781A (en) * | 2012-03-29 | 2013-10-23 | 国际商业机器公司 | Method and device for dynamically reconfiguring storage system |
| CN111414228A (en) * | 2020-02-26 | 2020-07-14 | 华为技术有限公司 | Method and related device for managing storage space based on Kubernetes |
-
2022
- 2022-07-29 CN CN202210910114.4A patent/CN115291797A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103365781A (en) * | 2012-03-29 | 2013-10-23 | 国际商业机器公司 | Method and device for dynamically reconfiguring storage system |
| CN111414228A (en) * | 2020-02-26 | 2020-07-14 | 华为技术有限公司 | Method and related device for managing storage space based on Kubernetes |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120378310A (en) * | 2025-06-24 | 2025-07-25 | 北京九章云极科技有限公司 | Manual capacity expansion and auditing method and device for computing power of intelligent computing center cloud platform |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11182213B2 (en) | Application program management method and device | |
| CN110196770B (en) | Cloud system memory data processing method, device, equipment and storage medium | |
| CN109815007A (en) | Thread control method, device, electronic device and storage medium based on cloud monitoring | |
| EP3935503B1 (en) | Capacity management in a cloud computing system using virtual machine series modeling | |
| CN107562512A (en) | A method, device and system for migrating a virtual machine | |
| CN109840142A (en) | Thread control method, device, electronic equipment and storage medium based on cloud monitoring | |
| US9306814B1 (en) | Providing instance availability information | |
| US20210149726A1 (en) | Scheduling device, scheduling system, scheduling method, and non-transitory computer-readable medium | |
| CN109840141B (en) | Thread control method and device based on cloud monitoring, electronic equipment and storage medium | |
| CN113127187B (en) | Method and device for cluster expansion and contraction | |
| CN115291797A (en) | Capacity expansion method, capacity expansion device, capacity expansion equipment and readable storage medium | |
| CN114003367B (en) | Risk monitoring method, device, equipment and storage medium | |
| CN114968110A (en) | Storage volume capacity expansion method, device and medium | |
| CN115390992A (en) | Virtual machine creating method, device, equipment and storage medium | |
| CN118540171B (en) | Control method and system for providing power for powered equipment and POE equipment | |
| CN118227270B (en) | Method, device, equipment and medium for adjusting memory of virtual machine | |
| CN108228414B (en) | Linux-based processor process parameter monitoring method and monitoring system | |
| CN118796372A (en) | Microservice resource scheduling method and device, electronic device and storage medium | |
| CN114490432B (en) | Memory processing method, device, electronic device and computer readable storage medium | |
| CN115599523A (en) | Task processing method and device, electronic equipment and storage medium | |
| CN114153592A (en) | Physical host load scheduling method and device of cloud platform, electronic equipment and medium | |
| CN114897503B (en) | Business processing method, device, equipment and storage medium | |
| CN113835733B (en) | Cloud application updating method and device, electronic equipment and storage medium | |
| CN111400151B (en) | Method, device and equipment for monitoring residual life of hard disk | |
| CN119621356B (en) | Memory allocation method, equipment, medium and product for model in heterogeneous system |
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 |