CN114489720A - Service deployment method, device, storage medium and equipment based on cluster - Google Patents

Service deployment method, device, storage medium and equipment based on cluster Download PDF

Info

Publication number
CN114489720A
CN114489720A CN202111660254.2A CN202111660254A CN114489720A CN 114489720 A CN114489720 A CN 114489720A CN 202111660254 A CN202111660254 A CN 202111660254A CN 114489720 A CN114489720 A CN 114489720A
Authority
CN
China
Prior art keywords
configuration
node
cluster
configuration data
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111660254.2A
Other languages
Chinese (zh)
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.)
Yidu Cloud Beijing Technology Co Ltd
Original Assignee
Yidu Cloud Beijing 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 Yidu Cloud Beijing Technology Co Ltd filed Critical Yidu Cloud Beijing Technology Co Ltd
Priority to CN202111660254.2A priority Critical patent/CN114489720A/en
Publication of CN114489720A publication Critical patent/CN114489720A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The method arranges each service into multi-level configuration data aiming at the configuration of different clusters under different scenes, wherein the multi-level configuration data comprise at least two levels of hierarchical structures, a configuration item set by each child node covers a corresponding configuration item of a parent node, a configuration item not set by each child node inherits the corresponding configuration item of the parent node, and a configuration item of a corresponding cluster is set by a last-level node. When each service needs to be deployed to a certain cluster, according to the multi-level configuration data and the inheritance relationship among the configuration items, a set of complete configuration information specially aiming at the cluster under a specific scene can be generated, the maintenance amount of the data is greatly reduced, and the correctness of the data is easier to ensure.

Description

Service deployment method, device, storage medium and equipment based on cluster
Technical Field
The present application relates to the field of computer software deployment, and in particular, to a method, an apparatus, a storage medium, and a device for deploying a service based on a cluster.
Background
When services are deployed in private clouds built for small clusters taking enterprises and public institutions as units, on one hand, product services need to be deployed in each private cloud in an off-line mode, so that the services provide independent services for the private clouds, and private data are guaranteed not to be leaked out of the private clouds; on the other hand, because the cluster difference of each enterprise and public institution is large, the uniform service configuration cannot be used for deployment. In this case, a separate set of configuration files containing all configuration information is usually provided for each service of each cluster to accommodate the differences between different clusters.
However, as the number of services to be deployed and the number of clusters to which services need to be deployed increase, the configuration files that need to be created and maintained may multiply. Especially, when some general basic configuration items are updated, the configuration file of each service in each cluster needs to be modified one by one, so that the maintenance work becomes extremely heavy and is very easy to make mistakes.
Disclosure of Invention
In order to solve the above problems in deploying different services in a plurality of different small clusters, embodiments of the present application provide a method, an apparatus, a storage medium, a device method, an apparatus, and a computer-readable storage medium for deploying services based on a cluster.
According to a first aspect of an embodiment of the present application, a method for deploying a service based on a cluster is provided, where the method includes: acquiring multi-level configuration data of a first service for different clusters, wherein the multi-level configuration data comprises nodes with at least two levels of hierarchical structures, the relationship between upper and lower nodes is the inheritance relationship between a parent node and a child node, the multi-level configuration data comprises at least two configuration items, the configuration item set by each child node covers the corresponding configuration item of the parent node, the configuration item not set by each child node inherits the corresponding configuration item of the parent node, and the configuration item of the corresponding cluster is set by a last-level node; determining all configuration items of a first service aiming at a first cluster according to the multi-level configuration data to obtain first configuration data; a first service is deployed to a first cluster according to first configuration data.
According to an embodiment of the present application, the method further comprises: and establishing multi-level configuration data aiming at different clusters for the first service to obtain first multi-level configuration data.
According to an embodiment of the present application, the method further comprises: storing the first multi-level configuration data into a first configuration library corresponding to the first service; accordingly, obtaining multi-level configuration data of a first service for different clusters includes: and acquiring multi-level configuration data of the first service aiming at different clusters from the first configuration library.
According to an embodiment of the present application, determining all configuration items of a first service for a first cluster according to multi-hierarchy configuration data to obtain first configuration data includes: acquiring configuration items stored by the first-level nodes according to the multi-level configuration data to obtain second configuration data; determining a first path from the first-level node to a node corresponding to the first cluster according to the first cluster; and sequentially acquiring the configuration items of each node on the first path, and covering the corresponding data items in the second configuration data according to the configuration items of each node to obtain first configuration data.
According to an embodiment of the present application, determining, according to a first cluster, a first path from a level one node to a node corresponding to the first cluster includes: according to the first cluster, a first path from a level one node to a node corresponding to the first cluster is determined in order from a last level node to the level one node.
According to an embodiment of the present application, the method further comprises: determining a node where a configuration item to be updated is located in the multi-level configuration data to obtain a first node; and updating the corresponding configuration item on the first node according to the configuration item to be updated.
According to an embodiment of the application, the multi-level configuration data further includes nodes for different scenes, and accordingly, the last-level node is provided with configuration items of corresponding clusters in corresponding scenes; correspondingly, according to the multi-hierarchy configuration data, determining all configuration items of the first service for the first cluster, and obtaining first configuration data, including: according to the multi-level configuration data, all configuration items of the first service in the first scene aiming at the first cluster are determined, and first configuration data are obtained.
According to a second aspect of the embodiments of the present application, there is further provided an apparatus for deploying a service based on a cluster, the apparatus including: the multi-level configuration data acquisition module is used for acquiring multi-level configuration data of a first service aiming at different clusters, the multi-level configuration data comprises nodes with at least two levels of hierarchical structures, the relationship between upper and lower nodes is the inheritance relationship between a parent node and a child node, the multi-level configuration data comprises at least two configuration items, wherein the configuration item set by each child node covers the corresponding configuration item of the parent node, the configuration item not set by each child node inherits the corresponding configuration item of the parent node, and the configuration item of the corresponding cluster is set by the last level node; the cluster configuration data determining module is used for determining all configuration items of the first service aiming at the first cluster according to the multi-level configuration data to obtain first configuration data; and the service deployment module is used for deploying the first service to the first cluster according to the first configuration data.
According to a third aspect of the embodiments of the present application, a system for deploying services based on clusters is further provided, where the system includes a code warehouse, a deployment center, and at least one cluster, where the code warehouse is configured to store multi-level configuration data of a first service for different clusters, the multi-level configuration data includes nodes of at least two levels of hierarchical structures, a relationship between a higher level node and a lower level node is an inheritance relationship between a parent node and a child node, a configuration item set by each child node covers a corresponding configuration item of the parent node, a configuration item not set by each child node inherits a corresponding configuration item of the parent node, and a configuration item of a corresponding cluster is set by the last level node; the deployment center is used for executing the method for deploying the service based on the cluster, and deploying the first service to one cluster in at least one cluster.
According to a fourth aspect of embodiments herein, there is also provided a computer device, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize any one of the above methods for deploying the service based on the cluster.
According to a fifth aspect of embodiments of the present application, there is further provided a computer-readable storage medium, on which a computer program is stored, where the computer program is configured to, when executed by a processor, implement any one of the above methods for deploying a service based on a cluster.
The embodiment of the application provides a method, a device, a storage medium and equipment for deploying services based on a cluster. The method arranges the configuration of each service aiming at different clusters into multi-level configuration data, wherein the multi-level configuration data comprises nodes with at least two levels of hierarchical structures, the relationship between upper and lower nodes is the inheritance relationship between a father node and a son node, the multi-level configuration data comprises at least two configuration items, the configuration item set by each son node covers the corresponding configuration item of the father node, the configuration item not set by each son node inherits the corresponding configuration item of the father node, and the configuration item of the corresponding cluster is set by the last level node. When each service needs to be deployed to a specific cluster, a set of complete configuration information specific to the cluster can be generated according to the multi-level configuration data and the inheritance relationship among the configuration items. Therefore, at the node corresponding to each cluster, only the specific configuration information of the node needs to be stored, and other general configuration information can be inherited from the father node, so that the data maintenance amount is greatly reduced, and the data correctness is easier to ensure.
It is to be understood that the teachings of this application need not achieve all of the above advantages, but rather that specific embodiments may achieve specific technical effects, and that other embodiments of this application may achieve other advantages not mentioned above.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Fig. 1 is a schematic diagram illustrating an implementation flow of a method for implementing a service deployment based on a cluster according to an embodiment of the present application;
FIG. 2 is a block diagram illustrating a multi-level configuration data according to an embodiment of the present application;
FIG. 3 is a schematic flow chart illustrating the creation of multi-level configuration data according to an embodiment of the present application;
fig. 4 is a schematic implementation flow diagram of a method for implementing a service deployment based on a cluster according to another embodiment of the present application;
fig. 5 is a schematic implementation flow diagram of a method for implementing a service deployment based on a cluster according to another embodiment of the present application;
fig. 6 is a schematic diagram of a structure of a device for deploying a service based on a cluster according to an embodiment of the present application.
Detailed Description
The principles and spirit of the present application will be described with reference to a number of exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and to implement the present application, and do not limit the scope of the present application in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The technical solution of the present application is further elaborated below with reference to the drawings and the specific embodiments.
Fig. 1 shows a main flow of a method for implementing service deployment based on a cluster according to an embodiment of the present application. Referring to fig. 1, a method for deploying a service based on a cluster in an embodiment of the present application at least includes the following operation flows: operation 110, acquiring multi-level configuration data of the first service for different clusters, where the multi-level configuration data includes at least two configuration items, the multi-level configuration data includes nodes of at least two-level hierarchical structures, and a relationship between an upper level node and a lower level node is an inheritance relationship between a parent node and a child node, where a configuration item set by each child node covers a corresponding configuration item of the parent node, a configuration item not set by each child node inherits a corresponding configuration item of the parent node, and a configuration item of a corresponding cluster is set by the last level node; operation 120, determining all configuration items of the first service for the first cluster according to the multi-level configuration data, to obtain first configuration data; at operation 130, a first service is deployed to the first cluster according to the first configuration data.
Wherein, in operation 110, the first service is a network application service providing a specific function through an application program or other forms, for example, an authentication service, a card punching service, a conference service, and so on.
Cluster (Cluster), also known as a Cluster server, refers to a server architecture that combines the resources of multiple servers together to provide highly available, efficient computation and efficient storage. The cluster may be treated as a single server when the first service is deployed.
In the embodiment of the present application, the first service may be applicable to different clusters, but a plurality of clusters to be deployed by the first service generally have different computing capacities, the number of servers constituting each cluster is different, and the hardware condition of each server is also different.
Therefore, when the first service is deployed to different clusters, different deployment parameters are specified, such as the maximum number of running instances, the maximum capacity of content planning, and the like, due to the difference in the size (the number of servers constituting each cluster) and the difference in the computing power of each cluster. Therefore, the computing capacity of each cluster is fully utilized, and the first service is set to obtain better running performance when running in different clusters.
In view of the above situation, the embodiments of the present application use multi-level configuration data to set multi-level configuration data of a first service for different clusters. The multi-hierarchy configuration data includes at least two configuration items, each configuration item is a key-value pair of a deployment parameter and a value thereof that need to be specified for deploying the first service, for example, "instances": 1 (maximum number representing run instance is 1). The multi-level configuration data comprises nodes with at least two levels of hierarchical structures, the relationship between upper and lower nodes is the inheritance relationship between a father node and a child node, wherein a configuration item set by each child node covers a corresponding configuration item of the father node, a configuration item not set by each child node inherits a corresponding configuration item of the father node, a configuration item of a corresponding cluster is set by a final-stage node, and the final-stage node refers to a node without a child node.
Fig. 2 illustrates a structure of multi-hierarchy configuration data of a first service for different clusters according to an embodiment of the present application. Referring to fig. 2, the multi-level configuration data may adopt a tree structure including nodes of a 4-level hierarchy: a root node 20; cluster type nodes (e.g., cluster type 201 and cluster type 202); cluster subtype nodes (e.g., cluster subtype 2011, cluster subtype 2012); cluster nodes (e.g., cluster 2021, cluster 2022, cluster 20111, cluster 20112, cluster 20121, and cluster 20122). The cluster 2021 does not have cluster subtypes, and its child nodes may be clusters.
Wherein, the root node 20 is a first-level node, i.e. a node without a father node; the cluster type node is a secondary node, namely a child node of the primary node; the cluster subtype node is a third-level node, namely a child node of the second-level node; the cluster node is the final node and is also a leaf node of the tree structure.
The configuration items of the root node 20 may be set as all deployment parameters and default values thereof required for deploying the first service, or may be set as deployment parameters and common values applicable to most clusters.
Configuration items which are different from other cluster types are arranged in the cluster type nodes, and the configuration items are universal configuration items for each cluster subtype in the corresponding cluster type.
The cluster subtype nodes are provided with configuration items of which the corresponding cluster subtype is different from other cluster subtypes, and the configuration items are universal configuration items for each cluster in the corresponding cluster subtype.
The cluster nodes are provided with configuration items of which the corresponding clusters are different from other clusters.
In this way, the general configuration items of each child node in the current level can be placed in the parent node of the previous level, and each child node in the current level only needs to place the configuration items different from those of other child nodes. When the general configuration item needs to be modified, each child node can naturally inherit to the modified general configuration item only by modifying the configuration item in the parent node. Therefore, redundant data among the child nodes can be removed to the maximum extent, and the data maintenance amount can be greatly reduced.
When the multi-level configuration data of the first service aiming at different clusters are obtained, the multi-level configuration data can be directly obtained from the data storage system in which the multi-level configuration data are stored, so that the real-time processing time can be shortened, and the response is faster; the required data can be acquired from a data storage system which stores data such as each node of the multi-level configuration data, configuration data items corresponding to each node, inheritance relations of each node and the like, and the multi-level configuration data aiming at different clusters can be generated in real time, so that the requirement on the data storage system is lower.
In operation 120, the first configuration data refers to all configuration items for deploying the first service to the first cluster, i.e., all deployment parameters and values thereof required for deploying the first service to the first cluster.
As described above, the first cluster generally corresponds to a leaf node, and the first configuration data can be determined according to the configuration item set on the leaf node, the configuration item set on the parent node, and the configuration items set on ancestor nodes at each level obtained by recursion.
Taking the multi-level configuration data shown in fig. 2 as an example, determining all configuration items of the first service for the first cluster according to the multi-level configuration data to obtain the first configuration data may be implemented by the process shown in fig. 3, where the process mainly includes:
step 310, acquiring configuration items stored by a root node according to the multi-level configuration data to obtain second configuration data;
step 320, according to the first cluster, determining a first path from the root node to a node corresponding to the first cluster;
assuming that the first cluster is cluster 2021, the first path is the path from root node 20 to cluster 2021: root node 20-cluster type 202-cluster 2021.
And step 330, sequentially acquiring a configuration item of each node on the first path, and covering a corresponding data item in the second configuration data according to the configuration item of each node to obtain first configuration data.
In the process, the configuration item set by each child node covers the corresponding configuration item of the parent node, the configuration item not set by each child node inherits the corresponding configuration item of the parent node, and after the configuration items of the leaf nodes are processed in the sequence from the root node to the leaf nodes, all the configuration items of the cluster corresponding to the leaf nodes (namely, the first cluster) are obtained.
After the first configuration data is determined, all deployment parameters needed to deploy the first service to the first cluster for the first scenario are determined, and the first service may be deployed to the first cluster through operation 130.
Therefore, the method for deploying services based on clusters, which is provided in the embodiment of the present application, arranges the configurations of the services for different clusters into multi-level configuration data, where the multi-level configuration data includes nodes with at least two levels of hierarchical structures, a relationship between upper and lower nodes is an inheritance relationship between a parent node and a child node, the multi-level configuration data includes at least two configuration items, a configuration item set by each child node covers a corresponding configuration item of the parent node, a configuration item not set by each child node inherits a corresponding configuration item of the parent node, and a leaf node is provided with a configuration item of a corresponding cluster. When each service needs to be deployed to a specific cluster, a set of complete configuration information specific to the cluster can be generated according to the multi-level configuration data and the inheritance relationship between configuration items. Therefore, at the node corresponding to each cluster, only the specific configuration information of the node needs to be stored, and other general configuration information can be inherited from the father node, so that the data maintenance amount is greatly reduced, and the data correctness is easier to ensure.
In the embodiment of the present application, the multi-level configuration data is created in advance through the following processes:
creating a root node, and setting all deployment parameters and default values thereof required by the first service, or deployment parameters and universal values applicable to most clusters as configuration items of the root node;
creating cluster type nodes under the root node, setting configuration items of the cluster types different from other cluster types as configuration items of the corresponding cluster type nodes, and directly creating the cluster nodes if no cluster type node exists;
under the cluster type node, a cluster subtype node is created, a configuration item of which the cluster subtype is different from other cluster subtypes is set as a configuration item of the corresponding cluster subtype node, and if no cluster subtype exists, the cluster node is directly created;
under the cluster subtype node, a cluster node is created, and a configuration item of the cluster, which is different from other clusters, is set as a configuration item of the corresponding cluster node.
Thus, multi-level configuration data of the first service aiming at different clusters can be obtained.
After the multi-level configuration data is created, it can also be stored in the configuration library. Therefore, when the multi-level configuration data of the first service aiming at different clusters is obtained, the multi-level configuration data can be directly obtained from the configuration library.
If a modification to the value of a particular generic configuration item in a particular hierarchy is required, the update can be made by: determining a node where a configuration item to be updated is located in the multi-level configuration data to obtain a first node; and updating the corresponding configuration item on the first node according to the configuration item to be updated.
When the node where the configuration item to be updated is located in the multi-level configuration data is determined, the multi-level configuration data can be queried through keywords, and the configuration item matched with the multi-level configuration data and the node where the matched configuration item is located are found; the node where the configuration item to be updated is located in the multi-level configuration data can also be determined according to the specified node path.
Therefore, when some common configuration items are changed, the configuration items in each cluster configuration data do not need to be modified, and only the configuration items in the corresponding nodes need to be modified.
FIG. 4 illustrates a method for implementing cluster-based deployment of services according to another embodiment of the present application. In the embodiment of the present application shown in fig. 4, a code repository is used as a configuration repository, and multiple levels of configuration data of multiple services for different clusters, such as service 1, service 2, and service 3, are stored in the code repository; the deployment center is responsible for acquiring configuration data required by each deployment and constructing complete deployment configuration; in one deployment, multiple services may be deployed together into a designated cluster.
In the embodiment of the present application, in order to facilitate management of multi-level configuration data of each service, a separate code library, such as a service 1 code library, a service 2 code library, and a service 3 code library, is created in the code repository for each service.
After creating multi-tier configuration data for different clusters for each service, the multi-tier configuration data corresponding to each service is stored in a code base corresponding to the corresponding service. For example, storing the tree configuration structure corresponding to the service 1 into the service 1 code base; storing the tree configuration structure corresponding to the service 2 into a service 2 code base; and storing the tree configuration structure corresponding to the service 3 into the service 3 code base. In this way, it is convenient to manage the multi-level configuration data of each service individually, avoid the interference of the multi-level configuration data among the services, and especially when the multi-level configuration data is maintained by different developers or business parts, the embodiment also facilitates data isolation and rights management.
In addition, the multi-level configuration data corresponding to each service is stored into the code base corresponding to the corresponding service, the multi-level configuration data corresponding to the corresponding service can be rapidly positioned, and the operation of inquiring the multi-level configuration data is faster than the operation of storing the multi-level configuration data of all the services into the same code base.
Assuming that the deployment is to deploy the service 1, the service 2, and the service 3 on the cluster X, after receiving a corresponding deployment instruction, the deployment center will obtain a deployment configuration of the corresponding service for the cluster X from the code library. For example, the deployment configuration of the service 1 for the cluster X is obtained from the service 1 code library; acquiring the deployment configuration of the service 2 for the cluster X from a service 2 code library; the deployment configuration of the service 3 for the cluster X is obtained from the service 3 code base.
Then, the deployment configurations of the service 1, the service 2 and the service 3 for the cluster X are merged to obtain complete configuration information of the current deployment.
Subsequently, deploying the service 1 on the cluster X according to the deployment configuration of the service 1 for the cluster X; deploying the service 2 on the cluster X according to the deployment configuration of the service 2 for the cluster X; service 3 is deployed on cluster X according to the deployment configuration of service 3 for cluster X.
In the process, when the deployment configuration of different services for the X cluster is obtained, the deployment configuration can be executed in parallel; the process of deploying the respective services on cluster X according to the deployment configuration of each service for cluster X may also be parallel. As such, efficient deployment of multiple services may also be achieved.
Fig. 5 shows a tree configuration structure of another embodiment of the present application. In the embodiment of the present application, the first service may be applied to different scenarios, and in a specific scenario, even if the sizes and the computing capabilities of the respective clusters are different, the specific deployment parameters may be set to the same values. For example, in a test scenario, in order to ensure that a user can operate all functions normally in a basic application scenario and provide a positioning basis for other problems, the running instance is usually limited to 1, so as to eliminate the problems caused by multiple instances.
For this reason, in the multi-hierarchy configuration data in the embodiment of the present application, nodes for different scenarios are also included, for example, "test custom configuration" for a test scenario. Correspondingly, the leaf node is provided with a configuration item of the corresponding cluster in the corresponding scene, such as a cluster a test configuration. Correspondingly, when determining all configuration items of the first service for the first cluster according to the multi-hierarchy configuration data to obtain the first configuration data, the method includes: according to the multi-level configuration data, all configuration items of the first service in the first scene aiming at the first cluster are determined, and first configuration data are obtained.
The deployment parameters required for deploying the first service to the cluster are assumed to include "cpus", "mem", "instances", and "task _ confluency"; the cluster that is available for deployment includes: "Cluster A", "Cluster B", and "Cluster C"; the applied scenario includes a test scenario or a production scenario. The first service is used for configuring data of multiple hierarchies aiming at different clusters and different application scenes, and comprises nodes of three hierarchies: a root configuration node (e.g., a base full configuration), an application scenario node (e.g., a test custom configuration and a production custom configuration), and a cluster configuration node under a corresponding scenario (e.g., a cluster a test configuration, a cluster B test configuration, a cluster a production configuration, and a cluster C production configuration).
Assuming that a first cluster to be deployed is a "cluster a" and an application scenario to be deployed is a "test scenario", configuration items on nodes of "basic complete configuration" - "test customized configuration" - "cluster a test configuration" are obtained one by one, so that a configuration item set by each child node covers a corresponding configuration item of a parent node, and a configuration item unconfigured by each child node inherits the corresponding configuration item of the parent node, thereby obtaining all deployment parameters required for deploying a first service to the cluster a and applying the first service to the test scenario.
For example, get the basic full configuration: "cpus": 0.4; "mem": 4096; "intermediates": 1.
after that, the configuration of the "test custom configuration" is obtained, and since the "test custom configuration" does not set any configuration, all the basic complete configurations are inherited.
Subsequently, the configuration data of the node of the "cluster a test configuration" is acquired, and the task _ consturcency "set on the node is used: "6"; "cpus": 0.8 covers "task _ consistency" and "cpus" in the basic complete configuration, and all deployment parameters required for deploying the first service to the cluster a in the test scene can be obtained: "cpus": 0.8; "mem": 4096; "intermediates": 1; "task _ consorrence": "6".
After the configuration data is obtained, the first service may be deployed to the first cluster, so that the first service is applied to the test scenario.
By the method for deploying the service based on the clusters, the deployment parameters can be determined according to the clusters, the deployment parameters of different clusters in different application scenes can be acquired by combining various application scenes, and the method is wide in application range.
It should be noted that the multi-level configuration data can be implemented by any suitable tree data structure, especially the inheritance tree data structure of some programming languages. Any suitable tree-based data structure traversal, recursion, and query algorithms may be used in implementing the operations of the above-described method, as long as the corresponding functionality is achieved.
Similarly, based on the above method for deploying a service based on a cluster, an embodiment of the present application further provides a device for deploying a service based on a cluster, as shown in fig. 6, where the device 60 includes: a multi-level configuration data obtaining module 601, configured to obtain multi-level configuration data of a first service for different clusters, where the multi-level configuration data includes nodes of at least two levels of hierarchical structures, a relationship between a parent node and a child node is an inheritance relationship between a top-level node and a bottom-level node, the multi-level configuration data includes at least two configuration items, a configuration item set by each child node covers a corresponding configuration item of the parent node, a configuration item not set by each child node inherits a corresponding configuration item of the parent node, and a configuration item of a corresponding cluster is set by a last-level node; a cluster configuration data determining module 602, configured to determine, according to the multi-level configuration data, all configuration items of the first service for the first cluster, to obtain first configuration data; the service deployment module 603 is configured to deploy the first service to the first cluster according to the first configuration data.
According to an embodiment of the present application, the apparatus 60 further comprises: the multi-level configuration data creating module is used for creating multi-level configuration data aiming at different clusters for the first service to obtain first multi-level configuration data.
According to an embodiment of the present application, the apparatus 60 further comprises: the multi-hierarchy configuration data storage module is used for storing the first multi-hierarchy configuration data into a first configuration library corresponding to the first service; accordingly, the multi-tier configuration data obtaining module 601 is specifically configured to obtain, from the first configuration library, multi-tier configuration data of the first service for different clusters.
According to an embodiment of the present application, the cluster configuration data determining module 602 includes: the primary node configuration acquisition module is used for acquiring configuration items stored by the primary nodes according to the multi-level configuration data to obtain second configuration data; the cluster path determining module is used for determining a first path from the first-level node to a node corresponding to the first cluster according to the first cluster; and the configuration item covering module is used for sequentially acquiring the configuration items of each node on the first path, and covering the corresponding data items in the second configuration data according to the configuration items of each node to obtain the first configuration data.
According to an embodiment of the present application, the cluster path determining module is specifically configured to determine, according to the first cluster, a first path from a level node to a node corresponding to the first cluster in an order from a last level node to the level node.
According to an embodiment of the present application, the apparatus 60 further comprises: the node to be updated determining module is used for determining a node where the configuration item to be updated is located in the multi-level configuration data to obtain a first node; and the configuration item updating module is used for updating the corresponding configuration item on the first node according to the configuration item to be updated.
According to an embodiment of the application, the multi-level configuration data further includes nodes for different scenes, and accordingly, the last-level node is provided with configuration items of corresponding clusters in corresponding scenes; correspondingly, the cluster configuration data determining module 602 is specifically configured to determine, according to the multi-level configuration data, all configuration items of the first service in the first scenario for the first cluster, so as to obtain the first configuration data.
Similarly, based on the method for deploying the service based on the cluster, the embodiment of the present application further provides a system for deploying the service based on the cluster, as shown in fig. 4, the system includes a code repository, a deployment center, and at least one cluster (cluster X), where the code repository is configured to store multi-level configuration data of a first service (e.g., service 1, service 2, and service 3) for different clusters, the multi-level configuration data includes nodes of at least two levels of hierarchical structures, a relationship between a higher level node and a lower level node is an inheritance relationship between a parent node and a child node, where a configuration item set by each child node covers a corresponding configuration item of the parent node, a configuration item not set by each child node inherits a corresponding configuration item of the parent node, and a configuration item of a corresponding cluster is set by the last level node; and the deployment center is used for executing the method for deploying the service based on the cluster, and deploying the first service to one cluster (cluster X) in at least one cluster.
Similarly, based on the method for deploying the service based on the cluster, the embodiment of the present application further provides a computer device, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize any one of the above methods for deploying services based on clusters.
Similarly, based on the method for deploying the service based on the cluster, an embodiment of the present application further provides a computer-readable storage medium, where a program is stored, and when the program is executed by a processor, the processor is enabled to execute at least any one of the above methods for deploying the service based on the cluster.
Here, it should be noted that: the above description on the embodiment of the apparatus for deploying services based on a cluster, the above description on the embodiment of the computer device, and the above description on the embodiment of the computer-readable storage medium are similar to the descriptions on the foregoing method embodiments, and have similar beneficial effects to the method embodiments, and therefore, no further description is given. For technical details that are not disclosed in the embodiment of the display device for configuration information of the present application, please refer to the description of the foregoing method embodiment of the present application for understanding, and therefore, for brevity, will not be described again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of a unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof that contribute to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method for deploying services based on clusters, the method comprising:
acquiring multi-level configuration data of a first service aiming at different clusters, wherein the multi-level configuration data comprises at least two configuration items, the multi-level configuration data comprises nodes with at least two levels of hierarchical structures, the relationship between upper and lower nodes is the inheritance relationship between a parent node and a child node, the configuration item set by each child node covers the corresponding configuration item of the parent node, the configuration item not set by each child node inherits the corresponding configuration item of the parent node, and the configuration item of the corresponding cluster is set by the last node;
determining all configuration items of the first service aiming at a first cluster according to the multi-level configuration data to obtain first configuration data;
deploying the first service to the first cluster according to the first configuration data.
2. The method of claim 1, further comprising:
and establishing multi-level configuration data aiming at different clusters for the first service to obtain first multi-level configuration data.
3. The method of claim 2, further comprising:
storing the first multi-level configuration data in a first configuration library corresponding to the first service;
accordingly, the obtaining the multi-hierarchy configuration data of the first service for different clusters includes:
and acquiring multi-level configuration data of a first service aiming at different clusters from the first configuration library.
4. The method of claim 1, wherein the determining all configuration items of the first service for the first cluster according to the multi-hierarchy configuration data, resulting in first configuration data, comprises:
acquiring configuration items stored by the first-level nodes according to the multi-level configuration data to obtain second configuration data;
determining a first path from the level one node to a node corresponding to the first cluster according to the first cluster;
and sequentially acquiring the configuration items of each node on the first path, and covering the corresponding data items in the second configuration data according to the configuration items of each node to obtain first configuration data.
5. The method of claim 4, wherein determining a first path from the primary node to a node corresponding to the first cluster according to the first cluster comprises:
according to the first cluster, determining a first path from a last-level node to a first-level node in the order from the first-level node to a node corresponding to the first cluster.
6. The method of claim 1, further comprising:
determining a node where a configuration item to be updated is located in the multi-level configuration data to obtain a first node;
and updating the corresponding configuration item on the first node according to the configuration item to be updated.
7. The method of claim 1, wherein the multi-level configuration data further comprises nodes for different scenarios,
correspondingly, the last-stage node is provided with configuration items of the corresponding cluster under the corresponding scene;
correspondingly, according to the multi-hierarchy configuration data, determining all configuration items of the first service for the first cluster, and obtaining first configuration data comprises:
and determining all configuration items of the first service in a first scene aiming at the first cluster according to the multi-level configuration data to obtain first configuration data.
8. An apparatus for deploying a service based on a cluster, the apparatus comprising:
the multi-level configuration data acquisition module is used for acquiring multi-level configuration data of a first service aiming at different clusters, the multi-level configuration data comprises nodes with at least two levels of hierarchical structures, the relationship between upper and lower nodes is the inheritance relationship between a parent node and a child node, the multi-level configuration data comprises at least two configuration items, wherein the configuration item set by each child node covers the corresponding configuration item of the parent node, the configuration item not set by each child node inherits the corresponding configuration item of the parent node, and the configuration item of the corresponding cluster is set by the last level node;
the cluster configuration data determining module is used for determining all configuration items of the first service aiming at the first cluster according to the multi-level configuration data to obtain first configuration data;
a service deployment module, configured to deploy the first service to the first cluster according to the first configuration data.
9. A system for deploying a service based on a cluster, the system comprising a code warehouse, a deployment center and at least one cluster, wherein,
the code warehouse is used for storing multi-level configuration data of a first service aiming at different clusters, the multi-level configuration data comprise nodes with at least two levels of hierarchical structures, the relationship between upper and lower level nodes is the inheritance relationship between a father node and a son node, wherein a configuration item set by each son node covers a corresponding configuration item of the father node, a configuration item not set by each son node inherits the corresponding configuration item of the father node, and a configuration item of a corresponding cluster is set by a last level node;
the deployment center configured to perform the method of any one of claims 1-7, deploying the first service to one of the at least one cluster.
10. A computer device, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the program.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202111660254.2A 2021-12-31 2021-12-31 Service deployment method, device, storage medium and equipment based on cluster Pending CN114489720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111660254.2A CN114489720A (en) 2021-12-31 2021-12-31 Service deployment method, device, storage medium and equipment based on cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111660254.2A CN114489720A (en) 2021-12-31 2021-12-31 Service deployment method, device, storage medium and equipment based on cluster

Publications (1)

Publication Number Publication Date
CN114489720A true CN114489720A (en) 2022-05-13

Family

ID=81507936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111660254.2A Pending CN114489720A (en) 2021-12-31 2021-12-31 Service deployment method, device, storage medium and equipment based on cluster

Country Status (1)

Country Link
CN (1) CN114489720A (en)

Similar Documents

Publication Publication Date Title
US20180365686A1 (en) Smart contract lifecycle management
US20080263082A1 (en) Recovery segment identification in a computing infrastructure
CN107430611B (en) Filtering data lineage graph
US10303450B2 (en) Systems and methods for a policy-driven orchestration of deployment of distributed applications
US8819672B2 (en) Multi-image migration system and method
US9274811B1 (en) System and method for cloud provisioning and application deployment
US20110320394A1 (en) Creation and Revision of Network Object Graph Topology for a Network Performance Management System
CN107251021B (en) Filtering data lineage graph
CN107783816A (en) The method and device that creation method and device, the big data cluster of virtual machine create
EP3867776A1 (en) System and method for auto-completion of ics flow using artificial intelligence/machine learning
WO2023098462A1 (en) Improving performance of sql execution sequence in production database instance
CN113448678A (en) Application information generation method, deployment method, device, system and storage medium
CN110622146B (en) Programmable synthesis mechanism for device factor graph
US10599544B2 (en) Determining reboot times of computing nodes
CN104391845B (en) A kind of method and device generating database script
US11221923B2 (en) Performing selective backup operations
WO2023056793A1 (en) Optimizing a just-in-time compilation process
AU2017276243A1 (en) System And Method For Generating Service Operation Implementation
US10956363B2 (en) Automated data management via machine-readable data definition files
US20230409710A1 (en) Allow list of container images based on deployment configuration at a container orchestration service
CN114489720A (en) Service deployment method, device, storage medium and equipment based on cluster
US8656410B1 (en) Conversion of lightweight object to a heavyweight object
US10657476B2 (en) Just in time compilation (JIT) for business process execution
CN113741868A (en) Business calculation task processing method and device, computer equipment and storage medium
US10095849B1 (en) Tag-based programming interface authentication

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