CN111274033B - Resource deployment method, device, server and storage medium - Google Patents

Resource deployment method, device, server and storage medium Download PDF

Info

Publication number
CN111274033B
CN111274033B CN202010060020.3A CN202010060020A CN111274033B CN 111274033 B CN111274033 B CN 111274033B CN 202010060020 A CN202010060020 A CN 202010060020A CN 111274033 B CN111274033 B CN 111274033B
Authority
CN
China
Prior art keywords
physical machine
resource pool
service
physical
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010060020.3A
Other languages
Chinese (zh)
Other versions
CN111274033A (en
Inventor
杨宁
罗建龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010060020.3A priority Critical patent/CN111274033B/en
Publication of CN111274033A publication Critical patent/CN111274033A/en
Application granted granted Critical
Publication of CN111274033B publication Critical patent/CN111274033B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application discloses a resource deployment method, a device, a server and a storage medium, relates to the technical field of networks, and solves the problem that a large amount of resources are wasted in the process of running service lines. The specific scheme is as follows: the first resource pool is deployed for the first service line, wherein the first resource pool comprises a plurality of physical machines configured with first tags, and the physical machines configured with the first tags are deployed to run services of the first service line. And monitoring the resource utilization rate of the first resource pool in the process of running the service of the first service line on the physical machine included in the first resource pool. And when the resource utilization rate of the first resource pool is smaller than a first threshold value, migrating the running service to the second physical machine. The first physical machine is a physical machine whose resource utilization rate in the first resource pool is smaller than a second threshold, the second physical machine is a physical machine capable of providing resources required to operate a service operated in the first physical machine, and the second physical machine is a physical machine in the first resource pool and is different from the first physical machine.

Description

一种资源部署方法、装置、服务器以及存储介质A resource deployment method, device, server and storage medium

技术领域Technical field

本公开涉及网络技术领域,尤其涉及一种资源部署方法、装置、服务器以及存储介质。The present disclosure relates to the field of network technology, and in particular, to a resource deployment method, device, server and storage medium.

背景技术Background technique

目前,由于自行搭建可提供如处理器、内存等资源的物理机集群,以支持业务线运行的灵活性较差,并且会带来较高的成本投入,因此,资源共享已经成为一种较为普遍的选择。另外,在资源共享时进行资源的隔离,也是当今互联网公司基础资源体系建设的必要需求。Currently, building a physical machine cluster that can provide resources such as processors and memory to support the operation of business lines is less flexible and will bring higher costs. Therefore, resource sharing has become a more common method. s Choice. In addition, resource isolation when sharing resources is also a necessary requirement for the construction of basic resource systems of today's Internet companies.

示例性的,当业务方需要在物理机集群上运行多种业务线时,可以向部署方购买或者租用物理机的使用权,用于业务线的运行。且,部署方可为不同的业务线搭建不同的物理机集群,以实现资源隔离,确保不同业务线的相对独立运行。例如,以业务方需要运行2个业务线(如业务线1和业务线2)为例。如图1所示,部署方可以根据业务线1和业务线2运行所需的资源,确定业务线1需要3个物理机,业务线2需要4个物理机,并从可用集群中选取3个物理机搭建集群1,用于业务线1的运行,选取4个物理机搭建集群2,用于业务线2的运行。在业务线运行时,可能会出现资源不足的情况,部署方可以从可用集群中调拨可用的物理机添加到对应的物理机集群中,以满足该业务线对资源的需求。For example, when a business party needs to run multiple business lines on a physical machine cluster, it can purchase or rent the right to use the physical machine from the deployer for the operation of the business lines. Moreover, the deployer can build different physical machine clusters for different business lines to achieve resource isolation and ensure the relatively independent operation of different business lines. For example, take the business side that needs to run two business lines (such as business line 1 and business line 2). As shown in Figure 1, the deployer can determine that business line 1 requires 3 physical machines and business line 2 requires 4 physical machines based on the resources required to run business line 1 and business line 2, and select 3 from the available clusters. Physical machines are used to build cluster 1 for the operation of business line 1. Four physical machines are selected to build cluster 2 for the operation of business line 2. When the business line is running, there may be insufficient resources. The deployer can allocate available physical machines from the available clusters and add them to the corresponding physical machine cluster to meet the resource requirements of the business line.

可以看到,为不同的业务线单独搭设物理机集群,能够实现对不同业务线对应资源的隔离。但是,由于隔离的物理机资源无法被其他业务线所使用的,因此,在业务线对搭建的物理机集群的资源利用率较低时,该物理机集群中的物理机也无法为其他业务线的运行提供资源,而是一直处于资源利用率较低的水平,这样就会造成物理机资源的大量浪费。It can be seen that setting up separate physical machine clusters for different business lines can isolate the corresponding resources of different business lines. However, because the isolated physical machine resources cannot be used by other business lines, when the resource utilization rate of the physical machine cluster built by the business line is low, the physical machines in the physical machine cluster cannot be used by other business lines. However, the resource utilization is always at a low level, which will cause a lot of waste of physical machine resources.

发明内容Contents of the invention

本公开提供一种资源部署方法,装置及系统,能够稳定便捷地调整为业务线提供资源的资源池的资源数量,以减少对资源的浪费。本公开的技术方案如下:The present disclosure provides a resource deployment method, device and system, which can stably and conveniently adjust the number of resources in a resource pool that provides resources for business lines, so as to reduce waste of resources. The technical solutions of the present disclosure are as follows:

本公开实施例的第一方面,提供一种资源部署方法,该方法可以包括:为第一业务线部署第一资源池,第一资源池中包括多个配置有第一标签的物理机,配置有第一标签的物理机被部署为运行第一业务线的服务。在第一资源池包括的物理机上运行第一业务线的服务的过程中,监测第一资源池的资源利用率。当第一资源池的资源利用率小于第一阈值时,将第一物理机中运行的服务迁移到第二物理机上。第一物理机是第一资源池中资源利用率小于第二阈值的物理机,第二物理机是能够提供运行第一物理机中运行的服务所需资源的物理机,第二物理机是第一资源池中的物理机,第二物理机与第一物理机不同。A first aspect of an embodiment of the present disclosure provides a resource deployment method. The method may include: deploying a first resource pool for a first business line. The first resource pool includes a plurality of physical machines configured with first tags, configuring The physical machine with the first label is deployed to run the service of the first line of business. During the process of running the service of the first business line on the physical machine included in the first resource pool, the resource utilization rate of the first resource pool is monitored. When the resource utilization of the first resource pool is less than the first threshold, the services running in the first physical machine are migrated to the second physical machine. The first physical machine is a physical machine whose resource utilization rate in the first resource pool is less than the second threshold. The second physical machine is a physical machine that can provide the resources required to run the service running in the first physical machine. The second physical machine is the third physical machine. Among the physical machines in a resource pool, the second physical machine is different from the first physical machine.

基于该方法,通过为业务线部署的物理机配置标签,以实现对不同业务线的资源的隔离,当需要压缩已部署给某个业务线的资源时,通过修改物理机的标签,即可快捷安全地将该物理机提供的资源从已部署的资源池中移除,以便减少对于资源的浪费。Based on this method, by configuring labels for the physical machines deployed in the business line, the resources of different business lines are isolated. When it is necessary to compress the resources that have been deployed to a certain business line, you can quickly and easily modify the labels of the physical machines. Safely remove the resources provided by the physical machine from the deployed resource pool to reduce waste of resources.

可选的,第一资源池外未被部署的物理机被配置有第二标签,在将第一物理机中运行的服务迁移到第二物理机上之后,该方法还包括:将第一物理机的第一标签修改为第二标签。基于该方法,可以将被移除的物理机划归到未被部署的物理机中,以便为其他业务部署资源池时可以使用该空闲的物理机,由此提高了物理机资源的利用率。Optionally, undeployed physical machines outside the first resource pool are configured with a second label. After migrating services running in the first physical machine to the second physical machine, the method further includes: migrating the first physical machine to the second physical machine. The first label is changed to the second label. Based on this method, the removed physical machine can be classified into undeployed physical machines, so that the idle physical machine can be used when deploying resource pools for other services, thus improving the utilization of physical machine resources.

可选的,该将该第一物理机的该第一标签修改为第二标签,包括:在开始将第一物理机中运行的服务迁移到第二物理机前,将第一物理机的第一标签修改为第三标签,被配置有第三标签的物理机是不运行任何服务的物理机。在完成将第一物理机中运行的服务迁移到第二物理机后,将第一物理机的第三标签修改为第二标签。基于该方法,将第一物理机的标签修改为第三标签,使得第一物理机不会再承担新的服务的运行任务,将第一物理机的标签再修改为第二标签,使得第一物理机被划归到未部署的物理机中,能够被部署给其他业务线。Optionally, modifying the first label of the first physical machine to a second label includes: before starting to migrate the services running in the first physical machine to the second physical machine, changing the first label of the first physical machine to the second physical machine. The first label is modified to the third label, and the physical machine configured with the third label is a physical machine that does not run any services. After the services running in the first physical machine are migrated to the second physical machine, the third label of the first physical machine is modified to the second label. Based on this method, the label of the first physical machine is modified to the third label, so that the first physical machine will no longer assume the running task of the new service, and the label of the first physical machine is modified to the second label, so that the first physical machine Physical machines are classified as undeployed physical machines and can be deployed to other business lines.

可选的,该将第一物理机中运行的服务迁移到第二物理机上,包括:在该第一物理机中运行的服务允许被迁移时,将该第一物理机中运行的服务迁移到该第二物理机上。基于该方法,确定第一物理机中的服务可以被迁移,并迁移上述服务,使得第一物理机中不再运行有任何服务,这样在将第一物理机移除第一资源池的过程中,就不会对第一业务线的运行造成任何影响。Optionally, migrating the service running on the first physical machine to the second physical machine includes: when the service running on the first physical machine is allowed to be migrated, migrating the service running on the first physical machine to the second physical machine. on the second physical machine. Based on this method, it is determined that the services in the first physical machine can be migrated, and the above-mentioned services are migrated so that no services are no longer running in the first physical machine. In this way, during the process of removing the first physical machine from the first resource pool , it will not have any impact on the operation of the first business line.

可选的,该为第一业务线部署第一资源池,包括:接收该第一业务线的资源需求。根据该资源需求,为多个物理机中的每个物理机配置该第一标签。该多个物理机所提供的资源满足该资源需求,被配置为该第一标签的多个物理机构成该第一资源池。基于该方法,通过为物理机配置标签,以便具有相同的标签的物理机的资源可以构成与业务线对应的资源池的方法,实现了在不单独搭建集群的前提下,对于不同业务线的资源的隔离。Optionally, deploying the first resource pool for the first business line includes: receiving resource requirements of the first business line. According to the resource requirement, the first label is configured for each physical machine in the plurality of physical machines. The resources provided by the multiple physical machines meet the resource requirements, and the multiple physical machines configured with the first label constitute the first resource pool. Based on this method, by configuring labels for physical machines so that the resources of physical machines with the same labels can form a resource pool corresponding to the business line, it is possible to manage the resources of different business lines without building a separate cluster. of isolation.

可选的,在该为第一业务线部署第一资源池之后,该方法还包括:将该第一资源池与该第一业务线所在服务树节点绑定,用于在需要运行该第一业务线的服务时,用户选定与该第一业务线对应的该第一资源池。基于该方法,将分配的资源池与业务线所在服务树节点绑定,使得该业务线的服务不会错误的运行在其他资源池中,保证了资源的隔离。Optionally, after deploying the first resource pool for the first business line, the method further includes: binding the first resource pool to the service tree node where the first business line is located, for use when it is necessary to run the first resource pool. When providing services to a business line, the user selects the first resource pool corresponding to the first business line. Based on this method, the allocated resource pool is bound to the service tree node where the business line is located, so that the service of the business line will not run incorrectly in other resource pools, ensuring resource isolation.

可选的,该方法还包括:接收该第一业务线的服务和用户选定该第一资源池的指令。响应于该指令,在该第一资源池包括的物理机上运行该第一业务线的服务。基于该方法,在为第一业务线部署第一资源池后,可以根据接收到的选定第一资源池的操作确定运行第一业务线的服务的物理机,以便在这些物理机上运行第一业务线的服务。Optionally, the method further includes: receiving the service of the first business line and the user's instruction to select the first resource pool. In response to the instruction, the service of the first business line is run on the physical machine included in the first resource pool. Based on this method, after deploying the first resource pool for the first business line, the physical machines running the services of the first business line can be determined according to the received operation of selecting the first resource pool, so that the first business line can be run on these physical machines. Line of business services.

本公开实施例的第二方面,提供一种资源部署装置,该资源部署装置包括:部署模块,被配置为为第一业务线部署第一资源池,该第一资源池中包括多个配置有第一标签的物理机,该配置有第一标签的物理机被部署为运行该第一业务线的服务。监测模块,被配置为在该第一资源池包括的物理机上运行该第一业务线的服务的过程中,监测该第一资源池的资源利用率。迁移模块,被配置为当该第一资源池的资源利用率小于第一阈值时,将第一物理机中运行的服务迁移到第二物理机上。该第一物理机是该第一资源池中资源利用率小于第二阈值的物理机,该第二物理机是能够提供运行该第一物理机中运行的服务所需资源的物理机,该第二物理机是该第一资源池中的物理机,该第二物理机与该第一物理机不同。A second aspect of the embodiment of the present disclosure provides a resource deployment device. The resource deployment device includes: a deployment module configured to deploy a first resource pool for a first business line. The first resource pool includes multiple configurations. The physical machine configured with the first label is deployed to run the service of the first business line. The monitoring module is configured to monitor the resource utilization of the first resource pool during the process of running the service of the first business line on the physical machine included in the first resource pool. The migration module is configured to migrate services running in the first physical machine to the second physical machine when the resource utilization of the first resource pool is less than a first threshold. The first physical machine is a physical machine whose resource utilization rate in the first resource pool is less than a second threshold, the second physical machine is a physical machine that can provide resources required to run services running in the first physical machine, and the third physical machine The second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine.

可选的,该第一资源池外未被部署的物理机被配置有第二标签,该装置还包括修改模块。该修改模块,被配置为在该将第一物理机中运行的服务迁移到第二物理机上之后,将该第一物理机的该第一标签修改为该第二标签。Optionally, physical machines that are not deployed outside the first resource pool are configured with a second label, and the device further includes a modification module. The modification module is configured to modify the first label of the first physical machine to the second label after migrating the service running in the first physical machine to the second physical machine.

可选的,该修改模块,被配置为在开始将该第一物理机中运行的服务迁移到第二物理机时,将该第一物理机的该第一标签修改为第三标签,该被配置有该第三标签的物理机是不运行任何服务的物理机。该修改模块,被配置为在完成将该第一物理机中运行的服务迁移到第二物理机后,将该第一物理机的该第三标签修改为该第二标签。Optionally, the modification module is configured to modify the first label of the first physical machine to a third label when migrating the service running in the first physical machine to the second physical machine. The physical machine configured with the third label is a physical machine that does not run any services. The modification module is configured to modify the third label of the first physical machine to the second label after completing the migration of services running in the first physical machine to the second physical machine.

可选的,该迁移模块,被配置为在该第一物理机中运行的服务允许被迁移时,将该第一物理机中运行的服务迁移到该第二物理机上。Optionally, the migration module is configured to migrate the services running in the first physical machine to the second physical machine when the services running in the first physical machine are allowed to be migrated.

可选的,该部署模块,被配置为接收该第一业务线的资源需求。该部署模块,被配置为根据该资源需求,为多个物理机中的每个物理机配置该第一标签。该多个物理机所提供的资源满足该资源需求,被配置为该第一标签的多个物理机构成该第一资源池。Optionally, the deployment module is configured to receive resource requirements of the first business line. The deployment module is configured to configure the first label for each physical machine in the plurality of physical machines according to the resource requirement. The resources provided by the multiple physical machines meet the resource requirements, and the multiple physical machines configured with the first label constitute the first resource pool.

可选的,该部署模块,被配置为将该第一资源池与该第一业务线所在服务树节点绑定,用于在需要运行该第一业务线的服务时,用户选定与该第一业务线对应的该第一资源池。Optionally, the deployment module is configured to bind the first resource pool to the service tree node where the first business line is located, so that when the service of the first business line needs to be run, the user selects the first resource pool and the service tree node where the first business line is located. The first resource pool corresponding to a business line.

可选的,该资源部署装置还包括:接收模块和运行模块。该接收模块,被配置为接收该第一业务线的服务和用户选定该第一资源池的指令。该运行模块,被配置为响应于该指令,在该第一资源池包括的物理机上运行该第一业务线的服务。Optionally, the resource deployment device also includes: a receiving module and an operating module. The receiving module is configured to receive the service of the first business line and the instruction of the user to select the first resource pool. The running module is configured to, in response to the instruction, run the service of the first business line on the physical machine included in the first resource pool.

本公开实施例的第三方面,提供一种服务器,该服务器包括:处理器。用于存储处理器可执行指令的存储器。其中,该处理器被配置为:为第一业务线部署第一资源池,该第一资源池中包括多个配置有第一标签的物理机,该配置有第一标签的物理机被部署为运行该第一业务线的服务。在该第一资源池包括的物理机上运行该第一业务线的服务的过程中,监测该第一资源池的资源利用率。当该第一资源池的资源利用率小于第一阈值时,将第一物理机中运行的服务迁移到第二物理机上。该第一物理机是该第一资源池中资源利用率小于第二阈值的物理机,该第二物理机是能够提供运行该第一物理机中运行的服务所需资源的物理机,该第二物理机是该第一资源池中的物理机,该第二物理机与该第一物理机不同。A third aspect of the embodiment of the present disclosure provides a server, the server including: a processor. Memory used to store instructions executable by the processor. Wherein, the processor is configured to: deploy a first resource pool for the first business line, the first resource pool includes a plurality of physical machines configured with the first label, and the physical machine configured with the first label is deployed as Run the services of this first line of business. During the process of running the service of the first business line on the physical machines included in the first resource pool, the resource utilization rate of the first resource pool is monitored. When the resource utilization of the first resource pool is less than the first threshold, the service running in the first physical machine is migrated to the second physical machine. The first physical machine is a physical machine whose resource utilization rate in the first resource pool is less than a second threshold, the second physical machine is a physical machine that can provide resources required to run services running in the first physical machine, and the third physical machine The second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine.

本公开实施例的第四方面,提供一种计算机可读存储介质,该计算机可读存储介质上存储有指令,其特征在于,该指令被处理器执行时实现:为第一业务线部署第一资源池,该第一资源池中包括多个配置有第一标签的物理机,该配置有第一标签的物理机被部署为运行该第一业务线的服务。在该第一资源池包括的物理机上运行该第一业务线的服务的过程中,监测该第一资源池的资源利用率。当该第一资源池的资源利用率小于第一阈值时,将第一物理机中运行的服务迁移到第二物理机上。该第一物理机是该第一资源池中资源利用率小于第二阈值的物理机,该第二物理机是能够提供运行该第一物理机中运行的服务所需资源的物理机,该第二物理机是该第一资源池中的物理机,该第二物理机与该第一物理机不同。A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium. The computer-readable storage medium stores instructions. The characteristic is that when the instructions are executed by a processor, the following steps are implemented: deploying the first line of business for the first line of business. The first resource pool includes a plurality of physical machines configured with the first label, and the physical machines configured with the first label are deployed to run services of the first business line. During the process of running the service of the first business line on the physical machines included in the first resource pool, the resource utilization rate of the first resource pool is monitored. When the resource utilization of the first resource pool is less than the first threshold, the service running in the first physical machine is migrated to the second physical machine. The first physical machine is a physical machine whose resource utilization rate in the first resource pool is less than a second threshold, the second physical machine is a physical machine that can provide resources required to run services running in the first physical machine, and the third physical machine The second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine.

可以理解地,上述提供的第二方面的资源部署装置、第三方面的服务器以及第四方面的计算机可读存储介质均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。It can be understood that the resource deployment device of the second aspect, the server of the third aspect, and the computer-readable storage medium of the fourth aspect provided above are all used to execute the corresponding methods provided above. Therefore, what they can achieve For beneficial effects, please refer to the beneficial effects in the corresponding methods provided above and will not be described again here.

附图说明Description of the drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The drawings herein are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the disclosure, and together with the description are used to explain the principles of the disclosure, and do not constitute undue limitations on the disclosure.

图1为一种为不同业务线搭建不同物理机集群的方法示意图;Figure 1 is a schematic diagram of a method for building different physical machine clusters for different business lines;

图2为一种不同物理机集群中资源利用情况的示意图;Figure 2 is a schematic diagram of resource utilization in a different physical machine cluster;

图3为本公开实施例提供的一种实施环境的示意图;Figure 3 is a schematic diagram of an implementation environment provided by an embodiment of the present disclosure;

图4为本公开实施例提供的一种服务器的组成示意图;Figure 4 is a schematic diagram of the composition of a server provided by an embodiment of the present disclosure;

图5为本公开实施例提供的一种资源部署方法的逻辑示意图;Figure 5 is a logical schematic diagram of a resource deployment method provided by an embodiment of the present disclosure;

图6为本公开实施例提供的一种资源部署方法中部署过程的执行示意图;Figure 6 is a schematic diagram of the execution of a deployment process in a resource deployment method provided by an embodiment of the present disclosure;

图7为本公开实施例提供的一种为多个业务线部署资源的示意图;Figure 7 is a schematic diagram of deploying resources for multiple business lines according to an embodiment of the present disclosure;

图8为本公开实施例提供的一种资源池与服务树节点绑定的示意图;Figure 8 is a schematic diagram of binding a resource pool and a service tree node provided by an embodiment of the present disclosure;

图9为本公开实施例提供的一种资源部署方法中管理过程的执行示意图;Figure 9 is a schematic diagram of the execution of a management process in a resource deployment method provided by an embodiment of the present disclosure;

图10为本公开实施例提供的一种资源部署装置的组成示意图;Figure 10 is a schematic diagram of the composition of a resource deployment device provided by an embodiment of the present disclosure;

图11为本公开实施例提供的又一种资源部署装置的组成示意图;Figure 11 is a schematic diagram of the composition of yet another resource deployment device provided by an embodiment of the present disclosure;

图12为本公开实施例提供的又一种资源部署装置的组成示意图;Figure 12 is a schematic diagram of the composition of yet another resource deployment device provided by an embodiment of the present disclosure;

图13为本公开实施例提供的一种服务器的组成示意图。Figure 13 is a schematic diagram of the composition of a server provided by an embodiment of the present disclosure.

具体实施方式Detailed ways

在需要进行资源共享时,出于对资源隔离的考虑,可以针对不同的业务线搭建不同的物理机集群,以便在满足不同业务线的服务运行所需资源需求的同时,实现不同业务线对应的资源的隔离。本公开实施例中,对资源进行隔离也可称为对资源的容器化。其中,搭建以及维护集群的一方可以称为部署方,提出业务线资源需求的一方可以称为业务方。When resource sharing is required, for the sake of resource isolation, different physical machine clusters can be built for different business lines, so as to meet the resource requirements required for service operation of different business lines and at the same time realize the corresponding resources of different business lines. Isolation of resources. In the embodiment of the present disclosure, isolating resources may also be referred to as containerizing resources. Among them, the party that builds and maintains the cluster can be called the deployment party, and the party that proposes business line resource requirements can be called the business party.

示例性的,在接收到业务方提出的业务线的资源需求之后,部署方可以通过Kubernetes(K8s)实现资源的容器化,其中,通过K8s搭建的物理机集群也可称为K8s集群。在完成K8s集群的搭建后,部署方还可以使用K8s对该集群进行维护。For example, after receiving the resource requirements of the business line proposed by the business party, the deployer can implement resource containerization through Kubernetes (K8s). The physical machine cluster built through K8s can also be called a K8s cluster. After completing the construction of the K8s cluster, the deployer can also use K8s to maintain the cluster.

然而,由于业务线对于资源的需求并非一成不变,因此可能会出现资源利用率低下的问题。示例性的,以根据业务线1的资源需求为业务线1搭建的K8s集群包括4个物理机为例进行说明。当业务线1运行时,如果该业务线1需求的资源没有发生变化,如图2中的(a)所示,K8s集群中的4个物理机均可处于工作状态(或称为被占用的状态),此时该K8s集群的资源利用率较高。但是,如果该业务线1运行时需求的资源变少,例如运行该业务线1仅需要2个物理机的资源,如图2中的(b)所示,K8s集群中的4个物理机中可能只有2个物理机处于工作状态,使得该K8s集群的资源利用率降低。由此会导致该K8s集群中的资源浪费。如果想要将处于空闲状态的2个物理机从K8s集群中剥离出来,需要非常繁琐的操作,例如重新针对该业务线1搭建K8s集群,这样不仅可能会影响到业务线1的正常运行,同时还会付出较大的人力和物力的成本投入。However, because the demand for resources by business lines is not constant, the problem of low resource utilization may occur. As an example, the K8s cluster built for business line 1 according to the resource requirements of business line 1 includes 4 physical machines. When business line 1 is running, if the resources required by business line 1 do not change, as shown in (a) in Figure 2, all four physical machines in the K8s cluster can be in working status (or called occupied). status), the resource utilization of the K8s cluster is relatively high at this time. However, if the resources required for running the business line 1 become smaller, for example, only the resources of 2 physical machines are needed to run the business line 1. As shown in (b) in Figure 2, among the 4 physical machines in the K8s cluster There may be only two physical machines in working state, which reduces the resource utilization of the K8s cluster. This will lead to a waste of resources in the K8s cluster. If you want to separate the two idle physical machines from the K8s cluster, you need a very tedious operation, such as re-building a K8s cluster for the business line 1. This may not only affect the normal operation of the business line 1, but also affect the normal operation of the business line 1. There will also be a large cost investment in manpower and material resources.

为了解决上述问题,本公开实施例提供一种资源部署方法,通过对为业务线部署的物理机配置标签,以针对不同的业务线形成具有不同标签的资源池。将资源的隔离粒度由集群降低为物理机,从而实现在需要将物理机从已部署的资源池释放出来时,能够稳定便捷的实现资源的重新分配,由此减小对资源的浪费,提高资源的利用率。In order to solve the above problem, embodiments of the present disclosure provide a resource deployment method, by configuring labels for physical machines deployed for business lines, so as to form resource pools with different labels for different business lines. Reduce the isolation granularity of resources from clusters to physical machines, so that when physical machines need to be released from the deployed resource pool, resources can be reallocated stably and conveniently, thus reducing the waste of resources and improving resources. utilization rate.

为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to allow ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second", etc. in the description and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.

请参考图3,为本公开实施例提供的一种实施环境的示意图,上述资源部署方法可以应用于在该实施环境中。Please refer to FIG. 3 , which is a schematic diagram of an implementation environment provided by an embodiment of the present disclosure. The above resource deployment method can be applied in this implementation environment.

如图3所示,该实施环境中可以包括业务方设备210,部署方设备220以及包括M个物理机的服务器230,M为大于1的整数。业务方设备210,部署方设备220以及服务器230均可通过有线或无线网络连接,以便业务方设备210,部署方设备220以及服务器230通过该有线或无线网络进行通信。As shown in Figure 3, the implementation environment may include a business device 210, a deployer device 220, and a server 230 including M physical machines, where M is an integer greater than 1. The business device 210 , the deployer device 220 and the server 230 can all be connected through a wired or wireless network, so that the business device 210 , the deployer device 220 and the server 230 communicate through the wired or wireless network.

其中,包括M个物理机的服务器230主要用于提供处理器、内存等资源。业务方可以通过业务方设备210可向部署方设备220申请部署资源,用于业务线服务的运行。对应的,部署方可以通过部署方设备220处理上述对资源的申请,如部署对应的资源。Among them, the server 230 including M physical machines is mainly used to provide resources such as processors and memory. The business party can apply for deployment resources from the deployer device 220 through the business party device 210 for running the business line service. Correspondingly, the deployer can process the above application for resources through the deployer device 220, such as deploying the corresponding resources.

示例性的,业务方设备210可以接收业务方申请运行一个或多个业务线所需资源的操作,并将该资源需求发送给部署方设备220。业务方设备210还可以向业务方提供控制平台(如devops平台),以便接收业务方输入的在已部署的资源上运行业务线的操作,并响应于该操作与服务器230进行交互,实现业务线在已部署的资源上的运行。该业务方设备210可以为手机、平板电脑、笔记本电脑、台式计算机、便携式计算机等,本公开实施例在此不做限制。For example, the business party device 210 may receive an operation from the business party to apply for resources required to run one or more business lines, and send the resource requirements to the deployer device 220 . The business side device 210 can also provide a control platform (such as a devops platform) to the business side in order to receive the operation of running the business line on the deployed resources input by the business side, and interact with the server 230 in response to the operation to implement the business line. Run on deployed resources. The business device 210 can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, a portable computer, etc., and the embodiments of the present disclosure are not limited here.

部署方设备220可以用于接收业务方设备210发送的运行一个或多个业务线的资源需求,部署方设备220还可以在部署方的控制下,根据接收到的资源需求,通过服务器230为该资源需求对应的业务线部署对应的资源。类似于业务方设备210,该部署方设备220可以为手机、平板电脑、笔记本电脑、台式计算机、便携式计算机等,本公开实施例在此不做限制。The deployer device 220 can be used to receive the resource requirements for running one or more business lines sent by the business device 210. The deployer device 220 can also, under the control of the deployer, provide the resource requirements through the server 230 according to the received resource requirements. Business lines corresponding to resource requirements deploy corresponding resources. Similar to the business device 210, the deployer device 220 can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, a portable computer, etc., and the embodiment of the present disclosure is not limited here.

如图4所示,服务器230可以包括资源物理机231和管理物理机232。其中,资源物理机231可以是M个物理机中,用于提供资源的N个物理机,管理物理机232可以是M个物理机中,用于管理资源的P个物理机。N和P均为小于M的正整数。资源物理机231和管理物理机232也可以用过有线或无线网络连接,以便管理物理机232对用资源物理机231进行管理。在一些实施例中,管理物理机232中可以运行有K8s系统,以便在部署方设备220的控制下,对资源物理机231提供的资源进行管理。需要说明的是,本公开实施例中,用于管理物理机232还可以将物理机中除用于管理的资源外,剩余的资源提供给业务线,以实现物理机资源的优化利用。As shown in FIG. 4 , the server 230 may include a resource physical machine 231 and a management physical machine 232 . The resource physical machines 231 may be N physical machines among the M physical machines used to provide resources, and the management physical machines 232 may be P physical machines among the M physical machines used to manage resources. Both N and P are positive integers less than M. The resource physical machine 231 and the management physical machine 232 may also be connected through a wired or wireless network, so that the management physical machine 232 manages the resource physical machine 231. In some embodiments, the management physical machine 232 may run a K8s system to manage resources provided by the resource physical machine 231 under the control of the deployer device 220 . It should be noted that in the embodiment of the present disclosure, the physical machine 232 used to manage the physical machine can also provide the remaining resources in the physical machine, in addition to the resources used for management, to the business line to achieve optimal utilization of the physical machine resources.

示例性的,在部署方设备220在部署方的控制下为业务线部署资源时,可以将接收到的资源需求发送给管理物理机232,以便通过管理物理机232上运行的K8s系统,从资源物理机231中选取能够满足资源需求的一个或多个物理机,同时配置这些物理机的标签,以便具有相同标签的物理机能够构成与该业务线对应的资源池。这样,部署方设备220可以将该资源池提供给业务方设备210,以便业务方在要运行该业务时,在业务方设备210上输入相关操作,响应于该操作,业务方设备210就可以控制业务对应的服务运行在资源池包括的物理机中。For example, when the deployer device 220 deploys resources for the business line under the control of the deployer, the received resource requirements can be sent to the management physical machine 232, so that through the K8s system running on the management physical machine 232, resources can be obtained from the resource. One or more physical machines that can meet the resource requirements are selected from the physical machines 231, and labels of these physical machines are configured at the same time, so that physical machines with the same labels can form a resource pool corresponding to the business line. In this way, the deployer device 220 can provide the resource pool to the business device 210, so that when the business party wants to run the service, the business device 210 can input relevant operations. In response to the operation, the business device 210 can control The services corresponding to the business run on the physical machines included in the resource pool.

本公开实施例中,在完成资源池的部署后,管理物理机232还可以提供管理部署的资源的功能,具体的管理功能的实现方法将在以下实施例中说明,此处不再赘述。In the embodiment of the present disclosure, after the deployment of the resource pool is completed, the management physical machine 232 can also provide the function of managing the deployed resources. The specific implementation method of the management function will be explained in the following embodiments and will not be described again here.

需要说明的是,管理物理机232中运行的K8s系统也可运行在部署方设备220中。当部署方设备220中运行有K8s系统时,服务器230中的M个物理机均可作为资源物理机使用。It should be noted that the K8s system running in the management physical machine 232 can also run in the deployer device 220 . When the K8s system is running on the deployer device 220, all M physical machines in the server 230 can be used as resource physical machines.

为了更加清楚地对本公开实施例提供的资源部署方法进行说明,以下以部署以及管理资源的K8s系统运行在服务器的管理物理机中为例进行说明。In order to explain more clearly the resource deployment method provided by the embodiments of the present disclosure, the following description takes the K8s system that deploys and manages resources running in the management physical machine of the server as an example.

请参考图5,示出了本公开实施例提供的一种资源部署方法的示意图。如图5所示,该方法可以包括S501-S503。Please refer to FIG. 5 , which shows a schematic diagram of a resource deployment method provided by an embodiment of the present disclosure. As shown in Figure 5, the method may include S501-S503.

S501、服务器为第一业务线部署第一资源池。S501. The server deploys the first resource pool for the first business line.

其中,该第一资源池中包括多个配置有第一标签的物理机,该第一标签用于指示物理机被部署为用于运行第一业务线的服务。The first resource pool includes a plurality of physical machines configured with a first label, and the first label is used to indicate that the physical machine is deployed to run services of the first business line.

当业务方需要资源来支持业务线(如第一业务线)的运行时,可以向业务方设备输入对应的操作(如第一操作),响应于该第一操作,业务方设备可以将运行第一业务线所需的资源情况(即第一业务线的资源需求)发送给部署方设备。在接收到第一业务线的资源需求后,部署方设备可以将该资源需求发送给服务器。服务器中的管理物理机可以在部署方的控制下,通过K8s系统,根据业务方的需求,为该业务线部署多个物理机,并为这些物理机配置与第一业务线对应的标签,如第一标签。管理物理机可以将具有第一标签的物理机构成的第一资源池,提供给业务方。以便业务方在运行该第一业务线时,向业务方设备输入对应操作(如第二操作),响应于该第二操作,业务方设备可以选定该第一资源池,并向管理物理机发送相关信息(如选定第一资源池的操作,以及要运行的第一业务线的服务代码等信息),以便管理物理机根据上述信息在第一资源池包括的配置有第一标签的物理机上运行上述服务。When the business party needs resources to support the operation of the business line (such as the first business line), a corresponding operation (such as the first operation) can be input to the business party device. In response to the first operation, the business party device can run the third business line. The resource information required by a business line (ie, the resource requirements of the first business line) is sent to the deploying device. After receiving the resource requirement of the first business line, the deployer device may send the resource requirement to the server. The management physical machine in the server can be under the control of the deployer, through the K8s system, and according to the needs of the business party, deploy multiple physical machines for the business line, and configure these physical machines with labels corresponding to the first business line, such as First label. The management physical machine may provide the first resource pool composed of physical machines with the first label to the business party. So that when running the first business line, the business party inputs the corresponding operation (such as the second operation) to the business party device. In response to the second operation, the business party device can select the first resource pool and send the request to the management physical machine. Send relevant information (such as the operation of selecting the first resource pool, and the service code of the first business line to be run, etc.) so that the management physical machine can configure the physical machine with the first label included in the first resource pool according to the above information. The above services are running on the machine.

需要说明的是,本公开实施例中,一个资源池对应于一个业务线,而资源池的资源为具有相同标签的物理机提供的资源的集合。其中,资源池中的资源可以属于同一个物理机集群,也可以属于多个物理机集群。同时,一个物理机集群中可以包括一个资源池,也可以包括多个资源池。本公开实施例在此不做限制。It should be noted that in the embodiment of the present disclosure, one resource pool corresponds to one business line, and the resources of the resource pool are a collection of resources provided by physical machines with the same label. Among them, the resources in the resource pool can belong to the same physical machine cluster or to multiple physical machine clusters. At the same time, a physical machine cluster can include one resource pool or multiple resource pools. The disclosed embodiments are not limited here.

S502、服务器在第一资源池包括的物理机上运行第一业务线的服务的过程中,监测第一资源池的资源利用率。S502. During the process of running the service of the first business line on the physical machine included in the first resource pool, the server monitors the resource utilization rate of the first resource pool.

业务线的运行可以包括一个或多个服务的运行。例如,第一业务线的运行包括运行第一业务线包括的一个多个服务。The operation of a line of business can include the operation of one or more services. For example, running the first line of business includes running one or more services included in the first line of business.

本公开实施例中,在第一资源池包括的物理机上运行第一业务线的服务的过程中,服务器的管理物理机可以对该第一资源池的资源利用率进行监测,以便当该第一资源池的资源利用率较低时,采取适当的措施,以减少资源的浪费。其中,当该第一资源池的资源利用率较低时,可以将该第一资源池称为缩容目标。In the embodiment of the present disclosure, during the process of running the service of the first business line on the physical machine included in the first resource pool, the management physical machine of the server can monitor the resource utilization of the first resource pool, so that when the first resource pool is used, the management physical machine of the server can monitor the resource utilization of the first resource pool. When the resource utilization rate of the resource pool is low, take appropriate measures to reduce resource waste. When the resource utilization rate of the first resource pool is low, the first resource pool may be called a shrinkage target.

需要说明的是,对于第一资源池的资源利用率的监测,可以是从第一业务线开始运行时就启动的实时监测,也可以是以预设时间周期启动的监测,本公开实施例对此不作限制。It should be noted that the monitoring of resource utilization of the first resource pool can be real-time monitoring started when the first business line starts running, or monitoring started in a preset time period. The embodiments of the present disclosure are This is not a limitation.

S503、当第一资源池的资源利用率小于第一阈值时,服务器将第一物理机中运行的服务迁移到第二物理机上。S503. When the resource utilization rate of the first resource pool is less than the first threshold, the server migrates the service running in the first physical machine to the second physical machine.

其中,该第一物理机是第一资源池中资源利用率小于第二阈值的物理机,第二物理机是能够提供运行第一物理机中运行的服务所需资源的物理机。同时,该第二物理机是所述第一资源池中不同于第一物理机的物理机。Wherein, the first physical machine is a physical machine with a resource utilization rate in the first resource pool that is less than a second threshold, and the second physical machine is a physical machine that can provide resources required to run services running in the first physical machine. At the same time, the second physical machine is a physical machine different from the first physical machine in the first resource pool.

当第一资源池的资源利用率小于第一阈值时,则服务器就可以确定当前时刻该第一资源池中的资源存在较大的浪费,需要对其采取适当的措施。本公开实施中,服务器可以将第一资源池中的部分利用率低的物理机从第一资源池中释放出来,以便提高第一资源池的利用率。When the resource utilization rate of the first resource pool is less than the first threshold, the server can determine that there is a large waste of resources in the first resource pool at the current moment, and appropriate measures need to be taken. In the implementation of the present disclosure, the server may release some physical machines with low utilization in the first resource pool from the first resource pool in order to improve the utilization of the first resource pool.

示例性的,服务器的管理物理机可以在部署方的控制下,选择资源利用率小于第二阈值的物理机作为需要释放的物理机(如第一物理机),如果该第一物理机中存在正在运行的服务(如第一服务),则将该第一服务从第一物理机中迁移至第一资源池中的其他物理机上(如第二物理机)运行。其中,该第二物理机可以是第一资源池中,能够提供运行第一服务所需的资源的任意一个物理机。For example, the server's management physical machine can, under the control of the deployer, select a physical machine whose resource utilization is less than the second threshold as the physical machine that needs to be released (such as the first physical machine), if there is a physical machine in the first physical machine. If a running service (such as the first service) is found, the first service is migrated from the first physical machine to other physical machines in the first resource pool (such as the second physical machine) for running. The second physical machine may be any physical machine in the first resource pool that can provide resources required for running the first service.

其中,对服务的迁移可以通过在第二物理机上重启该服务,并停止该服务在第一物理机上的运行实现。需要说明的是,重启服务与停止服务的过程可以是同时进行的,也可以是分时进行的,本公开实施例在此不做限制。The migration of the service can be achieved by restarting the service on the second physical machine and stopping the running of the service on the first physical machine. It should be noted that the processes of restarting the service and stopping the service may be performed simultaneously or in a time-sharing manner, which is not limited in the embodiments of the present disclosure.

在本公开实施例的一些实现方式中,还可以进一步对第一物理机进行对应的处理,以便第一物理机的资源能够被重新利用,如被配置到其他业务的资源池中。In some implementations of the embodiments of the present disclosure, corresponding processing can be further performed on the first physical machine so that the resources of the first physical machine can be reused, such as being configured into resource pools of other services.

示例性的,服务器可以将第一物理机的第一标签修改为第二标签,第二标签用于指示第一物理机未被部署。在确保第一物理机上没有运行的服务之后,管理物理机就可以在部署方的控制下,将该第一物理机的第一标签修改为第二标签。根据上述S501中的说明,具有第一标签的物理机可以用于运行第一业务线的服务,而在将第一物理机的第一标签修改为第二标签后,则表明第一物理机不再包括在第一资源池中,而是处于未被部署的状态。以便当有其他业务线需要部署资源时,该第一物理机就可以被重新部署到其他资源池中。For example, the server may modify the first label of the first physical machine to a second label, and the second label is used to indicate that the first physical machine is not deployed. After ensuring that there are no services running on the first physical machine, the management physical machine can modify the first label of the first physical machine to the second label under the control of the deployer. According to the above description in S501, the physical machine with the first label can be used to run the service of the first business line. After modifying the first label of the first physical machine to the second label, it indicates that the first physical machine does not It is then included in the first resource pool, but is in an undeployed state. So that when other business lines need to deploy resources, the first physical machine can be redeployed to other resource pools.

基于上述S501-S503的资源部署方法,当业务线需求的资源数量减小时,将部分具有与该资源池对应标签的物理机修改为其他标签,就可以将该物理机释放出来。实现了在不影响业务线的服务运行的同时,压缩了资源池中物理机的数量,从而减小了资源的浪费。Based on the above resource deployment method of S501-S503, when the number of resources required by the business line decreases, some physical machines with labels corresponding to the resource pool can be modified to other labels, and the physical machines can be released. It is possible to compress the number of physical machines in the resource pool without affecting the service operation of the business line, thereby reducing the waste of resources.

本公开实施例中,资源部署还方法可以细分为部署过程和管理过程两个过程。In the embodiment of the present disclosure, the resource deployment method can be subdivided into two processes: a deployment process and a management process.

请参考图6,示出了本公开实施例提供的资源部署方法中的部署过程的一种方法的流程图。如图6所示,该方法可以包括S601-S603。其中,以业务方要运行的业务线为第一业务线为例进行说明。Please refer to FIG. 6 , which shows a flow chart of a deployment process in the resource deployment method provided by an embodiment of the present disclosure. As shown in Figure 6, the method may include S601-S603. Among them, the business line to be run by the business party is the first business line as an example for explanation.

S601、服务器接收第一业务线的资源需求。S601. The server receives the resource requirements of the first business line.

该第一业务线的资源需求可以是业务方设备发送给部署方设备,再由部署方设备发送给服务器的管理物理机的。示例性的,该资源需求可以包括运行第一业务线所需的硬件需求,如该资源需求可以包括A个处理器以及B兆字节(Megabyte,MB)内存。The resource requirement of the first business line may be sent by the business device to the deployer device, and then the deployer device sends it to the management physical machine of the server. For example, the resource requirements may include hardware requirements required to run the first business line. For example, the resource requirements may include A processors and B megabytes (Megabytes, MB) of memory.

S602、服务器根据资源需求,为多个物理机中的每个物理机配置第一标签。S602. The server configures a first label for each of the multiple physical machines based on resource requirements.

其中,上述多个物理机所提供的资源能够满足第一业务线的资源需求,被配置为第一标签的多个物理可以机构成与第一业务线对应的第一资源池。Wherein, the resources provided by the plurality of physical machines can meet the resource requirements of the first business line, and the plurality of physical machines configured as the first label constitute a first resource pool corresponding to the first business line.

根据接收到的资源需求,服务器的管理物理机可以在部署方的控制下,从未部署的物理机中选取上述多个物理机,并为这些物理机配置标签(如第一标签)。其中,包括配置有第一标签的物理机提供的资源可以构成与第一业务线对应的第一资源池。According to the received resource requirements, the management physical machine of the server can, under the control of the deployer, select the plurality of physical machines mentioned above from the undeployed physical machines, and configure labels (such as first labels) for these physical machines. The resources provided by the physical machine configured with the first label may constitute a first resource pool corresponding to the first business line.

示例性的,以每个物理机能够提供C个处理器,D MB内存为例。当第一业务线的资源需求为A个处理器,B MB内存时,通过对比以及/>取二者中较大的值,可确定要选取物理机的个数,也就是说,这些物理机提供的资源就能够满足运行第一业务线的资源需求。For example, each physical machine can provide C processors and D MB memory. When the resource requirements of the first business line are A processors and B MB memory, through comparison and/> Taking the larger value of the two determines the number of physical machines to be selected. In other words, the resources provided by these physical machines can meet the resource requirements for running the first business line.

在确定能够提供业务线的资源需求的资源的物理机个数后,管理物理机可以从未被部署的物理机中选取对应个数的物理机,作为运行该业务线的物理机。管理物理机还可以为这些物理机配置标签,以便标识这些物理机已被部署为向对应业务线提供资源。After determining the number of physical machines that can provide resources required by the business line, the management physical machine can select a corresponding number of physical machines from the undeployed physical machines as physical machines for running the business line. Managing physical machines can also configure tags for these physical machines to identify that these physical machines have been deployed to provide resources to the corresponding business lines.

示例性的,以第一业务线需要E个物理机提供资源为例。部署方可以从未部署的物理机中选取E个物理机,并给这E个物理机分别配置第一标签。其中,该第一标签可以是管理物理机在部署方的控制下,通过K8s系统为E个物理机配置的电子标签。这样,这E个被配置有第一标签的物理机提供的资源就构成了为第一业务线的运行提供资源的第一资源池。For example, take the first business line that requires E physical machines to provide resources. The deployer can select E physical machines from the undeployed physical machines, and configure the first labels for the E physical machines respectively. The first label may be an electronic label configured for the E physical machines through the K8s system under the control of the deployer. In this way, the resources provided by the E physical machines configured with the first label constitute the first resource pool that provides resources for the operation of the first business line.

类似的,当一个或多个业务方的多个不同的业务线都需要运行时,部署方可以针对上述多个不同的业务线中的每个业务线执行上述S601-S602,以实现对不同的业务线部署分别部署资源以支持其运行的目的。Similarly, when multiple different business lines of one or more business parties need to be run, the deployer can execute the above S601-S602 for each of the multiple different business lines to implement different business lines. Line-of-business deployment deploys resources individually to support the purpose for which they operate.

请参考图7,示出了为多个业务线部署资源的示意图。Please refer to Figure 7, which shows a schematic diagram of deploying resources for multiple business lines.

如图7所示,以服务器中通过K8s系统搭建有1个K8s集群,其中包括能够提供资源的物理机A、物理机B、物理机C、物理机D、物理机E和物理机F以及其他物理机(图7中未示出),多个不同的业务线包括3个业务线,如业务线1、业务线2和业务线3为例进行说明。As shown in Figure 7, a K8s cluster is built in the server through the K8s system, including physical machine A, physical machine B, physical machine C, physical machine D, physical machine E, physical machine F and others that can provide resources. In the physical machine (not shown in Figure 7), multiple different business lines include three business lines, such as business line 1, business line 2 and business line 3, as an example for description.

其中,为了便于对多个物理机进行管理,服务器可以在部署方的控制下,通过其中运行的K8s系统将服务器中包括的所有物理机搭建为一个K8s集群。Among them, in order to facilitate the management of multiple physical machines, the server can be under the control of the deployer and all the physical machines included in the server can be built into a K8s cluster through the K8s system running in it.

在接收到业务线1、业务线2和业务线3的资源需求后,服务器可以通过K8s系统,为需要2个物理机的资源的业务线1部署2个物理机。如为业务线1分配物理机B和物理机C,并为物理机B和物理机C配置标签1。则具有标签1的物理机B和物理机C提供的资源所构成的资源池就可以是为业务线1部署的资源池1。After receiving the resource requirements of business line 1, business line 2, and business line 3, the server can deploy 2 physical machines through the K8s system for business line 1 that requires the resources of 2 physical machines. For example, physical machine B and physical machine C are assigned to business line 1, and label 1 is configured for physical machine B and physical machine C. Then the resource pool composed of the resources provided by physical machine B and physical machine C with label 1 can be resource pool 1 deployed for business line 1.

类似的,服务器可以通过K8s系统,为需要1个物理机的资源的业务线2部署1个物理机。如为业务线2分配物理机D,并为物理机D配置标签2。则具有标签2的物理机D提供的资源所构成的资源池就可以是为业务线2部署的资源池2。Similarly, the server can deploy a physical machine through the K8s system for business line 2 that requires the resources of one physical machine. For example, physical machine D is assigned to business line 2, and label 2 is configured for physical machine D. Then the resource pool composed of the resources provided by physical machine D with label 2 can be resource pool 2 deployed for business line 2.

服务器可以通过K8s系统,为需要2个物理机的资源的业务线3部署2个物理机。如为业务线3部分配理机E和物理机F,并为物理机E和物理机F配置标签3。则具有标签3的物理机E和物理机F提供的资源所构成的资源池就可以是为业务线3部署的资源池3。The server can deploy 2 physical machines through the K8s system for business line 3 that requires the resources of 2 physical machines. For example, configure machine E and physical machine F for business line 3, and configure label 3 for physical machine E and physical machine F. Then the resource pool composed of the resources provided by physical machine E and physical machine F with label 3 can be resource pool 3 deployed for business line 3.

本公开实施例中,服务器还可以通过K8s系统,为不需要资源隔离的业务线的服务部署物理机。如为不需要资源隔离的业务线的服务部署如图7中的物理机A,以便将物理机A的资源提供给这些不需要资源隔离的业务线的服务。这样不仅为减少了资源隔离带来的额外部署投入,同时也使得运行不需要资源隔离的业务线的服务的物理机的资源得到最大化的利用。In this disclosed embodiment, the server can also deploy physical machines through the K8s system for business line services that do not require resource isolation. For example, physical machine A in Figure 7 is deployed for services of business lines that do not require resource isolation, so that the resources of physical machine A are provided to services of these business lines that do not require resource isolation. This not only reduces the additional deployment investment caused by resource isolation, but also maximizes the use of physical machine resources for running business line services that do not require resource isolation.

S603、服务器将第一资源池与第一业务线所在服务树节点绑定,用于在需要运行第一业务线的服务时,用户选定与第一业务线对应的第一资源池。S603. The server binds the first resource pool to the service tree node where the first business line is located, so that when the service of the first business line needs to be run, the user selects the first resource pool corresponding to the first business line.

在完成对第一业务线对应的第一资源池的部署之后,业务方设备就可以在用户(即业务方)的控制下,在该第一资源池上运行第一业务线的服务。由于服务器中可以同时包括多个为不同的业务线部署的多个不同的资源池,为了避免服务器在运行第一业务线的服务时,错误地将第一业务线的服务调度到第一资源池之外的其他资源池中,本公开实施例中,服务器可以在完成资源的部署之后,将第一资源池与第一业务线所在服务树节点绑定,以便业务方在想要运行第一业务线的服务时,可以对业务方设备输入选定第一资源池的操作(如第三操作),响应于该第三操作,业务方设备可以将选定第一资源池的操作发送给服务器,以便服务器可以将第一业务线的服务调度到第一资源池包括的物理机上运行。After completing the deployment of the first resource pool corresponding to the first business line, the business side device can run the service of the first business line on the first resource pool under the control of the user (that is, the business side). Since the server can include multiple different resource pools deployed for different business lines at the same time, in order to prevent the server from mistakenly scheduling the service of the first business line to the first resource pool when running the service of the first business line. In other resource pools, in the embodiment of the present disclosure, after completing the deployment of resources, the server can bind the first resource pool to the service tree node where the first business line is located, so that the business party can run the first business line when it wants to When providing services, an operation (such as a third operation) of selecting the first resource pool can be input to the business side device. In response to the third operation, the business side device can send the operation of selecting the first resource pool to the server, so that The server may schedule the service of the first business line to run on the physical machine included in the first resource pool.

示例性的,如图8所述,为一种资源池与服务树节点绑定的示意图。如图8所示,服务器的管理物理机为业务线A部署了资源池A,为业务线B部署了资源池B,为业务线A的子业务线A1部署了资源池A1,为业务线A的子业务线A2部署了资源池A2,为业务线B的子业务线B1部署了资源池B1。则在部署资源时,管理物理机可以将资源池A绑定到业务线A所在服务树节点,将资源池B绑定到业务线B所在服务树节点,将资源池A1绑定到业务线A1所在服务树节点,将资源池A2绑定到业务线A2所在服务树节点,将资源池B1绑定到业务线B1所在服务树节点。For example, as shown in Figure 8, it is a schematic diagram of binding a resource pool and a service tree node. As shown in Figure 8, the server's management physical machine has deployed resource pool A for business line A, resource pool B for business line B, resource pool A1 for sub-business line A1 of business line A, and resource pool A for business line A. Resource pool A2 is deployed for sub-business line A2 of business line B, and resource pool B1 is deployed for sub-business line B1 of business line B. When deploying resources, the management physical machine can bind resource pool A to the service tree node where business line A is located, bind resource pool B to the service tree node where business line B is located, and bind resource pool A1 to business line A1. Bind resource pool A2 to the service tree node where business line A2 is located, and bind resource pool B1 to the service tree node where business line B1 is located.

这样,业务方设备向业务方提供的用于控制业务线运行的操作平台(如devops平台)中,在业务线A对应的服务树节点上,就只显示与该业务线A所在服务树节点绑定的资源池A可供选择。类似的,在业务线B对应的服务树节点上,就只显示与该业务线B所在服务树节点绑定的资源池B可供选择。在业务线A1对应的服务树节点上,就只显示与该业务线B所在服务树节点绑定的资源池A1可供选择。在业务线A2对应的服务树节点上,就只显示与该业务线B所在服务树节点绑定的资源池A2可供选择。在业务线B1对应的服务树节点上,就只显示与该业务线B所在服务树节点绑定的资源池B2可供选择。In this way, in the operating platform (such as the devops platform) provided by the business side equipment to control the operation of the business line, on the service tree node corresponding to the business line A, only the information tied to the service tree node where the business line A is located will be displayed. A certain resource pool A is available for selection. Similarly, on the service tree node corresponding to business line B, only resource pool B bound to the service tree node where business line B is located is displayed for selection. On the service tree node corresponding to business line A1, only resource pool A1 bound to the service tree node where business line B is located is displayed for selection. On the service tree node corresponding to business line A2, only resource pool A2 bound to the service tree node where business line B is located is displayed for selection. On the service tree node corresponding to business line B1, only resource pool B2 bound to the service tree node where business line B is located is displayed for selection.

通过上述S601-S603的方法,服务器就完成了根据业务方提出的业务线的资源需求,对该业务线部署对应的资源池。在完成部署之后,部署方可以通过服务器或部署方设备将业务线对应的资源池名称提供给业务方,以便当业务方想要在部署的资源池包括的物理机上运行对应业务线的服务时,可以按照以下S604-S605所示的方法执行。Through the above-mentioned S601-S603 methods, the server has completed deploying the corresponding resource pool for the business line according to the resource requirements of the business line proposed by the business party. After completing the deployment, the deployer can provide the resource pool name corresponding to the business line to the business party through the server or the deployer device, so that when the business party wants to run the service corresponding to the business line on the physical machine included in the deployed resource pool, It can be executed according to the method shown in S604-S605 below.

S604、接收第一业务线的服务和用户选定第一资源池的指令。S604. Receive the service of the first business line and the user's instruction to select the first resource pool.

示例性的,在完成第一资源池的部署后,资源池可以与业务线所在服务树节点绑定。在用户(如业务方)想要运行第一业务线的服务时,K8s集群的管理物理机可以接收到业务方通过业务方设备提供的操作平台(如devops平台)输入的选定第一资源池的指令。还可以接收到业务方通过devops平台输入的服务指令,如该服务指令可以为实现服务对应功能的计算机代码。For example, after the deployment of the first resource pool is completed, the resource pool can be bound to the service tree node where the business line is located. When a user (such as a business party) wants to run the service of the first business line, the management physical machine of the K8s cluster can receive the selected first resource pool input by the business party through the operation platform (such as devops platform) provided by the business party device. instructions. You can also receive service instructions input by the business party through the devops platform. For example, the service instructions can be computer codes that implement the corresponding functions of the service.

S605、响应于该指令,在第一资源池包括的物理机上运行第一业务线的服务。S605. In response to the instruction, run the service of the first business line on the physical machine included in the first resource pool.

在接收到业务方设备发送的指令后,K8s集群的管理物理机就可以在对应的物理机上运行对应的服务。After receiving the instructions sent by the business device, the management physical machine of the K8s cluster can run the corresponding service on the corresponding physical machine.

示例性的,当接收到业务方通过devops平台选定第一资源池的指令时,K8s集群的管理物理机就可以根据该第一资源池的名称确定第一标签,并以第一标签作为筛选条件,从K8s集群的物理机中筛选出具有第一标签的物理机,这样就确定了第一资源池中的物理机。根据接收到的业务方发送的服务指令,管理物理机可以将该服务指令包括的计算机代码发送给第一资源池中的物理机,以便在第一资源池中的物理机上运行该代码,以实现该代码对应的服务的功能。For example, when receiving an instruction from the business party to select the first resource pool through the devops platform, the management physical machine of the K8s cluster can determine the first label based on the name of the first resource pool, and use the first label as a filter. Condition, select the physical machine with the first label from the physical machines of the K8s cluster, thus determining the physical machine in the first resource pool. According to the received service instruction sent by the business party, the management physical machine can send the computer code included in the service instruction to the physical machine in the first resource pool, so that the code can be run on the physical machine in the first resource pool to implement The function of the service corresponding to this code.

请参考图9,示出了本公开实施例提供的资源部署方法中的管理过程的一种实现方法。如图9所示,该方法可以包括S901-S905。Please refer to FIG. 9 , which illustrates an implementation method of the management process in the resource deployment method provided by the embodiment of the present disclosure. As shown in Figure 9, the method may include S901-S905.

S901、在第一资源池包括的物理机上运行第一业务线的服务的过程中,服务器监测第一资源池的资源利用率。S901. During the process of running the service of the first business line on the physical machine included in the first resource pool, the server monitors the resource utilization of the first resource pool.

该方法与如图5所示的S502类似,此处不再赘述。This method is similar to S502 shown in Figure 5 and will not be described again here.

S902、在确定第一资源池为缩容目标后,服务器确定第一物理机中运行的服务允许被迁移。S902. After determining that the first resource pool is the shrinkage target, the server determines that the service running in the first physical machine is allowed to be migrated.

其中,第一物理机可以是第一资源池中,资源利用率较小的物理机。该第一物理机也可称为释放目标。The first physical machine may be a physical machine with low resource utilization in the first resource pool. The first physical machine may also be called a release target.

一般而言,第一资源池中可以包括多个物理机,以便提供充足的资源运行第一业务线的服务。当第一资源池的总体资源利用率较低时,可以根据预设条件,确定第一物理机中运行的服务允许被迁移,以便将这些服务从第一物理机中迁移出去。Generally speaking, the first resource pool may include multiple physical machines to provide sufficient resources to run services of the first business line. When the overall resource utilization of the first resource pool is low, it can be determined according to preset conditions that services running in the first physical machine are allowed to be migrated, so that these services can be migrated from the first physical machine.

示例性的,根据预设条件,确定第一物理机中运行的服务允许被迁移,具体的可以包括以下实现方式:For example, based on preset conditions, it is determined that the service running in the first physical machine is allowed to be migrated. Specifically, the following implementation methods may be included:

当第一物理机运行的服务的优先级为低优先级时,可确定该服务允许被迁移。示例性的,业务线包括的服务可以根据该服务对应的功能分为高优先级服务、中优先级服务以及低优先级服务。第一物理机中运行的服务为低优先级服务时,意味着将该服务迁移到其他物理机(如第二物理机)的操作不会对业务线的运行造成较大的影响。因此,当第一物理机运行的服务的优先级为低优先级时,可确定该第一物理机中运行的服务可以被迁移。When the priority of the service running on the first physical machine is low priority, it can be determined that the service is allowed to be migrated. For example, the services included in the business line can be divided into high-priority services, medium-priority services, and low-priority services according to the functions corresponding to the services. When the service running on the first physical machine is a low-priority service, it means that migrating the service to other physical machines (such as the second physical machine) will not have a major impact on the operation of the business line. Therefore, when the priority of the service running on the first physical machine is low priority, it can be determined that the service running on the first physical machine can be migrated.

当第一物理机运行的服务为无状态服务时,可确定该服务允许被迁移。示例性的,服务在物理机中运行的过程中,可能需要依赖该物理机中的其他服务才可正常运行,这种服务可以称为有状态服务。而也存在一些服务,不需要依赖其他服务就可以独立运行,这种服务可以称为无状态服务。本公开实施例中,如果第一物理机中运行的服务为无状态服务,则表明该服务可以顺利地在其他物理机中运行。也就是说,迁移该服务不会对该服务的运行造成影响。因此,当第一物理机运行的服务为无状态服务时,可确定该服务允许被迁移。When the service running on the first physical machine is a stateless service, it can be determined that the service is allowed to be migrated. For example, when a service is running in a physical machine, it may need to rely on other services in the physical machine to run normally. This kind of service can be called a stateful service. There are also some services that can run independently without relying on other services. Such services can be called stateless services. In the embodiment of the present disclosure, if the service running in the first physical machine is a stateless service, it means that the service can run smoothly in other physical machines. In other words, migrating the service will not affect the operation of the service. Therefore, when the service running on the first physical machine is a stateless service, it can be determined that the service is allowed to be migrated.

当第一物理机运行的服务的服务实例个数较多时,可确定该服务允许被迁移。示例性的,服务对应的功能可通过一个或多个服务实例实现。一般而言,为了避免某个服务实例异常造成的服务对应的功能的丧失,可以在运行服务时,在不同的物理机中发起多个该服务对应的服务实例。本公开实施例中,当第一物理机中运行的服务具有多个服务实例时,则表明迁移该服务只需在其他物理机(如第二物理机)上重启一个服务实例即可实现。也就是所,停止该服务在第一物理机上的运行不会影响服务提供的功能。因此,当第一物理机运行的服务的服务实例个数较多时,可确定该服务允许被迁移。When the number of service instances of the service running on the first physical machine is large, it can be determined that the service is allowed to be migrated. For example, the functions corresponding to the service can be implemented through one or more service instances. Generally speaking, in order to avoid the loss of functions corresponding to the service caused by an abnormality of a certain service instance, you can initiate multiple service instances corresponding to the service in different physical machines when running the service. In the embodiment of the present disclosure, when the service running in the first physical machine has multiple service instances, it means that migrating the service can be achieved by simply restarting one service instance on other physical machines (such as the second physical machine). That is to say, stopping the running of the service on the first physical machine will not affect the functions provided by the service. Therefore, when the number of service instances of the service running on the first physical machine is large, it can be determined that the service is allowed to be migrated.

需要说明的是,在具体实施过程中,可以根据以上几种示例说明中的任意一种方法确定第一物理机的服务可以被迁移,也可以结合上述几种示例说明中的两中或两中以上方法综合考虑,确定第一物理机的服务可以被迁移。本公开实施例在此不做限制。It should be noted that during the specific implementation process, it can be determined that the service of the first physical machine can be migrated according to any one of the above examples, or two or more of the above examples can be combined. Taking the above methods into consideration, it is determined that the service of the first physical machine can be migrated. The disclosed embodiments are not limited here.

S903、服务器将第一物理机的第一标签修改为第三标签,第三标签用于指示第一物理机不能被部署。S903. The server modifies the first label of the first physical machine to a third label. The third label is used to indicate that the first physical machine cannot be deployed.

由于在业务线运行过程中,随时可能会有新的服务被调度到第一物理机上运行。因此,在确定第一物理机的服务可以被迁移后,为避免有新的服务运行在该第一物理机上,可将该第一物理机的第一标签修改为用于指示不能被部署的第三标签。Because during the operation of the business line, new services may be scheduled to run on the first physical machine at any time. Therefore, after it is determined that the service of the first physical machine can be migrated, in order to avoid new services running on the first physical machine, the first label of the first physical machine can be modified to indicate that the first physical machine cannot be deployed. Three labels.

S904、服务器将第一物理机中运行的服务迁移到第二物理机。S904. The server migrates the service running in the first physical machine to the second physical machine.

如S503中的说明,对服务的迁移可以通过在第二物理机上重启该服务,并停止该服务在第一物理机上的运行实现。其中,重启服务与停止服务的过程可以是同时进行的,也可以是分时进行的,本公开实施例在此不做限制。As explained in S503, the migration of the service can be implemented by restarting the service on the second physical machine and stopping the running of the service on the first physical machine. The processes of restarting the service and stopping the service may be performed simultaneously or in a time-sharing manner, which is not limited in the embodiments of the present disclosure.

S905、服务器将第一物理机的第三标签修改为第二标签。S905. The server modifies the third label of the first physical machine to the second label.

在经过上述S901-S905之后,第一物理机中已经不存在运行的服务,此时服务器就可以将第一物理机的第三标签修改为第二标签,用于指示该第一物理机没有被部署。以便当有其他业务线需要部署资源时,该第一物理机就可以被重新部署到其他资源池中。After the above S901-S905, there is no running service in the first physical machine. At this time, the server can modify the third label of the first physical machine to the second label to indicate that the first physical machine has not been deploy. So that when other business lines need to deploy resources, the first physical machine can be redeployed to other resource pools.

需要说明的是,上述S901-S905提供的资源部署方法,是以释放第一资源池中的一个物理机(如第一物理机)为例进行说明的。当释放第一物理机后,第一资源池的资源利用率依然较低时,可以重复执行上述S901-S905,以便进一步减小对资源的浪费。It should be noted that the resource deployment method provided by S901-S905 above is explained by taking the release of a physical machine (such as the first physical machine) in the first resource pool as an example. When the resource utilization rate of the first resource pool is still low after the first physical machine is released, the above-mentioned S901-S905 can be repeatedly executed to further reduce the waste of resources.

基于上述资源部署方法,根据第一业务线的资源需求,为其部署配置有第一标签的多个物理机,在这些物理机上运行第一业务时,通过迁移服务并修改标签,使得第一资源池的资源总量得以缩减,被释放出来的第一物理机资源能够被部署到其他业务线得到利用,由此提高了资源的利用率。Based on the above resource deployment method, multiple physical machines configured with the first label are deployed according to the resource requirements of the first business line. When running the first business on these physical machines, the first resource is configured by migrating services and modifying labels. The total amount of resources in the pool is reduced, and the released first physical machine resources can be deployed to other business lines for utilization, thereby improving resource utilization.

进一步地,在为第一业务线部署资源时,通过为物理机配置标签的方法将不同业务线的资源隔离开,使得不需要为每个业务线单独搭建集群,节省了大量的人力和物力投入。另外,将具有相同标签的物理机的资源构成的资源池提供给业务方,而资源池的名称可以根据业务线来设定,使得业务方不需要了解底层中标签等概念,即可明确地知晓为业务线部署的资源的名称,显著的提升了用户体验。Furthermore, when deploying resources for the first business line, the resources of different business lines are isolated by configuring labels for physical machines, so that there is no need to build separate clusters for each business line, saving a lot of manpower and material investment. . In addition, a resource pool composed of resources of physical machines with the same label is provided to the business side, and the name of the resource pool can be set according to the business line, so that the business side can clearly know it without knowing the underlying concepts such as labels. The name of the resources deployed for the business line significantly improves the user experience.

以上说明主要从管理物理机的角度对本公开实施例提供的方案进行了介绍。可以理解的是,管理物理机为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块,这些执行各个功能相应的硬件结构和/或软件模块可以构成一个管理物理机。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。The above description mainly introduces the solutions provided by the embodiments of the present disclosure from the perspective of managing physical machines. It can be understood that in order to realize the above functions, the management physical machine includes corresponding hardware structures and/or software modules that perform each function. These corresponding hardware structures and/or software modules that perform each function can constitute a management physical machine. Those skilled in the art should readily appreciate that the algorithm steps of each example described in conjunction with the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of this disclosure.

本公开实施例可以根据上述方法示例对管理物理机进行功能模块的划分,例如,管理物理机可以包括资源部署装置,该资源部署装置可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本公开实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。Embodiments of the present disclosure can divide the management physical machine into functional modules according to the above method examples. For example, the management physical machine can include a resource deployment device, and the resource deployment device can divide each functional module corresponding to each function, or can divide two or more More than one function is integrated into one processing module. The above integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiment of the present disclosure is schematic and is only a logical function division. In actual implementation, there may be other division methods.

在采用对应各个功能划分各个功能模块的情况下,图10示出了上述实施例中涉及的资源部署装置的一种可能的组成示意图,如图10所示,该资源部署装置可以包括:In the case where each functional module is divided corresponding to each function, Figure 10 shows a possible composition diagram of the resource deployment device involved in the above embodiment. As shown in Figure 10, the resource deployment device may include:

部署模块1001,被配置为第一业务线部署第一资源池,该第一资源池中包括多个配置有第一标签的物理机,配置有第一标签的物理机被部署为运行第一业务线的服务。The deployment module 1001 is configured to deploy a first resource pool for the first business line. The first resource pool includes a plurality of physical machines configured with the first label. The physical machines configured with the first label are deployed to run the first business. online services.

监测模块1002,被配置为在第一资源池包括的物理机上运行第一业务线的服务的过程中,监测第一资源池的资源利用率。The monitoring module 1002 is configured to monitor the resource utilization of the first resource pool during the process of running services of the first business line on the physical machines included in the first resource pool.

迁移模块1003,被配置为当第一资源池的资源利用率小于第一阈值时,将第一物理机中运行的服务迁移到第二物理机上。其中,第一物理机是第一资源池中资源利用率小于第二阈值的物理机,第二物理机是能够提供运行第一物理机中运行的服务所需资源的物理机。第二物理机是第一资源池中不同于第一物理机的物理机。The migration module 1003 is configured to migrate services running in the first physical machine to the second physical machine when the resource utilization of the first resource pool is less than the first threshold. The first physical machine is a physical machine whose resource utilization rate in the first resource pool is less than the second threshold, and the second physical machine is a physical machine that can provide resources required to run services running in the first physical machine. The second physical machine is a physical machine different from the first physical machine in the first resource pool.

可选的,请参考图11,该装置中还包括:修改模块1004,被配置为在将第一物理机中运行的服务迁移到第二物理机上之后,将第一物理机的第一标签修改为第二标签。需要说明的是,本公开实施例中,第一资源池外未被部署的物理机被配置有第二标签。Optionally, please refer to Figure 11. The device also includes: a modification module 1004 configured to modify the first label of the first physical machine after migrating the service running in the first physical machine to the second physical machine. for the second label. It should be noted that in this embodiment of the present disclosure, physical machines that are not deployed outside the first resource pool are configured with the second label.

可选的,修改模块1004,被配置为在将第一物理机中运行的服务迁移到第二物理机前,将第一物理机的第一标签修改为第三标签,被配置有第三标签的物理机是不运行任何服务的物理机。Optionally, the modification module 1004 is configured to modify the first label of the first physical machine to a third label before migrating the service running in the first physical machine to the second physical machine, and is configured with the third label. The physical machine is a physical machine that does not run any services.

修改模块1004,被配置为在将第一物理机中运行的服务迁移到第二物理机后,将第一物理机的第三标签修改为第二标签。The modification module 1004 is configured to modify the third label of the first physical machine to the second label after migrating the service running in the first physical machine to the second physical machine.

可选的,迁移模块1003,被配置为在第一物理机中运行的服务允许被迁移时,将第一物理机中运行的服务迁移到第二物理机上。Optionally, the migration module 1003 is configured to migrate the services running in the first physical machine to the second physical machine when the services running in the first physical machine are allowed to be migrated.

可选的,部署模块1001,被配置为接收第一业务线的资源需求。Optionally, the deployment module 1001 is configured to receive the resource requirements of the first business line.

部署模块1001,被配置为根据资源需求,为多个物理机中的每个物理机配置第一标签。多个物理机所提供的资源满足资源需求,被配置为第一标签的多个物理机构成第一资源池。The deployment module 1001 is configured to configure a first label for each physical machine in the plurality of physical machines according to resource requirements. The resources provided by the multiple physical machines meet the resource requirements, and the multiple physical machines configured as the first label constitute the first resource pool.

可选的,部署模块1001,被配置为将第一资源池与第一业务线所在服务树节点绑定,用于在需要运行第一业务线的服务时,用户选定与第一业务线对应的第一资源池。Optionally, the deployment module 1001 is configured to bind the first resource pool to the service tree node where the first business line is located, so that when the service of the first business line needs to be run, the user selects the resource corresponding to the first business line. The first resource pool.

可选的,如图12所示,该资源部署装置还包括:接收模块1005和运行模块1006。Optionally, as shown in Figure 12, the resource deployment device also includes: a receiving module 1005 and an operating module 1006.

接收模块1005,被配置为接收第一业务线的服务和用户选定第一资源池的指令。The receiving module 1005 is configured to receive the service of the first business line and the instruction of the user to select the first resource pool.

运行模块1006,被配置为响应于指令,在第一资源池包括的物理机上运行第一业务线的服务。The running module 1006 is configured to run the service of the first business line on the physical machine included in the first resource pool in response to the instruction.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the devices in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

图13是本发明实施例提供的一种服务器1300的结构示意图,该服务器1300可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(centralprocessing units,CPU)1301和一个或一个以上的存储器1302,其中,所述存储器1302中存储有至少一条指令,所述至少一条指令由所述处理器1301加载并执行以实现上述各个方法实施例提供的资源部署方法。示例性的,该服务器1300可以为图4中的管理物理机232。Figure 13 is a schematic structural diagram of a server 1300 provided by an embodiment of the present invention. The server 1300 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPUs) 1301 and a Or one or more memories 1302, wherein at least one instruction is stored in the memory 1302, and the at least one instruction is loaded and executed by the processor 1301 to implement the resource deployment method provided by the above method embodiments. For example, the server 1300 may be the management physical machine 232 in FIG. 4 .

当然,该服务器1300还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该服务器1300还可以包括其他用于实现设备功能的部件,在此不做赘述。Of course, the server 1300 may also have components such as wired or wireless network interfaces, keyboards, and input and output interfaces for input and output. The server 1300 may also include other components for implementing device functions, which will not be described again here.

本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,当所述存储介质中的指令由计算机设备的处理器执行时,使得计算机能够执行上述所示实施例提供的资源部署方法。Embodiments of the present disclosure also provide a computer-readable storage medium. Instructions are stored on the computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the computer device, the computer can execute the above-mentioned instructions. The resource deployment method provided by this embodiment is shown.

本公开实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机设备执行上述所示实施例提供的资源部署方法。Embodiments of the present disclosure also provide a computer program product containing instructions that, when run on a computer, cause the computer device to execute the resource deployment method provided by the embodiments shown above.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由权利要求指出。应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary technical means in the technical field that are not disclosed in this application. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims. It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (14)

1. A method of resource deployment, the method comprising:
deploying a first resource pool for a first service line, wherein the first resource pool comprises a plurality of physical machines configured with first tags, and the physical machines configured with the first tags are deployed to run services of the first service line; the undeployed physical machines outside the first resource pool are configured with second labels, wherein one resource pool corresponds to one service line, and the resources of the same resource pool are a set of resources provided by the physical machines with the same labels;
Monitoring the resource utilization rate of the first resource pool in the process of running the service of the first service line on a physical machine included in the first resource pool; when the resource utilization rate of the first resource pool is smaller than a first threshold value, migrating the service running in the first physical machine to a second physical machine; the first physical machine is a physical machine with the resource utilization rate in the first resource pool smaller than a second threshold value;
the second physical machine is a physical machine capable of providing resources required for running a service running in the first physical machine, the second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine;
modifying the first tag of the first physical machine to a second tag.
2. The method of claim 1, wherein the modifying the first tag of the first physical machine to a second tag comprises:
when starting to migrate the service running in the first physical machine to a second physical machine, modifying the first label of the first physical machine into a third label, wherein the physical machine configured with the third label is a physical machine which does not run any service; and after the service running in the first physical machine is migrated to a second physical machine, modifying the third tag of the first physical machine into the second tag.
3. The method of any of claims 1-2, wherein migrating services running in a first physical machine to a second physical machine comprises: and when the service running in the first physical machine is allowed to be migrated, migrating the service running in the first physical machine to the second physical machine.
4. The method according to any of claims 1-2, wherein said deploying a first resource pool for a first traffic line comprises:
receiving the resource requirement of the first service line; configuring the first label for each physical machine in a plurality of physical machines according to the resource demand; the resource provided by the plurality of physical machines meets the resource requirement, and the plurality of physical machines configured as the first tag form the first resource pool.
5. The method of claim 4, wherein after said deploying the first pool of resources for the first line of traffic, the method further comprises: binding the first resource pool with a service tree node where the first service line is located, and selecting the first resource pool corresponding to the first service line by a user when the service of the first service line needs to be operated.
6. The method of claim 5, wherein the method further comprises: receiving the service of the first service line and an instruction of selecting the first resource pool by a user; and responding to the instruction, and running the service of the first service line on a physical machine included in the first resource pool.
7. A resource deployment apparatus, the resource deployment apparatus comprising:
the deployment module is configured to deploy a first resource pool for a first service line, wherein the first resource pool comprises a plurality of physical machines configured with first tags, and the physical machines configured with the first tags are deployed to run services of the first service line; the undeployed physical machines outside the first resource pool are configured with second labels, wherein one resource pool corresponds to one service line, and the resources of the same resource pool are a set of resources provided by the physical machines with the same labels;
the monitoring module is configured to monitor the resource utilization rate of the first resource pool in the process of running the service of the first business line on a physical machine included in the first resource pool;
a migration module configured to migrate a service running in a first physical machine onto a second physical machine when a resource utilization of the first resource pool is less than a first threshold; the first physical machine is a physical machine with a resource utilization rate smaller than a second threshold value in the first resource pool, the second physical machine is a physical machine capable of providing resources required for running services running in the first physical machine, the second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine;
And the modification module is configured to modify the first label of the first physical machine into the second label after the service running in the first physical machine is migrated to the second physical machine.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the modification module is configured to modify the first label of the first physical machine into a third label when starting to migrate the service running in the first physical machine to a second physical machine, wherein the physical machine configured with the third label is a physical machine which does not run any service;
the modification module is configured to modify the third tag of the first physical machine to the second tag after migration of a service running in the first physical machine to a second physical machine is completed.
9. The device according to any one of claims 7 to 8, wherein,
the migration module is configured to migrate the service running in the first physical machine to the second physical machine when the service running in the first physical machine is allowed to be migrated.
10. The device according to any one of claims 7 to 8, wherein,
The deployment module is configured to configure the first tag for each physical machine of a plurality of physical machines according to resource requirements; the resource provided by the plurality of physical machines meets the resource requirement, and the plurality of physical machines configured as the first tag form the first resource pool; the undeployed physical machines outside the first resource pool are configured with second labels, wherein one resource pool corresponds to one service line, and the resources of the same resource pool are the set of the resources provided by the physical machines with the same labels.
11. The apparatus of claim 10, wherein the device comprises a plurality of sensors,
the deployment module is configured to bind the first resource pool with a service tree node where the first service line is located after the first resource pool is deployed for the first service line, and is used for selecting the first resource pool corresponding to the first service line by a user when the service of the first service line needs to be operated.
12. The apparatus of claim 11, further comprising a receiving module and an operating module;
the receiving module is configured to receive the service of the first service line and an instruction of selecting the first resource pool by a user;
The operation module is configured to respond to the instruction and operate the service of the first service line on the physical machine included in the first resource pool.
13. A server, the server comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: deploying a first resource pool for a first service line, wherein the first resource pool comprises a plurality of physical machines configured with first tags, and the physical machines configured with the first tags are deployed to run services of the first service line; the undeployed physical machines outside the first resource pool are configured with second labels, wherein one resource pool corresponds to one service line, and the resources of the same resource pool are a set of resources provided by the physical machines with the same labels;
monitoring the resource utilization rate of the first resource pool in the process of running the service of the first service line on a physical machine included in the first resource pool;
when the resource utilization rate of the first resource pool is smaller than a first threshold value, migrating the service running in the first physical machine to a second physical machine; the first physical machine is a physical machine with a resource utilization rate smaller than a second threshold value in the first resource pool, the second physical machine is a physical machine capable of providing resources required for running services running in the first physical machine, the second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine; modifying the first tag of the first physical machine to a second tag.
14. A computer-readable storage medium having instructions stored thereon, characterized in that,
the instructions, when executed by the processor, implement:
deploying a first resource pool for a first service line, wherein the first resource pool comprises a plurality of physical machines configured with first tags, and the physical machines configured with the first tags are deployed to run services of the first service line; the undeployed physical machines outside the first resource pool are configured with second labels, wherein one resource pool corresponds to one service line, and the resources of the same resource pool are a set of resources provided by the physical machines with the same labels;
monitoring the resource utilization rate of the first resource pool in the process of running the service of the first service line on a physical machine included in the first resource pool; when the resource utilization rate of the first resource pool is smaller than a first threshold value, migrating the service running in the first physical machine to a second physical machine; the first physical machine is a physical machine with a resource utilization rate smaller than a second threshold value in the first resource pool, the second physical machine is a physical machine capable of providing resources required for running services running in the first physical machine, the second physical machine is a physical machine in the first resource pool, and the second physical machine is different from the first physical machine; modifying the first tag of the first physical machine to a second tag.
CN202010060020.3A 2020-01-19 2020-01-19 Resource deployment method, device, server and storage medium Active CN111274033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010060020.3A CN111274033B (en) 2020-01-19 2020-01-19 Resource deployment method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010060020.3A CN111274033B (en) 2020-01-19 2020-01-19 Resource deployment method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN111274033A CN111274033A (en) 2020-06-12
CN111274033B true CN111274033B (en) 2024-02-13

Family

ID=71002040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010060020.3A Active CN111274033B (en) 2020-01-19 2020-01-19 Resource deployment method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN111274033B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858037B (en) 2020-06-30 2023-07-14 苏州浪潮智能科技有限公司 Service arrangement method, device and equipment of physical machine and storage medium
CN111880914A (en) * 2020-07-20 2020-11-03 北京百度网讯科技有限公司 Resource scheduling method, resource scheduling apparatus, electronic device, and storage medium
CN112799854B (en) * 2021-04-15 2021-07-13 腾讯科技(深圳)有限公司 Task processing method and device, electronic equipment and readable storage medium
CN115378839B (en) * 2022-08-26 2023-12-12 北京百度网讯科技有限公司 Deployment method of acquisition task and related equipment
CN115756823B (en) * 2022-10-20 2024-04-16 广州汽车集团股份有限公司 Service publishing method, device, vehicle and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484220A (en) * 2014-11-28 2015-04-01 杭州华为数字技术有限公司 Method and device for dispatching dynamic resources of virtual cluster
CN109271257A (en) * 2018-10-11 2019-01-25 郑州云海信息技术有限公司 A kind of method and apparatus of virtual machine (vm) migration deployment
CN109840139A (en) * 2017-11-29 2019-06-04 北京金山云网络技术有限公司 Method, apparatus, electronic equipment and the storage medium of resource management
CN109992350A (en) * 2017-12-29 2019-07-09 北京华胜天成科技股份有限公司 The moving method and device of virtual machine in the resource pool of cloud computing system
CN110633152A (en) * 2019-09-20 2019-12-31 苏州浪潮智能科技有限公司 Method and device for realizing horizontal scaling of service cluster

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10671379B2 (en) * 2018-03-27 2020-06-02 International Business Machines Corporation Software globalization management
US20190347313A1 (en) * 2018-05-08 2019-11-14 Noted Analytics, Inc. Methods and systems for enriching text information for application data entry and viewing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484220A (en) * 2014-11-28 2015-04-01 杭州华为数字技术有限公司 Method and device for dispatching dynamic resources of virtual cluster
CN109840139A (en) * 2017-11-29 2019-06-04 北京金山云网络技术有限公司 Method, apparatus, electronic equipment and the storage medium of resource management
CN109992350A (en) * 2017-12-29 2019-07-09 北京华胜天成科技股份有限公司 The moving method and device of virtual machine in the resource pool of cloud computing system
CN109271257A (en) * 2018-10-11 2019-01-25 郑州云海信息技术有限公司 A kind of method and apparatus of virtual machine (vm) migration deployment
CN110633152A (en) * 2019-09-20 2019-12-31 苏州浪潮智能科技有限公司 Method and device for realizing horizontal scaling of service cluster

Also Published As

Publication number Publication date
CN111274033A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
CN111274033B (en) Resource deployment method, device, server and storage medium
CN115328663B (en) Method, device, equipment and storage medium for scheduling resources based on PaaS platform
US9851989B2 (en) Methods and apparatus to manage virtual machines
CN106790092B (en) Remote procedure call server control system and method
CN114416352B (en) Computing power resource allocation method and device, electronic equipment and storage medium
CN117480494A (en) Coordinated container scheduling for improved resource allocation in virtual computing environments
EP3913859A1 (en) Vnf life cycle management method and apparatus
US20150143382A1 (en) Scheduling workloads and making provision decisions of computer resources in a computing environment
CN111880936A (en) Resource scheduling method and device, container cluster, computer equipment and storage medium
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN112463535A (en) Multi-cluster exception handling method and device
CN113032125B (en) Job scheduling method, job scheduling device, computer system and computer readable storage medium
CN115048216B (en) Resource management scheduling method, device and equipment of artificial intelligent cluster
CN111857951A (en) Containerized deployment platform and deployment method
CN116569137A (en) Preserving and restoring pre-provisioned virtual machine state
JP2017215884A (en) Virtual machine arrangement device and resource management method
CN114598665A (en) Resource scheduling method and device, computer readable storage medium and electronic equipment
CN113986539A (en) Method, device, electronic equipment and readable storage medium for realizing pod fixed IP
CN112015515B (en) Instantiation method and device of virtual network function
CN116157778A (en) System and method for hybrid centralized and distributed scheduling on shared physical host
CN117499490A (en) Multi-cluster-based network scheduling method and device
CN109660575B (en) Method and device for realizing NFV service deployment
KR20250012112A (en) Resource allocation method and device and artificial intelligence training system
CN111526168B (en) Scheduling management method and device for Network Function Virtualization (NFV) architecture
CN115277398A (en) Cluster network configuration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment