CN111858042B - Method and device for verifying micro-service governance quota opening based on domestic cloud platform - Google Patents
Method and device for verifying micro-service governance quota opening based on domestic cloud platform Download PDFInfo
- Publication number
- CN111858042B CN111858042B CN202010665024.4A CN202010665024A CN111858042B CN 111858042 B CN111858042 B CN 111858042B CN 202010665024 A CN202010665024 A CN 202010665024A CN 111858042 B CN111858042 B CN 111858042B
- Authority
- CN
- China
- Prior art keywords
- application
- governance
- microservice
- resources
- amount
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 18
- 238000012795 verification Methods 0.000 claims abstract description 17
- 238000012217 deletion Methods 0.000 claims description 11
- 230000037430 deletion Effects 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本发明属于微服务治理技术领域,具体涉及一种基于国产化云平台校验微服务治理配额开启的方法及装置。The invention belongs to the technical field of microservice governance, and in particular relates to a method and device for verifying opening of microservice governance quotas based on a localized cloud platform.
背景技术Background technique
Pod,节点上运行的进程,存在一定的生命周期。Pod, a process running on a node, has a certain life cycle.
istio-proxy,istio代理,Istio是由Google、IBM和Lyft开源的微服务管理、保护和监控框架。istio-proxy, istio proxy, Istio is a microservice management, protection and monitoring framework open sourced by Google, IBM and Lyft.
国产化云平台中有虚拟数据中心,在某一虚拟数据中心的应用开启微服务治理后,该应用的工作负载会重启,并且会在工作负载的每一个Pod中增加一个 istio-proxy的容器,因此,在对某一应用开启服务治理后,该应用所需的资源将大大增加,如果当前虚拟数据中心的可用资源无法满足该应用开启微服务治理,在用户不知情的情况下执行开启微服务治理操作,将会造成应用下的工作负载重启失败,从而导致整个应用不能使用。There is a virtual data center in the domestic cloud platform. After microservice governance is enabled for an application in a virtual data center, the workload of the application will be restarted, and an istio-proxy container will be added to each Pod of the workload. Therefore, after enabling service governance for an application, the resources required by the application will greatly increase. If the available resources of the current virtual data center cannot meet the requirements of enabling microservice governance for the application, the microservice will be enabled without the user's knowledge. Governance operations will cause the workload under the application to fail to restart, making the entire application unusable.
此为现有技术的不足,因此,针对现有技术中的上述缺陷,提供一种基于国产化云平台校验微服务治理配额开启的方法及装置,是非常有必要的。This is the deficiency of the existing technology. Therefore, in view of the above-mentioned defects in the prior art, it is very necessary to provide a method and device for verifying the opening of microservice governance quotas based on a localized cloud platform.
发明内容Contents of the invention
针对现有技术的上述在用户不知情的情况下执行开启微服务治理操作,将会造成应用下的工作负载重启失败,从而导致整个应用不能使用的缺陷,本发明提供一种基于国产化云平台校验微服务治理配额开启的方法及装置,以解决上述技术问题。Aiming at the defect in the prior art that if the microservice management operation is performed without the user's knowledge, the workload under the application will fail to restart, resulting in the failure of the entire application to be used. The present invention provides a cloud platform based on localization. The method and device for verifying the opening of microservice management quotas are used to solve the above technical problems.
第一方面,本发明提供一种基于国产化云平台校验微服务治理配额开启的方法,包括如下步骤:In the first aspect, the present invention provides a method for verifying the opening of microservice governance quotas based on a localized cloud platform, including the following steps:
S1.当应用需要开启为微服务治理时,统计当前环境中开启微服务治理所需的资源配额;S1. When the application needs to be enabled as microservice governance, count the resource quota required to enable microservice governance in the current environment;
S2.校验应用所在虚拟数据中心可用的资源量是否满足开启微服务治理所需资源配额;S2. Check whether the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance;
S3.当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,删除当前虚拟数据中心的低优先级可删除资源,直至应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额,在应用开启微服务治理。S3. When the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance, delete the low-priority resources that can be deleted in the current virtual data center until the amount of available resources in the virtual data center where the application is located meets the requirements for enabling microservice governance. The resource quota required for service governance, enable microservice governance in the application.
进一步地,步骤S1具体步骤如下:Further, the specific steps of step S1 are as follows:
S11.当应用需要开启微服务治理时,依次遍历当前应用的所有工作负载,统计工作负载的实例数N;S11. When the application needs to enable microservice governance, traverse all the workloads of the current application in turn, and count the number of workload instances N;
S12.通过查询配置文件获取当前环境的istio-proxy单个容器所占用的资源量M;S12. Obtain the amount of resources M occupied by a single container of istio-proxy in the current environment by querying the configuration file;
S13.计算当前环境中开启微服务治理所需的资源配额S=工作负载的实例数N*istio-proxy单个容器所占用的资源量M。开启该应用微服务治理所需的资源配额是应用下工作负载的实例数与istio-proxy容器占用资源量的乘积。S13. Calculate the resource quota required for enabling microservice governance in the current environment S=the number of workload instances N*the resource amount M occupied by a single container of istio-proxy. The resource quota required to enable the application microservice governance is the product of the number of workload instances under the application and the amount of resources occupied by the istio-proxy container.
进一步地,步骤S11中,当某个工作负载带有弹性伸缩资源时,则以弹性伸缩资源的最大实例数作为该工作负载的实例数。弹性伸缩资源的最大实例数为可用实例数,因此要取最大实例数。Further, in step S11, when a workload has auto-scaling resources, the maximum number of instances of the auto-scaling resource is used as the number of instances of the workload. The maximum number of instances of an auto scaling resource is the number of available instances, so the maximum number of instances should be used.
进一步地,步骤S12中,通过查询配置文件获取当前环境的istio-proxy 单个容器所占用的CPU和内存资源量;Further, in step S12, obtain the CPU and the amount of memory resources occupied by the istio-proxy single container of the current environment by querying the configuration file;
步骤S13中,当前环境中开启微服务治理所需的资源配额S包括所需CPU 使用总量S1和所需内存使用总量S2;In step S13, the resource quota S required to enable microservice governance in the current environment includes the required total CPU usage S1 and the required total memory usage S2;
所需CPU使用总量S1=工作负载的实例数N*istio-proxy单个容器所占用的 CPU使用量M1;Total required CPU usage S1 = number of workload instances N*istio-proxy CPU usage M1 occupied by a single container;
所需内存使用总量S2=工作负载的实例数N*istio-proxy单个容器所占用的 CPU使用量M2。启微服务治理所需的资源配额通常包括所需CPU使用总量和所需内存使用总量,但不限于此。Total required memory usage S2 = number of workload instances N*istio-proxy CPU usage M2 occupied by a single container. The resource quota required for Qiwei service governance usually includes the total required CPU usage and the total required memory usage, but is not limited thereto.
进一步地,步骤S2具体步骤如下:Further, the specific steps of step S2 are as follows:
S21.统计应用所在虚拟数据中心的所有工作负载,统计工作负载数据库总的使用量,计算出数据库中可用资源量,并校验数据库中可用资源量是否满足开启微服务治理所需资源;S21. Count all the workloads of the virtual data center where the application is located, count the total usage of the workload database, calculate the amount of available resources in the database, and check whether the amount of available resources in the database meets the resources required to start microservice governance;
若是,进入步骤S22;If so, go to step S22;
若否,进入步骤S3;If not, go to step S3;
S22.统计应用所在虚拟数据中心的所有工作负载底层所占用资源量,计算出工作负载底层可用资源量,并校验工作负载底层可用资源量是否满足开启微服务治理,进入步骤S3。配额校验从两方面去校验配额是否足够,一方面,统计该虚拟数据中心下的所有工作负载,统计工作负载数据库总的使用量;另一方面,为了避免数据库中的资源数据不准确,遍历该虚拟数据中心下的所有工作负载底层所占用的资源量。如果所需配额在数据库和底层资源中都能满足,那么允许应用开启微服务治理。S22. Count the amount of resources occupied by the bottom layer of all workloads in the virtual data center where the application is located, calculate the amount of available resources at the bottom layer of the workload, and check whether the amount of available resources at the bottom layer of the workload meets the requirements for enabling microservice governance, and enter step S3. Quota verification checks whether the quota is sufficient from two aspects. On the one hand, it counts all the workloads under the virtual data center and the total usage of the workload database; on the other hand, in order to avoid inaccurate resource data in the database, Traverse the amount of resources occupied by all workloads under the virtual data center. Allows the application to enable microservices governance if the required quotas are satisfied both in the database and in the underlying resources.
进一步地,步骤S3具体步骤如下:Further, the specific steps of step S3 are as follows:
S31.当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,进入步骤S32;S31. When the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance, enter step S32;
当应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额时,进入步骤S33;When the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance, enter step S33;
S32.检测应用所在虚拟数据中心是否存在可删除的低优先级应用;S32. Detect whether there is a deletable low-priority application in the virtual data center where the application is located;
若是,删除低优先级的应用,返回步骤S21;If yes, delete the low-priority application and return to step S21;
若否,提示用户资源不足,无法开启微服务治理,结束;If not, prompt the user that the resources are insufficient, and the microservice management cannot be enabled, and end;
S33.为应用开启微服务治理。删除低优先级应用可在虚拟数据中心可用资源量不足时,实现配合调度,满足开启微服务治理的开启需求。S33. Enable microservice governance for the application. Deleting low-priority applications can realize cooperative scheduling when the available resources of the virtual data center are insufficient, and meet the requirements for enabling microservice governance.
第二方面,本发明提供一种基于国产化云平台校验微服务治理配额开启的装置,包括:In the second aspect, the present invention provides a device for verifying the opening of microservice governance quotas based on a localized cloud platform, including:
所需资源配额统计模块,用于当应用需要开启为微服务治理时,统计当前环境中开启微服务治理所需的资源配额;The required resource quota statistics module is used to count the resource quota required to enable microservice governance in the current environment when the application needs to be enabled for microservice governance;
资源校验模块,用于校验应用所在虚拟数据中心可用的资源量是否满足开启微服务治理所需资源配额;The resource verification module is used to verify whether the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance;
资源删除模块,用于当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,删除当前虚拟数据中心的低优先级可删除资源,直至应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额,在应用开启微服务治理。The resource deletion module is used to delete the low-priority deletable resources of the current virtual data center until the available resources of the virtual data center where the application is located when the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance The amount meets the resource quota required to enable microservice governance, and enable microservice governance in the application.
进一步地,所需资源配额统计模块包括:Further, the required resource quota statistics module includes:
工作负载实例统计单元,用于当应用需要开启微服务治理时,依次遍历当前应用的所有工作负载,统计工作负载的实例数N;The workload instance statistics unit is used to sequentially traverse all the workloads of the current application when the application needs to enable microservice governance, and count the number of workload instances N;
单容器资源占用查询单元,用于通过查询配置文件获取当前环境的istio-proxy单个容器所占用的资源量M;The resource occupation query unit of a single container is used to obtain the amount of resources M occupied by a single container of istio-proxy in the current environment by querying the configuration file;
所需资源配额计算单元,用于计算当前环境中开启微服务治理所需的资源配额S=工作负载的实例数N*istio-proxy单个容器所占用的资源量M。The required resource quota calculation unit is used to calculate the resource quota required for enabling microservice governance in the current environment S=the number of workload instances N*the resource amount M occupied by a single container of istio-proxy.
进一步地,资源校验模块包括:Further, the resource verification module includes:
数据库资源校验单元,用于统计应用所在虚拟数据中心的所有工作负载,统计工作负载数据库总的使用量,计算出数据库中可用资源量,并校验数据库中可用资源量是否满足开启微服务治理所需资源;The database resource verification unit is used to count all workloads in the virtual data center where the application is located, count the total usage of the workload database, calculate the amount of available resources in the database, and verify whether the amount of available resources in the database meets the requirements for enabling microservice governance required resources;
底层资源校验单元,用于统计应用所在虚拟数据中心的所有工作负载底层所占用资源量,计算出工作负载底层可用资源量,并校验工作负载底层可用资源量是否满足开启微服务治理。The underlying resource verification unit is used to count the amount of resources occupied by all workloads in the virtual data center where the application is located, calculate the amount of available resources at the bottom of the workload, and verify whether the amount of available resources at the bottom of the workload meets the requirements for enabling microservice governance.
进一步地,资源删除模块包括:Further, the resource deletion module includes:
可删除应用判断单元,用于当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,检测应用所在虚拟数据中心是否存在可删除的低优先级应用;The deletable application judgment unit is used to detect whether there is a deletable low-priority application in the virtual data center where the application is located when the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance;
微服务治理开启单元,用于当应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额时,为应用开启微服务治理;The microservice governance enabling unit is used to enable microservice governance for the application when the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance;
低优先级应用删除单元,用于当应用所在虚拟数据中心存在可删除的低优先级应用时,删除低优先级应用;The low-priority application deletion unit is used to delete the low-priority application when there is a deletable low-priority application in the virtual data center where the application is located;
用户提示单元,用于当应用所在虚拟数据中心不存在可删除的低优先级应用时,提示用户资源不足,无法开启微服务治理。The user prompt unit is used to prompt the user that resources are insufficient and microservice management cannot be started when there is no deletable low-priority application in the virtual data center where the application is located.
本发明的有益效果在于,The beneficial effect of the present invention is that,
本发明提供的基于国产化云平台校验微服务治理配额开启的方法及装置,实现国产化云平台中的应用在开启微服务治理时,配额是否满足开启微服务治理的条件的提前校验,避免因为配额不足导致工作负载重启失败,提升国产化云平台的容错性。The method and device for verifying the opening of micro-service governance quotas based on the localized cloud platform provided by the present invention can realize the early verification of whether the quota meets the conditions for opening the micro-service governance when the application in the localized cloud platform starts the micro-service governance, Avoid workload restart failures due to insufficient quotas, and improve the fault tolerance of the localized cloud platform.
此外,本发明设计原理可靠,结构简单,具有非常广泛的应用前景。In addition, the design principle of the present invention is reliable, the structure is simple, and has very wide application prospects.
由此可见,本发明与现有技术相比,具有突出的实质性特点和显著的进步,其实施的有益效果也是显而易见的。It can be seen that, compared with the prior art, the present invention has outstanding substantive features and remarkable progress, and the beneficial effects of its implementation are also obvious.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention 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, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings on the premise of not paying creative work.
图1是本发明的方法流程示意图一;Fig. 1 is a schematic flow diagram of the method of the present invention;
图2是本发明的方法流程示意图二;Fig. 2 is the second schematic flow diagram of the method of the present invention;
图3为本发明的系统示意图;Fig. 3 is a schematic diagram of the system of the present invention;
图中,1-所需资源配额统计模块;1.1-工作负载实例统计单元;1.2-单容器资源占用查询单元;1.3-所需资源配额计算单元;2-资源校验模块;2.1-数据库资源校验单元;2.2-底层资源校验单元;3-资源删除模块;3.1-可删除应用判断单元;3.2-微服务治理开启单元;3.3-低优先级应用删除单元;3.4-用户提示单元。In the figure, 1- required resource quota statistics module; 1.1- workload instance statistics unit; 1.2- single container resource occupation query unit; 1.3- required resource quota calculation unit; 2- resource verification module; 2.1- database resource calibration 2.2-bottom resource verification unit; 3-resource deletion module; 3.1-deletable application judgment unit; 3.2-microservice governance opening unit; 3.3-low priority application deletion unit; 3.4-user prompt unit.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described The embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
实施例1:Example 1:
如图1所示,本发明提供一种基于国产化云平台校验微服务治理配额开启的方法,包括如下步骤:As shown in Figure 1, the present invention provides a method for verifying the opening of microservice governance quotas based on a localized cloud platform, including the following steps:
S1.当应用需要开启为微服务治理时,统计当前环境中开启微服务治理所需的资源配额;S1. When the application needs to be enabled as microservice governance, count the resource quota required to enable microservice governance in the current environment;
S2.校验应用所在虚拟数据中心可用的资源量是否满足开启微服务治理所需资源配额;S2. Check whether the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance;
S3.当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,删除当前虚拟数据中心的低优先级可删除资源,直至应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额,在应用开启微服务治理。S3. When the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance, delete the low-priority resources that can be deleted in the current virtual data center until the amount of available resources in the virtual data center where the application is located meets the requirements for enabling microservice governance. The resource quota required for service governance, enable microservice governance in the application.
实施例2:Example 2:
如图2所示,本发明提供一种基于国产化云平台校验微服务治理配额开启的方法,包括如下步骤:As shown in Figure 2, the present invention provides a method for verifying the opening of microservice governance quotas based on a localized cloud platform, including the following steps:
S1.当应用需要开启为微服务治理时,统计当前环境中开启微服务治理所需的资源配额;具体步骤如下:S1. When the application needs to be enabled as microservice governance, count the resource quota required to enable microservice governance in the current environment; the specific steps are as follows:
S11.当应用需要开启微服务治理时,依次遍历当前应用的所有工作负载,统计工作负载的实例数N;S11. When the application needs to enable microservice governance, traverse all the workloads of the current application in turn, and count the number of workload instances N;
S12.通过查询配置文件获取当前环境的istio-proxy单个容器所占用的资源量M;S12. Obtain the amount of resources M occupied by a single container of istio-proxy in the current environment by querying the configuration file;
S13.计算当前环境中开启微服务治理所需的资源配额S=工作负载的实例数N*istio-proxy单个容器所占用的资源量M;S13. Calculate the resource quota required for enabling microservice governance in the current environment S=number of workload instances N*istio-proxy resources occupied by a single container M;
S2.校验应用所在虚拟数据中心可用的资源量是否满足开启微服务治理所需资源配额;具体步骤如下:S2. Verify that the amount of resources available in the virtual data center where the application is located meets the resource quota required for enabling microservice governance; the specific steps are as follows:
S21.统计应用所在虚拟数据中心的所有工作负载,统计工作负载数据库总的使用量,计算出数据库中可用资源量,并校验数据库中可用资源量是否满足开启微服务治理所需资源;S21. Count all the workloads of the virtual data center where the application is located, count the total usage of the workload database, calculate the amount of available resources in the database, and check whether the amount of available resources in the database meets the resources required to start microservice governance;
若是,进入步骤S22;If so, go to step S22;
若否,进入步骤S3;If not, go to step S3;
S22.统计应用所在虚拟数据中心的所有工作负载底层所占用资源量,计算出工作负载底层可用资源量,并校验工作负载底层可用资源量是否满足开启微服务治理,进入步骤S3;S22. Count the amount of resources occupied by the bottom layer of all workloads in the virtual data center where the application is located, calculate the amount of available resources at the bottom layer of the workload, and check whether the amount of available resources at the bottom layer of the workload meets the requirements for enabling micro-service management, and enter step S3;
S3.当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,删除当前虚拟数据中心的低优先级可删除资源,直至应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额,在应用开启微服务治理;具体步骤如下:S3. When the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance, delete the low-priority resources that can be deleted in the current virtual data center until the amount of available resources in the virtual data center where the application is located meets the requirements for enabling microservice governance. For the resource quota required for service governance, enable microservice governance in the application; the specific steps are as follows:
S31.当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,进入步骤S32;S31. When the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance, enter step S32;
当应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额时,进入步骤S33;When the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance, enter step S33;
S32.检测应用所在虚拟数据中心是否存在可删除的低优先级应用;S32. Detect whether there is a deletable low-priority application in the virtual data center where the application is located;
若是,删除低优先级的应用,返回步骤S21;If yes, delete the low-priority application and return to step S21;
若否,提示用户资源不足,无法开启微服务治理,结束;If not, prompt the user that the resources are insufficient, and the microservice management cannot be enabled, and end;
S33.为应用开启微服务治理。S33. Enable microservice governance for the application.
在上述实施例2中,步骤S11中,当某个工作负载带有弹性伸缩资源时,则以弹性伸缩资源的最大实例数作为该工作负载的实例数。In the above-mentioned embodiment 2, in step S11, when a workload has auto-scaling resources, the maximum number of instances of the auto-scaling resource is used as the number of instances of the workload.
在上述实施例2中,步骤S12中,通过查询配置文件获取当前环境的 istio-proxy单个容器所占用的CPU和内存资源量;In the above-mentioned embodiment 2, in step S12, obtain the CPU and the amount of memory resources occupied by the istio-proxy single container of the current environment by querying the configuration file;
步骤S13中,当前环境中开启微服务治理所需的资源配额S包括所需CPU 使用总量S1和所需内存使用总量S2;In step S13, the resource quota S required to enable microservice governance in the current environment includes the required total CPU usage S1 and the required total memory usage S2;
所需CPU使用总量S1=工作负载的实例数N*istio-proxy单个容器所占用的 CPU使用量M1;Total required CPU usage S1 = number of workload instances N*istio-proxy CPU usage M1 occupied by a single container;
所需内存使用总量S2=工作负载的实例数N*istio-proxy单个容器所占用的CPU使用量M2。The total amount of required memory usage S2 = the number of workload instances N* the CPU usage M2 occupied by a single container of istio-proxy.
实施例3:Example 3:
如图3所示,本发明提供一种基于国产化云平台校验微服务治理配额开启的装置,包括:As shown in Figure 3, the present invention provides a device for verifying the opening of microservice governance quotas based on a localized cloud platform, including:
所需资源配额统计模块1,用于当应用需要开启为微服务治理时,统计当前环境中开启微服务治理所需的资源配额;所需资源配额统计模块1包括:The required resource quota statistics module 1 is used to count the resource quotas required to enable microservice governance in the current environment when the application needs to be started as microservice governance; the required resource quota statistics module 1 includes:
工作负载实例统计单元1.1,用于当应用需要开启微服务治理时,依次遍历当前应用的所有工作负载,统计工作负载的实例数N;The workload instance statistics unit 1.1 is used to traverse all the workloads of the current application in turn and count the number of workload instances N when the application needs to enable microservice governance;
单容器资源占用查询单元1.2,用于通过查询配置文件获取当前环境的istio-proxy单个容器所占用的资源量M;The single container resource occupation query unit 1.2 is used to obtain the amount of resources M occupied by a single container of istio-proxy in the current environment by querying the configuration file;
所需资源配额计算单元1.3,用于计算当前环境中开启微服务治理所需的资源配额S=工作负载的实例数N*istio-proxy单个容器所占用的资源量M;The required resource quota calculation unit 1.3 is used to calculate the resource quota required for enabling microservice governance in the current environment S=the number of instances of the workload N*istio-proxy resource amount M occupied by a single container;
资源校验模块2,用于校验应用所在虚拟数据中心可用的资源量是否满足开启微服务治理所需资源配额;资源校验模块2包括:The resource verification module 2 is used to verify whether the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance; the resource verification module 2 includes:
数据库资源校验单元2.1,用于统计应用所在虚拟数据中心的所有工作负载,统计工作负载数据库总的使用量,计算出数据库中可用资源量,并校验数据库中可用资源量是否满足开启微服务治理所需资源;The database resource verification unit 2.1 is used to count all workloads in the virtual data center where the application is located, count the total usage of the workload database, calculate the amount of available resources in the database, and verify whether the amount of available resources in the database meets the requirements for starting microservices resources needed for governance;
底层资源校验单元2.2,用于统计应用所在虚拟数据中心的所有工作负载底层所占用资源量,计算出工作负载底层可用资源量,并校验工作负载底层可用资源量是否满足开启微服务治理;The underlying resource verification unit 2.2 is used to count the amount of resources occupied by the bottom layer of all workloads in the virtual data center where the application is located, calculate the amount of available resources at the bottom layer of the workload, and verify whether the amount of available resources at the bottom layer of the workload meets the requirements for enabling microservice governance;
资源删除模块3,用于当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,删除当前虚拟数据中心的低优先级可删除资源,直至应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额,在应用开启微服务治理;资源删除模块3包括:The resource deletion module 3 is used to delete the low-priority deletable resources of the current virtual data center until the resources available in the virtual data center where the application is located do not meet the resource quota required for enabling microservice governance. The amount of resources meets the resource quota required for enabling microservice governance, and microservice governance is enabled in the application; resource deletion module 3 includes:
可删除应用判断单元3.1,用于当应用所在虚拟数据中心可用的资源量不满足开启微服务治理所需资源配额时,检测应用所在虚拟数据中心是否存在可删除的低优先级应用;The deletable application judging unit 3.1 is used to detect whether there is a deletable low-priority application in the virtual data center where the application is located when the amount of resources available in the virtual data center where the application is located does not meet the resource quota required for enabling microservice governance;
微服务治理开启单元3.2,用于当应用所在虚拟数据中心可用的资源量满足开启微服务治理所需资源配额时,为应用开启微服务治理;The microservice governance opening unit 3.2 is used to enable microservice governance for the application when the amount of resources available in the virtual data center where the application is located satisfies the resource quota required for enabling microservice governance;
低优先级应用删除单元3.3,用于当应用所在虚拟数据中心存在可删除的低优先级应用时,删除低优先级应用;The low-priority application deletion unit 3.3 is configured to delete the low-priority application when there is a deletable low-priority application in the virtual data center where the application is located;
用户提示单元3.4,用于当应用所在虚拟数据中心不存在可删除的低优先级应用时,提示用户资源不足,无法开启微服务治理。The user prompting unit 3.4 is used to prompt the user that the microservice management cannot be started due to insufficient resources when there is no deletable low-priority application in the virtual data center where the application is located.
尽管通过参考附图并结合优选实施例的方式对本发明进行了详细描述,但本发明并不限于此。在不脱离本发明的精神和实质的前提下,本领域普通技术人员可以对本发明的实施例进行各种等效的修改或替换,而这些修改或替换都应在本发明的涵盖范围内/任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。Although the present invention has been described in detail in conjunction with preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, those skilled in the art can make various equivalent modifications or replacements to the embodiments of the present invention, and these modifications or replacements should be within the scope of the present invention/any Those skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention, and all should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010665024.4A CN111858042B (en) | 2020-07-10 | 2020-07-10 | Method and device for verifying micro-service governance quota opening based on domestic cloud platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010665024.4A CN111858042B (en) | 2020-07-10 | 2020-07-10 | Method and device for verifying micro-service governance quota opening based on domestic cloud platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111858042A CN111858042A (en) | 2020-10-30 |
CN111858042B true CN111858042B (en) | 2023-01-10 |
Family
ID=72982964
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010665024.4A Active CN111858042B (en) | 2020-07-10 | 2020-07-10 | Method and device for verifying micro-service governance quota opening based on domestic cloud platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111858042B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109992310A (en) * | 2019-03-12 | 2019-07-09 | 中国平安财产保险股份有限公司 | Application program keepalive method, device, computer equipment and storage medium |
CN110247845A (en) * | 2019-06-26 | 2019-09-17 | 深圳市中航比特通讯技术有限公司 | Protection method for routing is generated in a kind of communication network |
CN110266544A (en) * | 2019-06-28 | 2019-09-20 | 苏州浪潮智能科技有限公司 | The device and method that a kind of the reason of cloud platform micro services serv-fail positions |
CN110515730A (en) * | 2019-08-22 | 2019-11-29 | 北京宝兰德软件股份有限公司 | Resource secondary dispatching method and device based on kubernetes container arranging system |
WO2020063206A1 (en) * | 2018-09-28 | 2020-04-02 | 南京中兴软件有限责任公司 | Flexible scaling method for microservice instances, device, and storage medium |
-
2020
- 2020-07-10 CN CN202010665024.4A patent/CN111858042B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020063206A1 (en) * | 2018-09-28 | 2020-04-02 | 南京中兴软件有限责任公司 | Flexible scaling method for microservice instances, device, and storage medium |
CN110971623A (en) * | 2018-09-28 | 2020-04-07 | 中兴通讯股份有限公司 | Microservice instance elastic scaling method, device and storage medium |
CN109992310A (en) * | 2019-03-12 | 2019-07-09 | 中国平安财产保险股份有限公司 | Application program keepalive method, device, computer equipment and storage medium |
CN110247845A (en) * | 2019-06-26 | 2019-09-17 | 深圳市中航比特通讯技术有限公司 | Protection method for routing is generated in a kind of communication network |
CN110266544A (en) * | 2019-06-28 | 2019-09-20 | 苏州浪潮智能科技有限公司 | The device and method that a kind of the reason of cloud platform micro services serv-fail positions |
CN110515730A (en) * | 2019-08-22 | 2019-11-29 | 北京宝兰德软件股份有限公司 | Resource secondary dispatching method and device based on kubernetes container arranging system |
Also Published As
Publication number | Publication date |
---|---|
CN111858042A (en) | 2020-10-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108600029B (en) | A configuration file updating method, device, terminal device and storage medium | |
CN110178121A (en) | A kind of detection method and its terminal of database | |
CN107741876A (en) | A virtual machine process monitoring system and method | |
CN101789002A (en) | Database compatibility test device and method for server | |
CN106656604A (en) | Microservice request management method, microservice controller and high-concurrence microservice architecture | |
CN114978883B (en) | Network wakeup management method and device, electronic equipment and storage medium | |
CN105577414A (en) | Method, device, and system for elastic scaling of virtual machine VM resources | |
CN108959045A (en) | A kind of test method and system of NAS clustering fault performance of handoffs | |
CN108833190A (en) | A kind of NFS service failure warning method, device and storage medium | |
CN107967195A (en) | A kind of fault repairing method and system based on dual control storage | |
CN107682460A (en) | A kind of distributed storage trunked data communication method and system | |
CN111858042B (en) | Method and device for verifying micro-service governance quota opening based on domestic cloud platform | |
CN115061013B (en) | Low-voltage common fault studying and judging method and system based on power failure event big data analysis | |
CN112015597A (en) | Fault isolation method, device, equipment and computer readable storage medium | |
CN117827365A (en) | Port allocation method, device, equipment, medium and product for application container | |
CN110209497A (en) | Method and system for dynamically expanding and shrinking host resources | |
CN111966461B (en) | Virtual machine cluster node guarding method, device, equipment and storage medium | |
CN112612635B (en) | Multi-level protection method for application program | |
CN111652652A (en) | Cost calculation method, device, computer equipment and storage medium of computing platform | |
CN106959885A (en) | A kind of virtual machine High Availabitity realizes system and its implementation | |
CN118034955A (en) | Event management method and device for converter, computer equipment and storage medium | |
CN110798347A (en) | Service state detection method, device, equipment and storage medium | |
CN116450175A (en) | State updating method, device and storage medium | |
CN108154343A (en) | The emergency processing method and system of a kind of enterprise information system | |
CN116775350A (en) | Database synchronous monitoring and repairing method, system and storage medium |
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 |