CN114489720B - A method, device, storage medium and equipment based on cluster deployment service - Google Patents

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

Info

Publication number
CN114489720B
CN114489720B CN202111660254.2A CN202111660254A CN114489720B CN 114489720 B CN114489720 B CN 114489720B CN 202111660254 A CN202111660254 A CN 202111660254A CN 114489720 B CN114489720 B CN 114489720B
Authority
CN
China
Prior art keywords
node
configuration
cluster
configuration data
service
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
CN202111660254.2A
Other languages
Chinese (zh)
Other versions
CN114489720A (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.)
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/CN114489720B/en
Publication of CN114489720A publication Critical patent/CN114489720A/en
Application granted granted Critical
Publication of CN114489720B publication Critical patent/CN114489720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种基于集群部署服务的方法、装置、存储介质及设备,该方法将各服务针对不同集群在不同场景下的配置,整理为多层级配置数据,其中,多层级配置数据包括至少两级层级结构,每一子节点设置的配置项覆盖父节点的相应配置项,每一子节点未设置的配置项继承父节点的相应配置项,末级节点设置有相应集群的配置项。当需要将各服务部署到某一集群时,根据该多层级配置数据以及配置项之间的继承关系,就可以生成一套专门针对该集群在特定场景下的完整配置信息,大大减少了数据的维护量,也更易于保证数据的正确性。

The present application discloses a method, apparatus, storage medium and device for cluster-based deployment of services. The method organizes the configuration of each service for different clusters in different scenarios into multi-level configuration data, wherein the multi-level configuration data includes at least two levels of hierarchical structure, the configuration items set by each child node cover the corresponding configuration items of the parent node, the configuration items not set by each child node inherit the corresponding configuration items of the parent node, and the last-level node is provided with the configuration items of the corresponding cluster. When it is necessary to deploy each service to a certain cluster, a set of complete configuration information specifically for the cluster in a specific scenario can be generated according to the multi-level configuration data and the inheritance relationship between the configuration items, which greatly reduces the amount of data maintenance and makes it easier to ensure the correctness of the data.

Description

Method, device, storage medium and equipment for deploying service 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 services based on clusters.
Background
When a service is deployed in a private cloud built for a small cluster taking enterprises and institutions as units, on one hand, the service needs to be deployed in each private cloud offline, so that the service provides independent service for the service and ensures that private data cannot leak out of the private cloud, and on the other hand, the service cannot be deployed by using uniform service configuration due to large cluster difference of each enterprise and institution. At this time, a set of configuration files containing all configuration information is typically provided separately for each service of each cluster, so as to accommodate various differences between different clusters.
However, as the number of services to be deployed and the number of clusters to which the services are to be deployed continue to grow, the configuration files that need to be built and maintained increase exponentially. In particular, when some general basic configuration items are updated, the configuration files of each service in each cluster need to be modified one by one, so that maintenance work becomes unusually heavy and is extremely prone to error.
Disclosure of Invention
In order to solve the above-mentioned problems existing in deploying different services in a plurality of different small clusters, embodiments of the present application creatively provide a method, an apparatus, a storage medium, a device method, an apparatus and a computer-readable storage medium for deploying services based on clusters.
According to a first aspect of the embodiment of the application, a method for deploying services based on clusters is provided, the method comprises the steps of obtaining multi-level configuration data of a first service aiming at different clusters, wherein the multi-level configuration data comprises at least two levels of nodes of a hierarchical structure, the relation between upper and lower levels of nodes is inheritance relation between a father node and a child node, the multi-level configuration data comprises at least two configuration items, the configuration items set by each child node cover the corresponding configuration items of the father node, the configuration items not set by each child node inherit the corresponding configuration items of the father node, the configuration items of the corresponding clusters are set at the last node, determining all the configuration items of the first service aiming at the first clusters according to the multi-level configuration data to obtain first configuration data, and deploying the first service to the first clusters according to the first configuration data.
According to an embodiment of the application, the method further comprises creating multi-level configuration data for different clusters for the first service, resulting in the first multi-level configuration data.
According to the embodiment of the application, the method further comprises the steps of storing the first multi-level configuration data into a first configuration library corresponding to the first service, and correspondingly, acquiring the multi-level configuration data of the first service aiming at different clusters, wherein the multi-level configuration data of the first service aiming at different clusters is acquired from the first configuration library.
According to the embodiment of the application, all configuration items of a first service aiming at a first cluster are determined according to multi-level configuration data to obtain first configuration data, the configuration items stored in a first level node are obtained according to the multi-level configuration data to obtain second configuration data, a first path from the first level node to a node corresponding to the first cluster is determined according to the first cluster, the configuration items of each node on the first path are obtained in sequence, and corresponding data items in the second configuration data are covered according to the configuration items of each node to obtain the first configuration data.
According to one embodiment of the application, determining a first path from a primary node to a node corresponding to the first cluster according to the first cluster includes determining a first path from the primary node to a node corresponding to the first cluster in a last-stage node to primary node order according to the first cluster.
According to the embodiment of the application, the method further comprises the steps of determining the node where the configuration item to be updated is located in the multi-level configuration data to obtain the first node, and updating the corresponding configuration item on the first node according to the configuration item to be updated.
According to the embodiment of the application, the multi-level configuration data further comprises nodes aiming at different scenes, the final-stage nodes are correspondingly provided with configuration items of corresponding clusters in the corresponding scenes, and accordingly, all the configuration items of the first service aiming at the first clusters are determined according to the multi-level configuration data to obtain the first configuration data, wherein all the configuration items of the first service aiming at the first clusters in the first scenes are determined according to the multi-level configuration data to obtain the first configuration data.
According to the second aspect of the embodiment of the application, a device for deploying services based on clusters is further provided, and the device comprises a multi-level configuration data acquisition module, a cluster configuration data determination module and a service deployment module, wherein 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 at least two levels of nodes of a hierarchical structure, the relation between upper and lower levels of nodes is inheritance relation between a father 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 father node, the configuration item not set by each child node inherits the corresponding configuration item of the father node, the last node is provided with the configuration item of the corresponding cluster, the cluster configuration data determination module is used for determining all the configuration items of the first service aiming at the first cluster according to the multi-level 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 embodiment of the present application, there is further provided a system for deploying services based on clusters, the system comprising a code repository, a deployment center and at least one cluster, wherein the code repository is configured to store multi-level configuration data of a first service for different clusters, the multi-level configuration data comprises nodes of at least two levels of hierarchy, a relationship between a parent node and a child node is an inheritance relationship between the parent node and the 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 the corresponding cluster is set at the last node, and the deployment center is configured to execute the method of deploying services based on clusters of any one of the above, and deploy the first service to one cluster of the at least one cluster.
According to a fourth aspect of the embodiment of the application, there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of deploying services based on clusters of any one of the above when executing the program.
According to a fifth aspect of embodiments of the present application, there is also provided a computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements a method of deploying a service based on clusters of any of the above.
The embodiment of the application provides a method, a device, a storage medium and equipment for deploying services based on clusters. The method is characterized in that the configuration of each service aiming at different clusters is organized into multi-level configuration data, wherein the multi-level configuration data comprises at least two levels of nodes in a hierarchical structure, the relation between an upper level node and a lower level node is the inheritance relation between a father node and a child node, the multi-level configuration data comprises at least two configuration items, the configuration items set by each child node cover the corresponding configuration items of the father node, the configuration items not set by each child node inherit the corresponding configuration items of the father node, and the final level node is set with the configuration items of the corresponding clusters. 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 inheritance relationship between the multi-level configuration data and the configuration items. Therefore, at the node corresponding to each cluster, only the specific configuration information of the node is needed to be stored, and other general configuration information can be inherited from the father node, so that the maintenance amount of data is greatly reduced, and the correctness of the data is easier to ensure.
It should be understood that the teachings of the present application need not achieve all of the above advantages, but rather that certain technical solutions may achieve certain technical effects, and that other embodiments of the present application may also achieve other advantages not mentioned above.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when 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 flow chart of a method for implementing a cluster-based deployment service according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a multi-level configuration data according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating creation of multi-level configuration data according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for implementing a cluster-based deployment service according to another embodiment of the present application;
FIG. 5 is a flowchart illustrating a method for implementing a cluster-based deployment service according to another embodiment of the present application;
Fig. 6 is a schematic diagram of a composition structure of an apparatus for deploying services based on clusters according to an embodiment of the present application.
Detailed Description
The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable those skilled in the art to better understand and practice the application and are not intended to limit the scope of the 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 application to those skilled in the art.
The technical scheme of the application is further elaborated below with reference to the drawings and specific embodiments.
FIG. 1 illustrates the main flow of a method for implementing cluster-based deployment services according to an embodiment of the present application. Referring to fig. 1, the method for deploying services based on clusters at least includes an operation 110 of obtaining multi-level configuration data of a first service for different clusters, wherein the multi-level configuration data comprises at least two configuration items, the multi-level configuration data comprises nodes of at least two levels of hierarchy structures, the relation between upper and lower nodes is inheritance relation between a father node and a child node, the configuration items set by each child node cover the corresponding configuration items of the father node, the configuration items not set by each child node inherit the corresponding configuration items of the father node, and the configuration items of the corresponding clusters are set in the last node, an operation 120 of determining all the configuration items of the first service for the first cluster according to the multi-level configuration data to obtain the first configuration data, and an operation 130 of deploying the first service to the first cluster according to the first configuration data.
Wherein in operation 110, the first service is a web application service providing a specific function through an application program or other forms, such as an authentication service, a card punching service, a conference service, and the like.
Clusters (Cluster), also known as Cluster servers, refer to a server architecture that combines the resources of multiple servers to collectively provide highly available, efficient operations and efficient storage. When the first service is deployed, the cluster may be considered as one single server.
In the embodiment of the application, the first service is 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 forming each cluster is different, and the hardware condition of each server is also different.
Thus, when the first service is deployed to each different cluster, different deployment parameters are specified, such as the maximum number of running instances, the maximum capacity of content planning, etc., due to the different size of each cluster (the number of servers making up each cluster) and the different computing power. Therefore, the computing capacity of each cluster is fully utilized, and the first service obtains better operation performance when operating in different clusters.
In view of the foregoing, embodiments of the present application use multi-level configuration data to set multi-level configuration data for a first service for different clusters. The multi-level configuration data includes at least two configuration items, each of which is a key-value pair, e.g., "instances":1 (the maximum number representing a running instance is 1), of a deployment parameter and its value that are required to be specified for deploying the first service. The multi-level configuration data comprises nodes of at least two levels of hierarchical structures, the relation between upper and lower level nodes is the inheritance relation between a father node and a child node, wherein the configuration item set by each child node covers the corresponding configuration item of the father node, the configuration item not set by each child node inherits the corresponding configuration item of the father node, and the final level node is provided with the configuration item of the corresponding cluster, wherein the final level node refers to the node without the child node.
Fig. 2 shows a structure of multi-level 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 employ a tree structure including nodes of a 4-level hierarchy, 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 has no cluster subtype, and its child nodes may be clusters.
The root node 20 is a primary node, i.e. a node without a father node, the cluster type node is a secondary node, i.e. a child node of the primary node, the cluster subtype node is a tertiary node, i.e. a child node of the secondary node, and the cluster node is a final node and is also a leaf node of a tree structure.
The configuration items of the root node 20 may be set to all deployment parameters and default values thereof required for deploying the first service, or may be set to deployment parameters and general values applicable to most clusters.
The cluster type node is provided with configuration items of corresponding cluster types which are different from other cluster types, and the configuration items are universal configuration items which are commonly applicable to each cluster subtype in the corresponding cluster type.
The cluster subtype node is provided with configuration items of which the corresponding cluster subtype is different from other cluster subtypes, and the configuration items are universal configuration items which are commonly applicable to each cluster in the corresponding cluster subtype.
The cluster nodes are provided with configuration items of the corresponding clusters which are different from other clusters.
Thus, the common configuration item 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 configuration items different from other child nodes. When the universal configuration item needs to be modified, only the configuration item in the father node needs to be modified, and each child node can naturally inherit the modified universal configuration item. Thus, redundant data among all the child nodes can be removed to the greatest extent, and the data maintenance amount is greatly reduced.
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 a data storage system storing the multi-level configuration data, the real-time processing time can be shortened, the response is quicker, the required data can be obtained from the data storage system storing the data such as each node of the multi-level configuration data, the configuration data item corresponding to each node, the inheritance relation of each node and the like, the multi-level configuration data aiming at different clusters can be generated in real time, and the requirement on the data storage system is lower.
In operation 120, the first configuration data refers to all deployment parameters and values thereof required to deploy the first service to the first cluster for all configuration items of the first cluster.
As described above, the first cluster typically corresponds to a leaf node, and the first configuration data is determined based on the configuration items set on the leaf node, the configuration items set on the parent node, and the recursively derived configuration items set on the ancestor nodes of each level.
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 a flow shown in fig. 3, where the flow mainly includes:
step 310, obtaining configuration items stored in the root node according to the multi-level configuration data to obtain second configuration data;
step 320, determining a first path from the root node to a node corresponding to the first cluster according to the first cluster;
assuming 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.
Step 330, sequentially obtaining configuration items of each node on the first path, and covering corresponding data items in the second configuration data according to the configuration items of each node to obtain first configuration data.
In this process, the configuration items set by each child node overlap the corresponding configuration items of the parent node, and the configuration items not set by each child node inherit the corresponding configuration items of the parent node, so that when the configuration items of the leaf nodes are processed in the order from the root node to the leaf nodes, all the configuration items of the corresponding clusters (i.e., the first clusters) of the leaf nodes are obtained.
After the first configuration data is determined, that all deployment parameters required to deploy the first service to the first cluster for application in the first scenario are determined, the first service may be deployed into the first cluster via operation 130.
Therefore, the method for deploying services based on the clusters, which is provided by the embodiment of the application, arranges the configuration of each service for different clusters into multi-level configuration data, wherein the multi-level configuration data comprises at least two levels of nodes in a hierarchical structure, the relation between upper and lower levels of nodes is the inheritance relation between a father 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 father node, the configuration item not set by each child node inherits the corresponding configuration item of the father node, and the leaf node is provided with the configuration item of the 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 inheritance relationship between the multi-level configuration data and the configuration items. Therefore, at the node corresponding to each cluster, only the specific configuration information of the node is needed to be stored, and other general configuration information can be inherited from the father node, so that the maintenance amount of data is greatly reduced, and the correctness of the data is easier to ensure.
In the embodiment of the present application, the multi-level configuration data is created in advance through the following process:
creating a root node, and setting all deployment parameters and default values thereof required by the first service or deployment parameters and common values applicable to most clusters as configuration items of the root node;
under the root node, creating a cluster type node, setting configuration items of which the cluster type is different from other cluster types as configuration items of corresponding cluster type nodes, and if the cluster type node does not exist, directly creating the cluster node;
Under the cluster type node, creating a cluster subtype node, setting configuration items of cluster subtypes different from other cluster subtypes as configuration items of corresponding cluster subtype nodes, and directly creating the cluster node if the cluster subtype is not available;
Under the cluster subtype node, a cluster node is created, and configuration items of clusters different from other clusters are set as configuration items of corresponding cluster nodes.
This results in multi-level configuration data for the first service for different clusters.
After the multi-level configuration data is created, it may also be stored in a configuration library. Thus, 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 the value of a specific general configuration item in a specific hierarchical structure needs to be modified, the value can be updated by determining the node where the 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 determining the node of the configuration item to be updated in the multi-level configuration data, the configuration item matched with the configuration item and the node of the matched configuration item can be found by inquiring the key word in the multi-level configuration data, and the node of the configuration item to be updated in the multi-level configuration data can be determined according to the designated node path.
Thus, when some general 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 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 library, where multiple levels of configuration data of multiple services for different clusters, such as service 1, service 2, service 3, etc., are stored, a deployment center is responsible for obtaining configuration data required for each deployment, and constructing a complete deployment configuration, and in one deployment, multiple services can be deployed together into a specified cluster.
In an embodiment of the present application, to facilitate management of multi-level configuration data for each service, a separate code base, such as a service 1 code base, a service 2 code base, and a service 3 code base, is created in the code repository for each service.
After the multi-level configuration data for different clusters is created for each service, the multi-level configuration data corresponding to each service is stored in a code base corresponding to the corresponding service. For example, the tree configuration structure corresponding to service 1 is stored in the service 1 code base, the tree configuration structure corresponding to service 2 is stored in the service 2 code base, and the tree configuration structure corresponding to service 3 is stored in the service 3 code base. In this way, it is possible to facilitate individual management of the multi-level configuration data for each service, avoiding interference of the multi-level configuration data between the respective services, and this embodiment is also convenient for data isolation and rights management, especially when the multi-level configuration data are maintained by different developers or business portions.
In addition, the multi-level configuration data corresponding to each service is stored in the code base corresponding to the corresponding service, so that the multi-level configuration data corresponding to the corresponding service can be positioned quickly, and the operation of querying the multi-level configuration data is faster than the operation of storing the multi-level configuration data of all the services in 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 the corresponding deployment instruction, the deployment center obtains the 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, the deployment configuration of the service 2 for the cluster X is obtained from the service 2 code library, and the deployment configuration of the service 3 for the cluster X is obtained from the service 3 code library.
And then, merging the deployment configuration of the service 1, the service 2 and the service 3 aiming at the cluster X to obtain the complete configuration information of the current deployment.
Subsequently, service 1 is deployed on cluster X according to the deployment configuration of service 1 for cluster X, service 2 is deployed on cluster X according to the deployment configuration of service 2 for cluster X, and service 3 is deployed on cluster X according to the deployment configuration of service 3 for cluster X.
In the process, the deployment configuration of different services to the X cluster can be obtained and executed in parallel, and the process of deploying corresponding services on the X cluster according to the deployment configuration of each service to the X cluster can be also executed in parallel. In this way, 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 application, the first service is applied to different scenes, and in a specific scene, even if the scale and the computing power of each cluster are different, the specific deployment parameters are set to the same value. For example, in a test scenario, to ensure the normal operation of all functions of a user in a basic application scenario and provide a positioning basis for other problems, an operation instance is generally limited to 1 so as to eliminate problems caused by multiple instances.
For this reason, in the multi-level configuration data in the embodiment of the present application, nodes for different scenes are also included, for example, "test custom configuration" for a test scene. Accordingly, the leaf node is provided with configuration items of the corresponding cluster under the corresponding scenario, such as a cluster a test configuration. Correspondingly, when all configuration items of the first service for the first cluster are determined according to the multi-level configuration data to obtain the first configuration data, the method comprises the steps of determining all configuration items of the first service for the first cluster under the first scene according to the multi-level configuration data to obtain the first configuration data.
The deployment parameters required to deploy the first service to the cluster are assumed to include "cpus", "mem", "instances" and "task_ concurrency", the clusters available for deployment include "cluster a", "cluster B" and "cluster C", and the applied scenarios include test scenarios or production scenarios. The first service includes three levels of hierarchy configuration data for different clusters and different application scenarios, including three levels of hierarchy nodes, a root configuration node (e.g., a base complete configuration), an application scenario node (e.g., a test custom configuration and a production custom configuration), and cluster configuration nodes in the respective scenarios (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 the first cluster to be deployed is "cluster A" and the application scene to be deployed is "test scene", the configuration items on the nodes of "basic complete configuration" - "test customized configuration" - "cluster A test configuration" can be obtained one by one, so that the configuration items set by each child node cover the corresponding configuration items of the parent node, and the configuration items not configured by each child node inherit the corresponding configuration items of the parent node, so that all deployment parameters required for deploying the first service to the application of the cluster A to the test scene can be obtained.
For example, a basic complete configuration of "cpus" to 0.4, "mem" to 4096, and "instances" to 1 is obtained.
Thereafter, the configuration of the "test custom configuration" is acquired, and since the "test custom configuration" does not set any configuration, all the basic complete configuration is inherited.
Subsequently, configuration data of a node of the cluster A test configuration are acquired, and all deployment parameters required for deploying the first service to the cluster A under the test scene are obtained by using task_ concurrency:6, task_ cpus:0.8 to cover the task_ concurrency and task_ cpus in the basic complete configuration, namely 'cpus', 0.8:mem '4096, instances':1 and task_ concurrency:6.
After the configuration data is obtained, the first service can be deployed to the first cluster, so that the first service is applied to the test scene.
The method for deploying service based on the clusters, provided by the embodiment of the application, not only can determine the deployment parameters according to the clusters, but also can acquire the deployment parameters of different clusters in different application scenes by combining various application scenes, and has wider application range.
It should be noted that the above multi-level configuration data may be implemented by any suitable tree data structure, and in particular, inheritance tree data structures carried by some program languages. Any suitable tree-based data structure traversal, recursion, and query algorithms may be used in implementing the operations of the above-described methods, provided that the corresponding functions are implemented.
Similarly, based on the method for deploying services based on clusters, the embodiment of the application also provides a device for deploying services based on clusters, as shown in fig. 6, the device 60 comprises a multi-level configuration data acquisition module 601, a cluster configuration data determination module 602, and a service deployment module 603, wherein the multi-level configuration data acquisition module is used for acquiring multi-level configuration data of a first service for different clusters, the multi-level configuration data comprises at least two levels of nodes in a hierarchical structure, the relationship between upper and lower levels of nodes is inheritance relationship between a father 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 father node, the configuration item not set by each child node inherits the corresponding configuration item of the father node, and the last level node is provided with the configuration item of the corresponding cluster, the cluster configuration data determination module 602 is used for determining all configuration items of the first service for the first cluster according to the multi-level configuration data, and the service deployment module 603 is used for deploying the first service to the first cluster according to the first configuration data.
The apparatus 60 further comprises a multi-level configuration data creation module for creating multi-level configuration data for different clusters for the first service, resulting in first multi-level configuration data, according to an embodiment of the present application.
According to an embodiment of the present application, the apparatus 60 further includes a multi-level configuration data storage module configured to store the first multi-level configuration data in a first configuration library corresponding to the first service, and correspondingly, the multi-level configuration data acquisition module 601 is specifically configured to acquire the multi-level configuration data of the first service for different clusters from the first configuration library.
According to an embodiment of the application, the cluster configuration data determining module 602 includes a primary node configuration obtaining module for obtaining configuration items stored in primary nodes according to multi-level configuration data to obtain second configuration data, a cluster path determining module for determining a first path from the primary nodes to nodes corresponding to the first clusters according to the first clusters, and a configuration item covering module for sequentially obtaining configuration items of each node on the first path and covering 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 the primary node to a node corresponding to the first cluster in an order from the final node to the primary node.
According to an embodiment of the present application, the apparatus 60 further includes a to-be-updated node determining module configured to determine a node where the to-be-updated configuration item is located in the multi-level configuration data to obtain a first node, and a configuration item updating module configured to update a corresponding configuration item on the first node according to the to-be-updated configuration item.
According to an embodiment of the present application, the multi-level configuration data further includes nodes for different scenarios, and accordingly, the final node is provided with configuration items of the corresponding cluster in the corresponding scenario, and accordingly, 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, and obtain the first configuration data.
Similarly, based on the method of deploying services based on clusters, the embodiment of the application also provides a system based on cluster deployment services, as shown in fig. 4, the system comprises a code warehouse, a deployment center and at least one cluster (cluster X), wherein the code warehouse is used for storing multi-level configuration data of a first service (for example, service 1, service 2 and service 3) aiming at different clusters, the multi-level configuration data comprises nodes of at least two levels of hierarchical structures, the relation between upper and lower levels of nodes is the inheritance relation between a father node and a child node, the configuration item set by each child node covers the corresponding configuration item of the father node, the configuration item not set by each child node inherits the corresponding configuration item of the father node, the last node is provided with the configuration item of the corresponding cluster, and the deployment center is used for executing the method based on cluster deployment services of any of the above items, and deploying the first service to one cluster (cluster X) of at least one cluster.
Similarly, the embodiment of the application also provides a computer device based on the cluster-based service deployment method, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes any of the cluster-based service deployment methods when executing the program.
Similarly, based on the method for deploying services based on clusters, the embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a program, and when the program is executed by a processor, the processor is caused to at least execute any of the methods for deploying services based on clusters.
It should be noted here that the description above for the apparatus embodiment of the cluster-based deployment service, the description above for the computer device embodiment, and the description above for the computer-readable storage medium embodiment are similar to the description of the foregoing method embodiment, and have similar beneficial effects as the method embodiment, and thus are not repeated. For technical details not disclosed in the embodiment of the configuration information display device of the present application, please refer to the description of the foregoing method embodiment of the present application for understanding, so that the description is omitted for saving the space.
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 one 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 by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, e.g., the division of elements is merely a logical division of functionality, and may be implemented in other manners, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, may be located in one place or distributed on a plurality of network units, and may select some or all of the units according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of hardware plus a form of software functional unit.
It will be appreciated by those of ordinary skill in the art that implementing all or part of the steps of the above method embodiments may be implemented by hardware associated with program instructions, where the above program may be stored in a computer readable storage medium, where the program when executed performs the steps comprising the above method embodiments, where the above storage medium includes various media that may store program code, such as a removable storage device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Or the above-described integrated units of the application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of the embodiments of the present application. The storage medium includes various media capable of storing program codes such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The foregoing is merely illustrative 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 think about variations or substitutions within the technical scope of the present application, and the application should be covered. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (11)

1. A method for deploying services based on a cluster, 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 of at least two levels of hierarchical structures, the relation between upper and lower nodes is inheritance relation between a father node and a child node, the father node is used for placing a general configuration item, the child node is used for placing configuration items different from other child nodes, the configuration item set by each child node covers the corresponding configuration item of the father node, the configuration item not set by each child node inherits the corresponding configuration item of the father node, and the final node is provided with the configuration item of the corresponding cluster;
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;
And deploying the first service to the first cluster according to the first configuration data.
2. The method according to claim 1, wherein 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.
3. The method according to claim 2, wherein the method further comprises:
Storing the first multi-level configuration data into a first configuration library corresponding to the first service;
Accordingly, the acquiring the multi-level configuration data of the 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.
4. The method of claim 1, wherein determining all configuration items of the first service for the first cluster according to the multi-level configuration data, to obtain first configuration data, comprises:
Acquiring configuration items stored in the primary nodes according to the multi-level configuration data to obtain second configuration data;
Determining a first path from the primary node to a node corresponding to the first cluster according to the first cluster;
And sequentially acquiring configuration items of each node on the first path, and covering 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 based on the first cluster comprises:
And determining a first path from the primary node to a node corresponding to the first cluster according to the first cluster in the order from the final stage node to the primary node.
6. The method according to claim 1, wherein 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.
7. The method of claim 1, wherein the multi-level configuration data further comprises nodes for different scenarios,
Correspondingly, the final-stage node is provided with configuration items of the corresponding clusters under corresponding scenes;
Correspondingly, according to the multi-level configuration data, determining all configuration items of the first service aiming at the first cluster to obtain first configuration data, including:
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, wherein the multi-level configuration data comprises at least two levels of nodes in a hierarchical structure, the relation between a parent node and a child node is inheritance relation of the upper level node and the lower level node, the multi-level configuration data comprises at least two configuration items, the parent node is used for placing a common configuration item, the child node is used for placing configuration items different from other child nodes, the configuration items set by each child node cover the corresponding configuration items of the parent node, the configuration items not set by each child node inherit the corresponding configuration items of the parent node, and the final node is provided with the configuration items of the corresponding clusters;
The cluster configuration data determining module is used for 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;
And the service deployment module is used for deploying the first service to the first cluster according to the first configuration data.
9. A system for deploying services based on clusters, the system comprising a code repository, 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 comprises at least two levels of nodes of a hierarchical structure, the relation between a parent node and a child node is inheritance relation of the upper level node and the lower level node, the parent node is used for placing general configuration items, the child node is used for placing configuration items different from other child nodes, wherein the configuration items set by each child node cover the corresponding configuration items of the parent node, the configuration items not set by each child node inherit the corresponding configuration items of the parent node, and the final level node is provided with the configuration items of the corresponding clusters;
the deployment center for performing the method of any of claims 1-7, deploying the first service to one of the at least one cluster.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-7 when the program is executed by the processor.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
CN202111660254.2A 2021-12-31 2021-12-31 A method, device, storage medium and equipment based on cluster deployment service Active CN114489720B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN114489720A CN114489720A (en) 2022-05-13
CN114489720B true CN114489720B (en) 2025-02-11

Family

ID=81507936

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN114489720B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119201207A (en) * 2024-09-09 2024-12-27 北京轻网科技股份有限公司 A hierarchical parameter processing inheritance and interactive configuration method, device, medium and product

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485767A (en) * 2021-07-09 2021-10-08 绿盟科技集团股份有限公司 Control configuration updating method and system and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016106486A1 (en) * 2014-12-29 2016-07-07 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for configuring a communication system
CN107908432A (en) * 2017-11-17 2018-04-13 深圳泉眼体育运营管理有限公司 Collocation method and device, the terminal device and readable storage medium storing program for executing of application program
CN112035162B (en) * 2020-09-02 2024-06-21 中国银行股份有限公司 Configuration file batch modification method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485767A (en) * 2021-07-09 2021-10-08 绿盟科技集团股份有限公司 Control configuration updating method and system and electronic equipment

Also Published As

Publication number Publication date
CN114489720A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US11704114B2 (en) Data structures for managing configuration versions of cloud-based applications
CN107430611B (en) Filtering data lineage graph
US8819672B2 (en) Multi-image migration system and method
US20080263082A1 (en) Recovery segment identification in a computing infrastructure
US20060034263A1 (en) Model and system state synchronization
US11196633B2 (en) Generalized correlation of network resources and associated data records in dynamic network environments
US11966732B2 (en) Data structures for managing configuration versions of cloud-based applications
US10338910B2 (en) Multi-tenant upgrading
US20200409669A1 (en) Technique for transforming a standard messaging component to a customized component
US20230244542A1 (en) System and method for automatically identifying application groups in container deployment environments
US20060075013A1 (en) System and method for relating computing systems
WO2023098462A1 (en) Improving performance of sql execution sequence in production database instance
CN114816470B (en) Metadatabase management method, device, electronic device and medium
CN114489720B (en) A method, device, storage medium and equipment based on cluster deployment service
US10176011B2 (en) Automatically generating and executing a service operation implementation for executing a task
US11221923B2 (en) Performing selective backup operations
US9983866B1 (en) Upgrade compatibility checks in a client-server environment
CN112732242B (en) Method and device for generating wide-table processing script
US7373355B2 (en) System and method for relating applications in a computing system
CN111400243B (en) Development management system based on pipeline service and file storage method and device
US12242983B2 (en) Distributed ledger based machine-learning model management
Girbea et al. Efficient address space generation for an OPC UA server
US11561979B2 (en) Dynamically detecting and correcting errors in queries
CN117743408A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN116431194A (en) Construction method, device, equipment and storage medium for continuous integration task

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