Resource scheduling management method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a resource scheduling management method, an electronic device, and a storage medium.
Background
Currently, in order to ensure the stability or performance of IT application systems in the conventional manner, an IT product application may be deployed in a hardware server or a highly configured virtual machine. With the increase of the developed SaaS products, more hardware servers or corresponding IaaS resources on the public cloud are necessary in the traditional mode, which brings high operation cost.
Disclosure of Invention
In order to overcome the defects of the prior art, one of the objectives of the present invention is to provide a resource scheduling management method, which can reduce the investment in IT hardware servers, machine room construction, and technical operation and maintenance, so as to achieve the objective of light assets.
Another object of the present invention is to provide an electronic device, which can reduce the investment in IT hardware servers, machine room construction, and technical operation and maintenance, so as to achieve the purpose of light assets.
IT is a further object of the present invention to provide a computer readable storage medium, which can reduce the investment in IT hardware servers, machine room construction, and technical operation and maintenance, so as to achieve the purpose of light assets.
One of the purposes of the invention is realized by adopting the following technical scheme:
a resource scheduling management method is applied to a resource scheduling management system, the resource scheduling management system comprises a plurality of micro service components, and the scheduling management method specifically comprises the following steps:
a receiving step: receiving an application image which needs to be created by a user, wherein the application image comprises image configuration information;
resource pulling: pulling cluster resource information according to the mirror image configuration information;
a user judgment step: judging whether the current user is a new user, if so, performing resource charging and applying corresponding cluster resource information for the user, wherein the resource charging is specifically a resource with the highest cost performance obtained by calculation; and if not, acquiring the created cluster resource information for the user.
Further, after the step of judging the user, the method also comprises a step of judging the balance: and judging whether the balance of the user account meets the requirement of the creation, if so, creating and configuring corresponding application for the user.
Furthermore, in the resource charging, weight allocation is performed on different resources, and when the resources with the same cost performance are obtained through calculation, the resources with higher weight are selected as scheduling resources.
Furthermore, the micro service components are deployed in a mirror image mode and are deployed into a k8s cluster container, and all the micro service components are pushed to a mirror image warehouse after being issued by mirror images.
Further, the mirror repository uses a role-based rights access control mechanism for hierarchical rights management.
Furthermore, all micro service components are deployed in a high availability mode, and nginx is adopted for directional agent and domain name resolution.
Furthermore, in the resource scheduling management system, each micro service can only access the database of the micro service, but cannot access the databases of other services; the cluster is deployed in the public cloud and the private cloud in the same mode and mirror images, the configuration files are adapted according to the environment, and if the private cloud cannot access the public network, the warehouse docker mirror images are exported and manually imported into the virtual machine.
Further, the resource scheduling management system operates in a container manner and employs a spring closed microservice framework for providing service registration and discovery, centralized configuration, load balancing, breakers, and routing.
The second purpose of the invention is realized by adopting the following technical scheme:
an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement a method for scheduling management of resources according to any one of the objects of the present invention.
The third purpose of the invention is realized by adopting the following technical scheme:
a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of scheduling management of a resource according to any one of the objects of the invention.
Compared with the prior art, the invention has the beneficial effects that:
the resource scheduling management method of the invention realizes the functions of service registration and discovery, centralized configuration, load balancing and the like by adopting the micro-service component, realizes the scheduling of the resources by calculating the cost performance to provide the resources with higher cost performance for the users, not only improves the development efficiency, but also reduces the resource use cost of the users.
Drawings
Fig. 1 is a flowchart of a resource scheduling management method according to a first embodiment;
FIG. 2 is a diagram illustrating a splitting comparison of the micro-service in the first embodiment;
FIG. 3 is a diagram of a logical architecture of a system for scheduling management of resources according to an embodiment;
FIG. 4 is a diagram illustrating a deployment architecture of a scheduling management system for resources according to an embodiment;
fig. 5 is a schematic block diagram of an implementation method of a resource scheduling management system according to an embodiment;
FIG. 6 is a block diagram illustrating a resource scheduling management system according to an embodiment;
FIG. 7 is a flowchart illustrating system updating according to one embodiment;
fig. 8 is a specific flowchart of a typical service scenario in the first embodiment.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that, in the present invention, the embodiments or technical features described below may be arbitrarily combined to form a new embodiment without conflict.
Example one
With the increase of the developed SaaS products, more hardware servers or corresponding IaaS resources on the public cloud are needed in the traditional mode, which brings high operation cost. At present, a general PaaS platform is built based on a lightweight virtualization technology Docker container technology commonly used in the industry and a kubenetes container arrangement technology of Google open source to meet the increasing requirements of SaaS service release, deployment and management. Through the PaaS resource scheduling management system, the investment in multiple aspects such as traditional IT hardware servers, machine room construction, technical operation and maintenance and the like is reduced by using a multi-VDC intelligent scheduling strategy and algorithm, and the use strength of other public cloud IaaS resources is increased, so that the purpose of light assets is achieved. The specific implementation mode is as follows:
as shown in fig. 1, this embodiment provides a resource scheduling management method, which is applied to a resource scheduling management system, where the resource scheduling management system includes a plurality of micro service components, and the scheduling management method specifically includes the following steps:
before receiving that a user creates an application mirror image, the user needs to log in first, opens a Web interface and inputs a user name and a password to log in a management system; if the user does not register, the user needs to register before the next operation can be performed.
S1: receiving an application mirror image which needs to be created by a user, wherein the application mirror image comprises mirror image configuration information; for example, when a user needs to create a blockchain application, the user needs to select corresponding mirror image configuration information at this time, where the mirror image configuration information includes mirror image name information, and information such as a development environment and a development template corresponding to the name information; as shown in fig. 8, it is a typical service application scenario.
S2: pulling cluster resource information according to the mirror image configuration information; that is, resources such as development environment and development template are pulled out for subsequent judgment and use.
S3: judging whether the current user is a new user, if so, performing resource charging and applying corresponding cluster resource information for the user, wherein the resource charging is specifically a resource with the highest cost performance obtained by calculation; and if not, acquiring the created cluster resource information for the user. The resource with the highest price ratio in the embodiment also means the resource with the highest price ratio, namely the resource with the lowest profit of a single POD. Pod is the fundamental unit of a kubernets system, is the smallest component created or deployed by a user, and is also a resource object for running a capacitive application on the kubernets system. And in the resource charging, different resources are subjected to weight configuration, and when the resources with the same cost of performance are obtained through calculation, the resources with higher weight are selected as scheduling resources.
Specifically, as shown in fig. 3, in terms of design, the PaaS unified scheduling system is located in the meizhou environment, and the PaaS platform is built in a public cloud virtual machine environment. The method can be used for building a pispro PaaS or a pispro PaaS + k8s mode in a public cloud environment, and k8s is used as a supplement of the pispro PaaS capability. The PaaS unified scheduling management system is responsible for managing a plurality of cluster resources and mainly comprises resource unified management, safety unified management, application unified management and unified monitoring management.
And multi-VDC access is realized by applying multiple VMs or a k8s cluster (one VDC forms a k8s cluster) to a third-party public cloud provider and then registering the multi-VDC access in the PaaS unified scheduling management system. Differentiation of VDC: a unique domain name is assigned to the VDC during access, and the PaaS unified scheduling management system assigns the VDC by accessing the domain name. For example, in the current three VDC access scheduling systems, i.e., ari, baidu, and hua, names xxx.
Charging management and cluster management: the billing management is to calculate the optimal VDC through cost calculation and then complete the scheduling of the application VDC through cluster management.
Description of the drawings: the data in the table is only for convenience of calculation explanation, and the filled data has no practical meaning.
And (3) calculating the cost: VDC-C is shown in Table 1 as an example. The VM of 1 core 2G is applied for 300 per month in a third-party public cloud, the cost of running each POD by 20 PODs can be supported by the VM of 300 per month, each POD is priced to be 17, and the profit sum of all types of PODs of VDC-C is 2 by statistics. The profit sums for VDC-A, VDC-B were calculated to be 7, 8, respectively.
VDC scheduling: the dispatching of the VDC needs to use the result of cost calculation, an optimal cost performance PaaS cluster is selected from the VDC meeting the requirements of users, and the high weight is preferentially selected under the condition of the same cost performance; namely, when the cost performance ratio of VDC-A and VDC-B is the same, the weight of VDC-A is 3 and is larger than that of VDC-B, so that VDC-A is selected as the resource of the current scheduling.
TABLE 1
S4: and judging whether the balance of the user account meets the requirement of the creation, if so, creating and configuring corresponding application for the user.
As shown in fig. 4, the scheduling management system in this embodiment is deployed in a virtual machine in the meizhou environment, and has the following characteristics:
1. all the microservice components are deployed in a mirror image mode and are deployed in a k8s cluster container.
2. All microservice components are deployed in a highly available manner.
3. And performing directional agent and domain name resolution by adopting nginx.
4. Stateless business services employ local storage.
5. The data needing persistence, such as a database, a cache database, a message queue and the like, are stored in a distributed mode.
As shown in fig. 5, the cluster management module in this embodiment provides resource management of multiple clusters, and mainly includes: a. registering different clusters; b. the status of the cluster; c. cluster resource usage; d. cluster allocation locations; e. container status within the cluster; f. starting and stopping the cluster container. The charging management module in this embodiment charges a customer for different virtual machines and container configuration packages, and mainly includes: a. managing different cloud resource service packages; b. collecting and managing resource usage; c. managing prices of different cloud resources; d. and managing different cloud resource charging models.
As shown in fig. 7, the functional components of the PaaS system function as much as possible in the manner of a docker container. All the components are pushed to a mirror image warehouse after mirror images are released, new tags are added, and the management system and the PaaS cluster update the mirror images and the versions as required.
As shown in fig. 6, the resource scheduling management system in this embodiment, that is, the PaaS scheduling management system, mainly provides multi-cluster management, cost calculation, CI/CD function, monitoring and early warning function, charging function, application orchestration, container management function, and mirror image management, and the client container operating environment is based on a K8S and a pispoer public cloud environment.
The microservice referred to in this embodiment is an architectural style, with a large complex software application consisting of one or more microservices. Each microservice in the system can be deployed independently, with a loose coupling between each microservice. Compared with the previous single service, the single service is roughly shown in fig. 2, wherein the single service adopted before is arranged on the left side of the figure, and the micro service after being split is arranged on the right side of the figure.
The spring cluster is a mainstream micro-service framework and is used for providing service registration and discovery, centralized configuration, load balancing, breakers and routing (gateways), development efficiency is greatly improved, and development cost is reduced.
The micro service components are deployed in a mirror image mode and are deployed into a k8s cluster container, and all the micro service components are pushed to a mirror image warehouse after being issued by mirror images. The mirror repository uses the Role Based Access Control (RBAC) mechanism for hierarchical rights management. All micro-service components are deployed in a high-availability mode, and nginx is adopted for directional agent and domain name resolution.
In the resource scheduling management system, each micro service can only access the database of the micro service, but cannot access the databases of other services; the cluster is deployed in the public cloud and the private cloud in the same mode and mirror images, the configuration files are adapted according to the environment, and if the private cloud cannot access the public network, the warehouse docker mirror images are exported and manually imported into the virtual machine.
The mode of this embodiment has the following advantages: 1. a unified API gateway is adopted for an external unique inlet, similar to a facade mode, and the method can be used for uniformly controlling non-service functions such as safety, monitoring and current limiting and exposing a unified interface specification to the outside.
2. All micro-service components are deployed in a highly available mode, and the stability of service is ensured.
3. Data decentralization, each micro service has own private database persistent service data, each micro service can only access own database but not other service databases, and under some service scenes, a plurality of databases need to be updated in one transaction. This case also does not have direct access to the databases of other microservices, but by operating on the microservices.
Example two
The second embodiment discloses an electronic device, which comprises a processor, a memory and a program, wherein the processor and the memory can adopt one or more programs, the program is stored in the memory and configured to be executed by the processor, and when the processor executes the program, the scheduling management method of the resource of the first embodiment is realized. EXAMPLE III
The third embodiment discloses a computer-readable storage medium, which is used for storing a program, and when the program is executed by a processor, the method for scheduling and managing resources in the first embodiment is implemented.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling an electronic device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the content-based update notification apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.