Business service establishment method and device, computer equipment and storage medium
By obtaining service requirements information and instance templates, creating service instances and components, building container group collections, and forming a three-layer structural model, it solves the problem of low efficiency in business service establishment in traditional technology, and realizes efficient and general business service deployment and management .
Patent Information
- Application Number
- CN202310713387.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-17
AI Technical Summary
In traditional technology, business services are inefficient in establishing business services and cannot achieve general deployment. Developers need to deploy from scratch, resulting in inefficiency.
By obtaining service demand information and preset instance templates, creating service instances, creating service components based on component declaration information, further building container group collections based on container group declaration information, forming a service model, and abstracting it into a three-layer structural model to achieve orderly Business services are established.
It improves the efficiency and universality of business service establishment, realizes cloud-native containerized deployment, and simplifies the rapid establishment and management of business services.
Smart Images

Figure CN119149164A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of computer technology and cloud native technology, and in particular to a business service establishment method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of computer technology, various business services have emerged. A business service is a service that implements a certain business, such as database service, middleware service, etc.
[0003] In traditional technologies, deploying and establishing any business service on a server usually requires developers to deploy it from scratch, which makes it impossible to establish a universal business service and leads to low efficiency in establishing business services. Summary of the invention
[0004] Based on this, it is necessary to provide a business service establishment method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of business service establishment in response to the above technical problems.
[0005] The present application provides a method for establishing a business service. The method comprises:
[0006] Acquire service demand information for a target business service, and acquire an instance template preset for the target business service as a target instance template;
[0007] Creating a service instance corresponding to the target business service based on the service demand information and the target instance template;
[0008] Creating a service component based on component declaration information included in the service instance to obtain each service component corresponding to the target business service; the component declaration information is used to instruct the creation of service components that match each component type specified by the target instance template;
[0009] Creating a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtaining a container group set corresponding to each of the service components; the container group declaration information contained in the service component is obtained from the service instance;
[0010] Based on the service instance, the service components, and the container group sets corresponding to the service components, a service model corresponding to the target business service is obtained; the service model is used to provide the target business service to the demander corresponding to the service demand information.
[0011] The present application also provides a business service establishment device. The device includes:
[0012] A data acquisition module, used to acquire service demand information for a target business service, and acquire an instance template preset for the target business service as a target instance template;
[0013] An instance creation module, used to create a service instance corresponding to the target business service based on the service demand information and the target instance template;
[0014] A component creation module, used to create a service component based on the component declaration information contained in the service instance, and obtain each service component corresponding to the target business service; the component declaration information is used to instruct the creation of service components that match each component type specified by the target instance template;
[0015] A container creation module, configured to create a container group set corresponding to a service component based on the container group declaration information contained in the service component, and obtain a container group set corresponding to each of the service components; the container group declaration information contained in the service component is obtained from the service instance;
[0016] A model determination module is used to obtain a service model corresponding to the target business service based on the service instance, the various service components, and the container group set corresponding to each of the service components; the service model is used to provide the target business service to the demander corresponding to the service demand information.
[0017] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned business service establishment method when executing the computer program.
[0018] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the business service establishment method.
[0019] A computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the business service establishment method are implemented.
[0020] The above-mentioned business service establishment method, device, computer equipment, storage medium and computer program product obtain service demand information for the target business service, obtain the preset instance template for the target business service as the target instance template; create a service instance corresponding to the target business service based on the service demand information and the target instance template; create a service component based on the component declaration information contained in the service instance, and obtain each service component corresponding to the target business service; the component declaration information is used to indicate the creation of service components that match each component type specified by the target instance template; create a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtain a container group set corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance; based on the service instance, each service component, and the container group set corresponding to each service component, obtain the service model corresponding to the target business service; the service model is used to provide the target business service to the demander corresponding to the service demand information. In this way, the instance templates corresponding to various business services are pre-set to quickly establish the corresponding business services. For the target business service, the personalized service demand information of the target business service and the instance template corresponding to the target business service are combined to obtain the service instance corresponding to the target business service. Based on the component declaration information contained in the service instance, each service component corresponding to the target business service is created. Based on the container group declaration information contained in the service component, a container group set corresponding to the service component is created. The service model for providing the target business service is formed by the service instance corresponding to the target business service, each service component, and the container group set corresponding to each service component. The business service is abstracted into a three-layer structure model. The three-layer structure model includes service instances, service components, and container group sets corresponding to service components. The service instance management creates relevant information about service components and container group sets. Each component management creates relevant information about its own container group set to achieve orderly business service establishment. Various business services can be abstracted into a three-layer structure model with strong versatility, which ensures the versatility of business service establishment and improves the efficiency of business service establishment. Based on such a three-layer structure model, business services are realized in a cloud-native way in containerization. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 An application environment diagram of a business service establishment method in an embodiment;
[0022] Figure 2 A flowchart of a method for establishing a business service in one embodiment;
[0023] Figure 3 is a schematic diagram of a service model in an embodiment;
[0024] Figure 4 A schematic diagram of a process for generating a configuration file corresponding to a container group in one embodiment;
[0025] Figure 5 A schematic diagram of a container group configuration component generating a configuration file corresponding to a container group in one embodiment;
[0026] Figure 6 A schematic diagram of initializing storage specifications of a container group in one embodiment;
[0027] Figure 7 A schematic diagram of monitoring the running status of a service component through a probe in one embodiment;
[0028] Figure 8 A schematic diagram of horizontal expansion of a container group in one embodiment;
[0029] Fig. 9 A schematic diagram of vertical upgrading of a container group in one embodiment;
[0030] Fig.10 A schematic diagram of generating a data snapshot for a container group in one embodiment;
[0031] Fig.11 A schematic diagram of a recovery service instance in one embodiment;
[0032] Fig.12 A structural block diagram of a business service establishment device in an embodiment;
[0033] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] The business service establishment method provided in the embodiment of the present application involves cloud technology.
[0036] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0037] In short, a database can be seen as an electronic filing cabinet - a place where electronic files are stored, and users can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application.
[0038] A database management system (DBMS) is a computer software system designed for managing databases. It generally has basic functions such as storage, retrieval, security, and backup. Database management systems can be classified according to the database model they support, such as relational, XML (Extensible Markup Language); or according to the type of computer they support, such as server clusters, mobile phones; or according to the query language used, such as SQL (Structured Query Language), XQuery; or according to performance focus, such as maximum scale, maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMS can cross categories, for example, supporting multiple query languages at the same time.
[0039] The business service establishment method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud computing services. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0040] Specifically, the server may obtain service demand information for the target business service from the terminal. The server obtains an instance template preset for the target business service as the target instance template, and creates a service instance corresponding to the target business service based on the service demand information and the target instance template. The server creates a service component based on the component declaration information contained in the service instance, and obtains each service component corresponding to the target business service. The component declaration information is used to indicate the creation of service components that match each component type specified by the target instance template. The server creates a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtains a container group set corresponding to each service component. The container group declaration information contained in the service component is obtained from the service instance. Based on the service instance, each service component, and the container group set corresponding to each service component, a service model corresponding to the target business service is obtained. The service model is used to provide the target business service to the demander corresponding to the service demand information. The server may return the access entry of the service model to the terminal so that the terminal can use the target business service.
[0041] In one embodiment, Figure 2 As shown, a business service establishment method is provided, and the method is applied to a processing server as an example. Figure 2 , the business service establishment method includes the following steps:
[0042] Step S202: obtaining service requirement information for a target business service, and obtaining a preset instance template for the target business service as a target instance template.
[0043] The processing server is used to process the business service establishment request and establish and deploy the business service on the relevant equipment. For example, the processing server can deploy the business service on the cloud server.
[0044] The target business service refers to the business service that is currently to be deployed and established. For example, various business service establishment portals can be provided to users, from which users can select the required business service, and the business service selected by the user is used as the target business service. The target business service is established and deployed for the user on the node cluster, and the access portal of the successfully established target business service is returned to the user so that the user can use the target business service.
[0045] When users select the required business services, they can also put forward service requirements, which can be requirements for the service deployment location, requirements for the service deployment scale, etc. Service demand information refers to the personalized demand information of the target business service demander for the target business service. For example, for a certain database service, the service demand information can be the deployment region requirements, deployment availability zone requirements, deployment hard disk requirements, deployment backup requirements, deployment node requirements, etc. of the database service.
[0046] Instantiate an object to get the corresponding instance. Instantiate a business service to get the corresponding service instance. Various business services have their own characteristics, and corresponding instance templates can be pre-set for various business services. The instance template is a specification template pre-set for the characteristics of the business service. The instance template is used to declare the common metadata required to establish the business service. For example, the instance template includes the component type required by the business service, the common component configuration parameters, and the common container group configuration parameters. It can be understood that the component types contained in a business service are determined. For example, for the ClickHouse database service, ClickHouse consists of two components, namely zookeeper and clickhouse. Zookeeper is used for metadata management of ClickHouse, and clickhouse is used for data storage and calculation of ClickHouse. For example, the ClickHouse database service is deployed on a cluster containing multiple nodes. Zookeeper is responsible for scheduling and communication between nodes in the node cluster, and clickhouse is responsible for data storage and data calculation on nodes in the node cluster.
[0047] Specifically, the user determines the required target business service and service requirement information for the target business service on the terminal. The terminal sends the service requirement information for the target business service to the processing server, and the processing server obtains the instance template preset for the target business service as the target instance template, and deploys the target business service based on the service requirement information and the target instance template.
[0048] Step S204: Create a service instance corresponding to the target business service based on the service demand information and the target instance template.
[0049] Specifically, after determining the service requirement information and target instance template for the target business service, the service requirement information and the target instance template are combined to create a personalized service instance corresponding to the target business service. The service instance corresponding to the target business service is used to indicate various metadata required to establish the target business service.
[0050] In one embodiment, the service instance corresponding to the business service is Cluster, which is a business cluster instance. Cluster represents a cluster instance created by a business service and is implemented by K8s CRD. The instance template corresponding to the business service is ClusterPreset, which is a business cluster instance template. The business cluster instance template represents a specification template pre-configured by Cluster. For example, a ClusterPreset corresponding to a business service includes the image (mirror), cpu / memory, parameter configuration and other information of the component corresponding to the business service. ClusterPreset is implemented by K8s CRD. K8s (Kubernetes) is a container orchestration system widely used in the cloud native field. It has the characteristics of high scalability, high availability, fault self-healing, open source ecology, etc. As a base, it can support large-scale production-level cluster deployment. CRD (CustomResource Definition) is a resource type customized by K8s users in K8s. There is no need to modify the K8s source code to create a customized API server. This function greatly improves the expansion capability of K8s. The user-defined CRD can realize the corresponding functional characteristics through the corresponding designed CRD controller.
[0051] In one embodiment, the target instance template is a yaml file for custom resource types implemented based on K8s CRD. The general information required for the target business service has been filled in the yaml file, and the service requirement information for the target business service is personalized information. The service requirement information is filled into the yaml file, and a service instance corresponding to the target business service is created based on the filled yaml file.
[0052] Step S206, creating a service component based on the component declaration information contained in the service instance to obtain each service component corresponding to the target business service; the component declaration information is used to instruct the creation of service components that match each component type specified by the target instance template.
[0053] Among them, business services are generally composed of one or more components, and different components are responsible for different functions in business services. For example, for the ClickHouse database service, ClickHouse is composed of two components, namely zookeeper and clickhouse. Zookeeper is used for metadata management of the ClickHouse database, and clickhouse is used for data storage and calculation of the ClickHouse database. The zookeeper component and the clickhouse component work together to implement the ClickHouse database service.
[0054] The component declaration information is used to declare and indicate the metadata required to create the components of the business service. The service instance corresponding to the target business service includes the component declaration information corresponding to the target business service. The component declaration information corresponding to the target business service includes the component type required by the target business service, component configuration parameters, startup dependencies between components, and other information.
[0055] It can be understood that the component type required by the target business service is determined based on the service characteristics of the target business service, and the component type required by the target business service is specified in the instance template corresponding to the target business service. For example, for the ClickHouse database service, ClickHouse consists of two components, zookeeper and clickhouse. The instance template corresponding to the ClickHouse database service specifies that two components are required, zookeeper and clickhouse. The startup dependency relationship between the components required for the target business service is also determined based on the service characteristics of the target business service. The startup dependency relationship between the components required for the target business service is specified in the instance template corresponding to the target business service. For example, for the ClickHouse database service, ClickHouse consists of two components, zookeeper and clickhouse. The component zookeeper needs to be started successfully before the clickhouse component that depends on zookeeper can be started. The startup dependency relationship between the zookeeper component and the clickhouse component is specified in the instance template corresponding to the ClickHouse database service. The component configuration parameters of the components required by the target business service include general configuration parameters and adjustable configuration parameters. The general configuration parameters are specified in the instance template corresponding to the target business service. The adjustable configuration parameters can be adjusted according to user needs or use default parameters. The default parameters of the adjustable configuration parameters can be specified in the instance template corresponding to the target business service.
[0056] Specifically, the processing server creates a service component based on the component declaration information contained in the service instance. The component declaration information includes component configuration parameters of various components required for the target business service. Based on the component configuration parameters, the corresponding component can be created to obtain the various service components corresponding to the target business service.
[0057] Step S208, creating a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtaining a container group set corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance.
[0058] The function of a component can be implemented by one or more container groups. A container group includes a group of related containers, which can also be called a pod. A container is an isolated unit that packages the related resources required to run an application. The container introduces the application code, its libraries and dependencies, any configuration files, and other system tools it depends on. The container realizes the cross-platform portability of the application, the isolation between processes, and the efficiency of development and deployment. The container groups required by a component constitute the container group set corresponding to the component.
[0059] The container group declaration information is used to declare and indicate the metadata required to create the container group set required for the component. The container group declaration information corresponding to the target business service includes information such as the number of pods required for the components of the target business service, pod configuration parameters, etc. For example, the container group declaration information includes information such as the number of pods required for the components, the image (mirror) required for each pod, the cpu / memory required for each pod, and the disk specifications required for each pod. The service instance corresponding to the target business service includes the container group declaration information corresponding to the target business service, and the service component corresponding to the target business service can obtain the container group declaration information from the service instance corresponding to the target business service, that is, inherit the container group declaration information from the service instance corresponding to the target business service.
[0060] It can be understood that the container group configuration parameters of the container group set required by the service component corresponding to the target business service include general configuration parameters and adjustable configuration parameters. The general configuration parameters are specified in the instance template corresponding to the target business service. The adjustable configuration parameters can be adjusted according to user needs, or the default parameters can be used. The default parameters of the adjustable configuration parameters can be specified in the instance template corresponding to the target business service.
[0061] Specifically, the processing server creates a container group set corresponding to the service component based on the container group declaration information contained in the service component. The container group declaration information includes container group configuration parameters of each container group in the container group set required by the service component of the target business service. The corresponding container group can be created based on the container group configuration parameters. The container groups corresponding to the same service component constitute a container group set, and finally the container group sets corresponding to each service component are obtained.
[0062] Step S210, based on the service instance, each service component, and the container group set corresponding to each service component, a service model corresponding to the target business service is obtained; the service model is used to provide the target business service to the demander corresponding to the service demand information.
[0063] Specifically, after the processing server sequentially creates the service instance corresponding to the target business service, each service component, and each corresponding container group set of each service component, each service component corresponding to the target business service and each corresponding container group set form a service model corresponding to the target business service, and provides the target business service to the demander corresponding to the service demand information through the service model corresponding to the target business service. In the service model corresponding to the target business service, the service instance is used for global management, the service instance and the service component are in a parent-child relationship, the service component is used for the management of the container group set, the service component and the corresponding container group set are in a parent-child relationship, and the container group set is used for data processing for the target business service.
[0064] Take ClickHouse database service as an example. Users need ClickHouse database service. The service demand information submitted by users includes the number of Pod shards, the number of Pod replicas, and the disk specifications required by Pod. The number of Pod shards is used to determine how many pods the data stored in the database needs to be distributed in a distributed manner. The number of Pod replicas is used to determine how many pods are needed as backup pods to back up the data stored in the database. The disk specifications required by Pod are used to determine the capacity of pod to store business data. The processing server receives a business service establishment request for ClickHouse database service, which carries service demand information. The processing server obtains the ClusterPreset corresponding to the ClickHouse database service, combines the service demand information and ClusterPreset to create the Cluster corresponding to the ClickHouse database service, and the Cluster corresponding to the ClickHouse database service is recorded as Cluster1. Through the Clustermanager (instance controller) designed based on K8s, the zookeeper component is created based on the zookeeper-related configuration parameters in Cluster1, and the zookeeper component is recorded as set1. Set1 inherits the relevant configuration parameters of the pod required by the zookeeper component from Cluster1. Through the Cluster manager (instance controller) designed based on K8s, create the clickhouse component based on the clickhouse related configuration parameters in Cluster1, and record the clickhouse component as set2. Set2 inherits the related configuration parameters of the pod required by the clickhouse component from Cluster1. Through the set controller (component controller) designed based on K8s, create the pod set required by the zookeeper component based on the pod related configuration parameters in the zookeeper component. Through the set controller (component controller) designed based on K8s, create the pod set required by the clickhouse component based on the pod related configuration parameters in the clickhouse component. Reference Figure 3 The service model of the ClickHouse database service required by the user includes a three-layer structure, which is Cluster1 representing the ClickHouse database instance, set1 and set2 representing the ClickHouse database components, and the various pods required by the ClickHouse database components. The processing server can return the service access entry corresponding to the established ClickHouse database service to the user, and the user can use the ClickHouse database service based on the service access entry.
[0065] In the above-mentioned business service establishment method, instance templates corresponding to various business services are pre-set to quickly establish corresponding business services. For the target business service, the personalized service demand information of the target business service and the instance template corresponding to the target business service are combined to obtain the service instance corresponding to the target business service, and the service components corresponding to the target business service are created based on the component declaration information contained in the service instance. The container group set corresponding to the service component is created based on the container group declaration information contained in the service component. The service model for providing the target business service is formed by the service instance corresponding to the target business service, each service component, and the container group set corresponding to each service component. The business service is abstracted into a three-layer structure model, which includes service instances, service components, and container group sets corresponding to service components. The service instance management creates relevant information about service components and container group sets, and each component management creates relevant information about its own container group set, so as to realize orderly business service establishment. Various business services can be abstracted into a three-layer structure model, which has strong versatility, ensures the versatility of business service establishment, and improves the efficiency of business service establishment. Based on such a three-layer structure model, business services are realized in a cloud-native way in containerization.
[0066] In one embodiment, creating a service instance corresponding to a target business service based on service requirement information and a target instance template includes:
[0067] Fill the service requirement information into the target instance template to obtain the service instance corresponding to the target business service; the target instance template includes a component declaration area and a container group declaration area; the component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.
[0068] The target instance template includes a component declaration area and a container group declaration area. The component declaration area is used to indicate component declaration information, that is, the content contained in the component declaration area constitutes the component declaration information. The container group declaration area is used to indicate container group declaration information, that is, the content contained in the container group declaration area constitutes the container group declaration information.
[0069] Specifically, after the processing server obtains the service demand information for the target business service, it fills the service demand information into the target instance template, and obtains the service instance corresponding to the target business service based on the filled target instance template. The target instance template can be a template file in the form of key-value, and the service demand information includes at least one demand item. When filling the target instance template, the target instance template is searched for keys that match each demand item, and the specific information of the demand item is used as the value corresponding to the matching key.
[0070] In the above embodiment, the service requirement information for the target business service is filled into the target instance template for the target business service, so that a service instance corresponding to the target business service can be quickly created.
[0071] In one embodiment, a service component is created based on component declaration information included in a service instance to obtain each service component corresponding to a target business service, including:
[0072] Based on the component declaration information contained in the service instance, determine the component types required for the target business service and the component configuration information corresponding to each component type; based on each component configuration information, create service components that match the corresponding component type to obtain the service components corresponding to the target business service.
[0073] Specifically, the component declaration information includes the component types required by the target business service. The component types are used to determine what type of components the target business service needs. The component declaration information includes component configuration information corresponding to each component type required by the target business service. The component configuration information is used to determine the configuration parameters of the components required by the target business service. The component configuration information includes various field information required to create components of the corresponding component types. Based on the component declaration information contained in the service instance, the processing server determines each component type required by the target business service and the component configuration information corresponding to each component type. Based on each component configuration information, service components matching the corresponding component types are created to obtain each service component corresponding to the target business service.
[0074] In the above embodiment, the component declaration information declares each component type required by the target business service and the component configuration information corresponding to each component type. Based on the component declaration information, each service component corresponding to the target business service can be quickly created.
[0075] In one embodiment, a container group set corresponding to the service component is created based on the container group declaration information contained in the service component to obtain a container group set corresponding to each service component, including:
[0076] For any service component in each service component, based on the container group declaration information contained in the service component, determine the number of container groups required by the service component, and create each container group to be configured that matches the number of container groups; based on the container group declaration information contained in the service component, determine the container group configuration information corresponding to each container group to be configured, and based on the container group configuration information, initialize the corresponding container group to be configured to obtain a configured container group; based on each configured container group, obtain a container group set corresponding to the service component.
[0077] Specifically, the container group declaration information includes the number of container groups required by the service component, and the number of container groups is used to determine how many pods the service component needs. The processing server can create each container group to be configured that matches the number of container groups. The container group declaration information includes the container group configuration information of the container group required by the service component, and the container group configuration information is used to determine the configuration parameters of the pod. Each pod has its own corresponding container group configuration information. The processing server can initialize the corresponding container group to be configured based on the container group configuration information to obtain the configured container group, and finally each configured container group constitutes the container group set corresponding to the service component.
[0078] In one embodiment, initializing the container group to be configured includes initializing the namespace (Namespace, NS) of the container group to be configured. K8s uses the namespace to place a group of related resources in the same namespace to achieve resource isolation and permission restriction. The pods corresponding to a business service are placed in the same namespace, and the pods corresponding to different business services are placed in different namespaces to achieve business service isolation. For example, the pods corresponding to the MySQL database service of user A are placed in namespace a, and the pods corresponding to the MySQL database service of user B are placed in namespace b.
[0079] In one embodiment, initializing the container group to be configured includes initializing the storage specification of the container group to be configured. The storage specification of the pod is used to determine the storage capacity and storage directory of the data in the pod. The storage specification of the pod can be configured according to user needs.
[0080] In one embodiment, initializing the container group to be configured includes initializing a network of the container group to be configured. The network of the pod is used for communication between different pods.
[0081] In one embodiment, initializing the container group to be configured includes initializing the configuration file of the container group to be configured. The configuration file of the pod is used for the process running of the pod. The configuration file of the pod can be set using the ConfigMap provided by K8s, or can be set using other customized components.
[0082] In the above embodiment, the container group declaration information declares the number of container groups and container group configuration information required by the service component. Based on the container group declaration information, a container group set corresponding to each service component can be quickly created.
[0083] In one embodiment, Figure 4 As shown, based on the container group configuration information, the corresponding container group to be configured is initialized to obtain the configured container group, including:
[0084] Step S402: for any container group to be configured, the container group runtime specific information corresponding to the container group to be configured is obtained through the container group configuration component, and the personalized information and the container group runtime specific information in the container group configuration information are rendered to obtain the container group personalized configuration information corresponding to the container group to be configured.
[0085] Step S404: obtain a container group configuration file template corresponding to the target business service through the container group configuration component, render the container group personalized configuration information and the container group configuration file template, and obtain a target configuration file corresponding to the container group to be configured.
[0086] Step S406: Send the target configuration file to the container to be configured through the container group configuration component to obtain a configured container group initialized on the configuration file.
[0087] The container group configuration component is a pre-set component used to configure the final configuration file required by the container group. The container group runtime specific information refers to the information used by the container group to identify itself during operation. For example, the container group runtime specific information includes the name, domain name, IP, status, and other information of the pod.
[0088] It can be understood that the container group configuration information is the relevant parameters before the container group runs, and the container group configuration information exists before the pod is created. The personalized information in the container group configuration information is determined based on the service demand information submitted by the user. The container group runtime specific information is the relevant parameters of the container group runtime, and the container group runtime specific information will only exist after the pod is created. For example, before creating a pod, you only know how many pods to create, what the pod image is, and other information required to create the pod. After the pod is created, the pod name, domain name, IP, status and other information that identifies the pod will be generated.
[0089] Each business service has a corresponding container group configuration file template. The container group configuration file template is a template for the pod provided by the business developer of the business to which the business service belongs. For example, for database services, there are various database services such as MySQL, MariaDB, PostgreSQL, SQL Server, ClickHouse, MongoDB, and Redis. Taking the MySQL database service as an example, the MySQL database service belongs to the MySQL database. The engineers of the MySQL database will write the configuration file template for the pod required by the MySQL database, that is, the database provider of the MySQL database will write the configuration file template for the pod required by the MySQL database.
[0090] The container group configuration file template includes existing basic configuration parameters and personalized configuration parameters to be supplemented. Basic configuration parameters are common configuration parameters between different pods of the same type, and personalized configuration parameters are configuration parameters unique to each pod. You can get a complete configuration file by supplementing the personalized configuration parameters to be supplemented in the configuration file template.
[0091] Specifically, the processing server may generate target configuration files corresponding to the container groups to be configured through the container group configuration component, and send each target configuration file to the corresponding container group to be configured, thereby obtaining each configured container group initialized on the configuration file.
[0092] When generating the target configuration file, first obtain the container group runtime specific information corresponding to the container group to be configured through the container group configuration component, render the personalized information in the container group configuration information and the container group runtime specific information, that is, combine the container group configuration information and the container group runtime specific information to obtain the container group personalized configuration information corresponding to the container group to be configured. Then, obtain the container group configuration file template corresponding to the target business service through the container group configuration component, render the container group personalized configuration information and the container group configuration file template, that is, fill the container group personalized configuration information into the container group configuration file template, and finally obtain the target configuration file corresponding to the container group to be configured.
[0093] In the above embodiment, the personalized information in the container group configuration information and the container group runtime specific information are rendered by the container group configuration component to obtain the container group personalized configuration information, and the container group personalized configuration information and the container group configuration file template are rendered to obtain a complete target configuration file. The container group configuration component can quickly generate the configuration file required by the container group.
[0094] In one embodiment, obtaining a container group configuration file template corresponding to a target business service through a container group configuration component includes:
[0095] A template index of a container group configuration file template for a target business service is obtained from the container group declaration information through a container group configuration component, and based on the template index, the container group configuration file template is obtained from a preset storage area; wherein the container group configuration file template is submitted to the preset storage area for storage through a template unification tool, and the template unification tool is used to unify the formats of container group configuration file templates respectively provided by multiple business developers corresponding to the business type to which the target business service belongs.
[0096] Among them, business services have corresponding business types. For example, the business type corresponding to various database services is database, and the business type corresponding to various middleware services is middleware. Business developers are enterprises or manufacturers that develop businesses. For example, for databases, including MySQL, MariaDB, PostgreSQL, SQL Server, ClickHouse, MongoDB, Redis and other databases, the developer of MySQL database will provide the pod configuration file template required by MySQL database, and the developer of ClickHouse database will provide the pod configuration file template required by ClickHouse database.
[0097] The template unification tool is a pre-set tool for unifying the template format of configuration files. The template unification tool is used to convert container group configuration files provided by multiple business developers corresponding to the same business type into a unified format for subsequent processing of container group configuration components.
[0098] The container group configuration file templates provided by multiple business developers corresponding to the same business type are uploaded to the template unification tool, and each container group configuration file template is converted into a unified format through the template unification tool. The template unification tool submits each container group configuration file template in a unified format to a preset storage area for storage.
[0099] Storing the container group configuration file template in a preset storage area means storing the container group configuration file template in a preset storage area. The preset storage area can be set according to actual needs. After storing the container group configuration file template, a template index corresponding to the container group configuration file template can be obtained, and the corresponding container group configuration file template can be quickly found through the template index.
[0100] After obtaining the template index corresponding to the container group configuration file template by storing the container group configuration file template, the template index of the container group configuration file template can be written into the instance template corresponding to the corresponding business service in advance, so that subsequent template indexes can be transferred between service instances and service components corresponding to the corresponding business service.
[0101] Specifically, container group configuration file templates provided by multiple business developers corresponding to the business type of the target business service can be obtained in advance, and the formats of the container group configuration file templates can be unified through a template unification tool, and the container group configuration file templates in the unified format can be submitted to a preset storage area for storage. For any business service, the template index corresponding to its container group configuration file template is obtained, and the template index is written into the corresponding instance template.
[0102] For the target business service, when obtaining the corresponding container group configuration file template through the container group configuration component, the container group configuration component can be used to obtain the template index of the container group configuration file template for the target business service from the container group declaration information, and obtain the container group configuration file template from the preset storage area based on the template index.
[0103] In the above embodiment, the formats of the container group configuration file templates respectively provided by multiple business developers corresponding to the business type to which the target business service belongs are unified in advance through a template unification tool, which can facilitate the subsequent container group configuration component to only need to perform logic writing based on one format. The template index of the container group configuration file template for the target business service is pre-written into the container group declaration information, which can facilitate the container group configuration component to quickly obtain the container group configuration file template to generate the configuration file required by the container group.
[0104] In one embodiment, the configuration of each component pod required by the business service may be different, and a configuration needs to be maintained for each pod. Pods often need to be aware of their own shard ID, allocated CPU, allocated Memory, and other information such as the IP and domain name of other pods in the cluster. This information is generally recorded in the pod configuration file and provided to the processes in the pod. The present application method generates a pod configuration file through the ConfigCenter component (container group configuration component).
[0105] refer to Figure 5 , ClusterParams represents the personalized parameter configuration of the demand side (i.e., the user of the business service). Usually, the upper-layer service obtains ClusterParams according to the demand side configuration, and then passes it to the instance controller Cluster Manager through Cluster. The instance controller Cluster Manager passes ClusterParams to the ConfigCenter component by accessing the API of the ConfigCenter component, which is an internal interface.
[0106] ConfigTemplates represents the configuration file template for pods, and supports Go Template rendering by default. Taking the database as an example, the ConfigTemplates of different databases are written by engineers of different databases. ConfigTemplates are submitted to the object storage (ObjectStorage) by the ConfigCli tool (i.e., the template unification tool). The ConfigCenter component can obtain ConfigTemplates from ObjectStorage through StorageProvider, which is an external storage interface for accessing the external object ObjectStorage.
[0107] ValueRender (the first rendering module) represents rendering the passed-in ClusterParams parameter with the pod runtime information, that is, merging ClusterParams with the container group runtime specific information to obtain the required variable value Value.
[0108] ConfigRender is the central module of the ConfigCenter component. It can be seen as a stateless string template rendering function. It renders the variable value Value obtained in the previous step with ConfigTemplates, that is, it merges the variable value Value with ConfigTemplates to generate the target configuration file ConfigArtifacts. ConfigArtifacts is a configuration file generated by the ConfigCenter component and can be directly sent to the corresponding Pod for use by the process. The ConfigCenter component sends ConfigArtifacts to the pod through the HTTP Server, which is an external interface.
[0109] In one embodiment, based on the container group configuration information, the corresponding container group to be configured is initialized to obtain the configured container group, including:
[0110] Create a target persistent volume declaration that matches the storage specifications in the container group configuration information; generate the target persistent volume content based on the target persistent volume template contained in the target persistent volume declaration, and associate the target persistent volume content with the hard disk that matches the storage specifications in the container group configuration information; bind the target persistent volume content and the target persistent volume declaration, write the target persistent volume declaration to the container group to be configured, and obtain a configured container group initialized on the storage specifications; the data in the configured container group is used to write to the hard disk.
[0111] The container group configuration information includes storage specifications, which are used to indicate the storage capacity of the pod for storing business data.
[0112] Volume is used to bind and mount a directory on a hard disk with a directory in a pod. Persistent Volume refers to a directory on the hard disk that is "persistent", that is, the contents of this directory will not be cleared due to the deletion of the pod. In this way, when the pod is restarted or rebuilt on other nodes, it can still access these contents by mounting this volume. "Persistence" means that the files written by the pod in its own directory will be saved on the hard disk, making this directory "persistent". Hard disks support multiple disks such as local hard disks and cloud hard disks. Cloud hard disks allow dynamic plug-in and pull-out. If a directory in a pod is bound and mounted with a directory on a cloud hard disk, the pod can be restored to other nodes, but for local hard disks, it can only be restored to the original node. Unless data migration is performed, the pod can be restored to other nodes.
[0113] The persistent volume template (StorageClass, SC) is a pre-set storage type template. Different hard disks are divided into specific storage types according to specifications, performance, etc., allowing businesses to choose according to needs and flexibly control costs. The persistent volume content (PersistentVolume, PV) represents the storage abstraction of the underlying hard disk and is associated with the real hard disk. The persistent volume claim (PersistentVolumeClaim, PVC) represents the underlying storage object abstracted for Pod use, declaring the required storage capacity (such as 100G), Node exclusive or shared, file system or block device, etc. It can be understood that SC is a PV creation template used to implement dynamic creation of PV. PV defines a directory for persistent storage on the hard disk. PVC describes the properties of the persistent storage that the Pod wants to use, such as the size of the Volume storage, read and write permissions, etc.
[0114] Specifically, the target business service can be a stateful service. A stateful service refers to a service that needs to persist data, sessions, or service status, and strictly relies on the correctness and consistency of the saved data when the service is started, run, and restored. For example, database services are stateful services, including various database services such as MySQL, MariaDB, PostgreSQL, SQLServer, ClickHouse, MongoDB, and Redis. Middleware services are also stateful services, including various message middleware services such as RabbitMQ, RocketMQ, ActiveMQ, Kafka, ZeroMQ, and MetaMq. Multiple Pods under the components required by stateful services usually need to persist business data, so a PVC needs to be set for each Pod to declare the required storage specifications.
[0115] When configuring PVC for a pod, create a target PVC that matches the storage specifications in the container group configuration information by calling the relevant interfaces provided by K8s, generate the corresponding target PV based on the target SC contained in the target PVC, associate the target PV with the hard disk (local hard disk or cloud hard disk) that matches the storage specifications in the container group configuration information, bind the target PV and the target PVC, write the target PVC to the container group to be configured, and obtain the configured container group initialized on the storage specifications.
[0116] refer to Figure 6 , the pod mounts the corresponding PVC to declare the required storage specifications, such as storage capacity of 20Gi and storage volume mode of file system (Filesystem). PVC is bound to the corresponding PV, and the underlying CSI plug-in implements the specific PV persistent storage. PV attributes include storage capacity (20Gi), storage type (StorageClass), and deletion retention policy (Retain means that the corresponding PV is retained when PVC is deleted). The PV is associated with the real hard disk (Disk) system at the bottom layer, and its attributes include region (region), availability zone (zone), capacity (20Gi), type (SSD), etc. In this way, the data written by the pod in its own directory can find the corresponding PV through PVC, find the hard disk through PV, and finally write it to the directory of the hard disk.
[0117] In the above embodiment, the storage specification of the container group is initialized, and the business data stored on the container group can be ultimately stored on a remote hard disk through a persistent volume declaration, which helps to achieve persistent data storage.
[0118] In one embodiment, the business service establishment method further includes:
[0119] Start each service component in order based on the service component startup dependency sequence provided by the component declaration information; monitor the running status of each service component through the probes set for each service component; after the probes set for the service components with high startup priority monitor the successful startup of each container group in the container group set managed by the service component, trigger the startup of the service component with the next startup priority; after each service component is successfully started, return the creation success message corresponding to the target business service to the demander.
[0120] Specifically, there is a startup dependency sequence between the service components required by the target business service. The target business service can only operate normally if the service components are started in order according to the startup dependency sequence. The service component startup dependency sequence is recorded in the component declaration information provided by the service instance corresponding to the target business service. The service component startup dependency sequence is used to start each service component in order after creating the service component and the container group set corresponding to the service component, so as to realize the operation of the target business service.
[0121] After creating the service component and the container group set corresponding to the service component, probes are set for each service component. The probes are used to monitor the running status of the service component. The running status of the service component is reflected by the running status of each container group in the container group set corresponding to the service component. After creating the service component and the container group set corresponding to the service component, start each service component in order according to the service component startup dependency sequence. Use the probe to detect the running status of the service component that needs to be started first. After each container group under the service component that needs to be started first is successfully started and runs normally, start the next service component. That is, after the probe set for the service component with a high startup priority monitors that each container group in the container group set managed by the service component is successfully started, it triggers the startup of the service component with the next startup priority. After each service component is successfully started, it means that the target business service can operate normally. At this time, the corresponding creation success message of the target business service can be returned to the demand side of the target business service.
[0122] Take ClickHouse database service as an example, refer to Figure 7The service model of ClickHouse database service includes Cluster1 representing ClickHouse database instance, set1 and set2 representing ClickHouse database components, and pod representing database process. ClickHouse database service consists of two components, zookeeper and clickhouse, and the zookeeper component needs to be started successfully before the clickhouse component that depends on the zookeeper component can be started. Use K8s readinessProbe probe to detect the component that starts first. When all Pod detection results under set1 are Running normally, start the next component in sequence.
[0123] It is understandable that if there is no front-end dependency between some components, probes may not be configured, and the Pods between these components can be started in parallel.
[0124] In the above embodiment, based on the service component startup dependency sequence provided by the component declaration information, each service component is started in order with the help of probes set for each service component, which can ensure that each service component is started in order and further ensure that the target business service can run successfully.
[0125] In one embodiment, the business service establishment method further includes:
[0126] A container group adjustment request for a target business service is obtained; the container group adjustment request carries a container group adjustment parameter; the container group declaration information contained in the service instance is updated based on the container group adjustment parameter; and the corresponding service component and the corresponding container group set are updated based on the updated container group declaration information.
[0127] Among them, the container group adjustment request is used to adjust the pod, which can be specifically to upgrade or downgrade or expand or shrink the pod. The container group adjustment parameters are used to indicate the adjustment requirements for the pod. Scaling or shrinking the pod means increasing or reducing the pod. If the number of replicas needs to be increased, the number of pods can be increased. Upgrading or downgrading the pod means increasing the storage specification of the pod or reducing the storage planning of the pod, such as vertical upgrading or downgrading of the CPU / Memory / Disk required by the pod.
[0128] Specifically, as the business volume of the target business service increases or decreases, the pod in the service model corresponding to the target business service can be flexibly adjusted accordingly. The processing server can obtain a container group adjustment request for the target business service, which carries container group adjustment parameters, and updates the container group declaration information contained in the service instance based on the container group adjustment parameters. For example, if the container group adjustment request is used for pod expansion, the number of pods in the container group declaration information is adjusted; if the container group adjustment request is used for pod upgrade, the pod storage specification in the container group declaration information is adjusted. If the service instance changes, the service component and the corresponding container group set are updated synchronously. For example, the component controller monitors changes in information in the service instance in real time. If it is detected that the corresponding container group declaration information in the service instance has changed, the corresponding container group set is synchronously updated based on the updated container group declaration information.
[0129] For example, taking the database service as an example, the Cluster Manager (instance controller) implemented based on K8s CRD controls the underlying K8s StatefulSet to implement the dynamic expansion and contraction of the database (that is, the addition and subtraction of the number of replicas, also called horizontal expansion and contraction) and the vertical promotion and demotion of the database (adjustment of Pod specifications such as CPU / Memory / Disk). For dynamic expansion of the database, please refer to Figure 8 , two pods under set1 are added. For vertical upgrade of the database, please refer to Fig. 9 , the storage specification of the pod under set1 increases from 4C8G to 8C16G. Correspondingly, the dynamic scaling of the database is a reduction in the number of replicas, and the vertical downgrading of the database is a reduction in specifications.
[0130] Furthermore, in order not to affect the normal use of upper-layer businesses, when performing dynamic scaling or vertical upgrade and downgrade operations, the relevant pod network traffic will be removed in advance. After the underlying scaling or downgrade pod detects that Running is operating normally, the business traffic will be connected to achieve smooth operation and maintenance operations without affecting the business. Taking the database service as an example, when the database service is running, if it is necessary to query the data stored in the database, the target pod can be determined from the various pods used for data storage and computing based on the load balancing strategy, and the required data can be queried from the target pod. If pod1 for data storage and computing needs to be vertically upgraded or downgraded, when determining the target pod, the target pod is determined from the various pods used for data storage and computing other than pod1. After pod1 completes vertical upgrade and downgrade, pod1 can be considered when determining the target pod.
[0131] In the above embodiment, the container group set corresponding to the service component supports dynamic expansion and contraction and vertical upgrading and downgrading, and has strong flexibility.
[0132] In one embodiment, the business service establishment method further includes:
[0133] When the destruction of the service instance is triggered, the service instance is backed up to obtain a backup instance; the container groups in the container group set corresponding to each service component are respectively used as the first container group; a persistent volume snapshot declaration corresponding to the first container group is created based on the persistent volume declaration corresponding to the first container group, and the persistent volume snapshot content corresponding to the first container group is created based on the persistent volume content corresponding to the first container group, and the persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group are bound, and a data snapshot corresponding to the first container group is generated based on the bound persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group, and the container group operation identification information corresponding to the first container group and the data snapshot are associated and stored; the data snapshots corresponding to each container group in the backup instance and the container group set corresponding to each service component are associated and stored.
[0134] Among them, snapshot is used to record the system status and data at a certain point in time. Persistent Volume Snapshot Declaration (VolumeSnapshot, VSS) represents the abstract resource object of persistent volume snapshot. Persistent Volume Snapshot Content (VolumeSnapshotContent, VSC) represents the abstract resource object of persistent volume snapshot content, which is associated with the real backend snapshot storage resources, such as COS / NFS, etc. COS (Cloud Object Storage) is a cloud object storage service, which is a distributed and massive access system for unstructured objects. NFS (Network File System) is a network file system, which is a distributed and massive access system. Container group operation identification information is used to identify the container group, for example, it can be the name of the pod.
[0135] Specifically, when the destruction of the service instance corresponding to the target business service is triggered, a snapshot backup is automatically initiated to back up the data stored in the service instance and the container group set for subsequent recovery of the service instance. When the destruction of the service instance corresponding to the target business service is triggered, the service instance is backed up to obtain a backup instance, which includes the same metadata as the service instance and is used to restore the service model corresponding to the target business service.
[0136] When triggering the destruction of the service instance corresponding to the target business service, the business data stored in the pod is backed up so that the business data stored in the pod can be synchronously restored when the service model is restored. The container groups in the container group set corresponding to each service component are respectively used as the first container group. For any first container group, call the relevant interface provided by K8s to create the VSS corresponding to the first container group based on the PVC corresponding to the first container group, call the relevant interface provided by K8s to create the VSC corresponding to the first container group based on the PV corresponding to the first container group, bind the VSS and VSC corresponding to the first container group, and generate the data snapshot corresponding to the first container group based on the bound VSS and VSC corresponding to the first container group. Furthermore, the container group operation identification information corresponding to the first container group is associated with the data snapshot and stored, and the container group operation identification information is used to indicate which pod the data snapshot belongs to.
[0137] Finally, the data snapshots corresponding to each container group in the container group set corresponding to each service component are associated and stored for subsequent data recovery.
[0138] It can be understood that in addition to initiating a snapshot backup of the business data in the pod when the destruction of the service instance is triggered, a snapshot backup of the business data in the pod can also be initiated at a scheduled time. Data snapshots can be made based on Block technology or based on XFS Reflink technology.
[0139] For example, to generate a data snapshot of business data in a pod, refer to Fig.10 , by calling the relevant interfaces provided by K8s, create VSS from the PVC mounted by the pod, create VSC from the PV bound to the PVC mounted by the pod, bind VSS and VSC, and use VSC to create Snapshot based on the data stored in the relevant directory of the hard disk associated with the PV corresponding to the pod. Snapshot requests are initiated at different time points, and the generated Snapshot stores the data at the corresponding time points. That is, N number of Snapshots can be generated for the same hard disk, and each Snapshot stores the data at different time points on the relevant directory of the hard disk.
[0140] In the above embodiment, when the destruction of the service instance is triggered, the business data stored in the service instance and the container group set are backed up in time, which helps to quickly restore the service instance later.
[0141] In one embodiment, the business service establishment method further includes:
[0142] When triggering recovery of a service instance, obtain a backup instance; create a service component based on the component declaration information contained in the backup instance to obtain each recovery component; create a container group set corresponding to the recovery component based on the container group declaration information contained in the recovery component to obtain a container group set corresponding to each recovery component; use the container groups in the container group set corresponding to each recovery component as second container groups; obtain the corresponding data snapshot based on the container group operation identification information corresponding to the second container group, generate a persistent volume snapshot declaration and persistent volume snapshot content corresponding to the second container group based on the data snapshot corresponding to the second container group, generate a persistent volume content corresponding to the second container group based on the persistent volume snapshot content corresponding to the second container group, generate a persistent volume declaration corresponding to the second container group based on the persistent volume snapshot declaration corresponding to the second container group, bind the persistent volume content and persistent volume declaration corresponding to the second container group, and apply the persistent volume declaration corresponding to the second container group to the second container group.
[0143] Specifically, the process of restoring the service instance can be initiated at any time according to user needs. When the recovery of the service instance corresponding to the target business service is triggered, the backup instance that has been backed up in advance is obtained, the service model is restored based on the backup instance, the data snapshot that has been backed up in advance is obtained, and the business data stored on the pod in the service model is restored based on the data snapshot.
[0144] When restoring the service model based on the backup instance, similar to the process of creating service components and corresponding container group sets through service instances, service components are created based on the component declaration information contained in the backup instance to obtain various recovery components, and container group sets corresponding to the recovery components are created based on the container group declaration information contained in the recovery components to obtain container group sets corresponding to various recovery components. The backup instance, various recovery components and container group sets corresponding to various recovery components constitute the service model recovered for the target business service.
[0145] When restoring business data based on data snapshots, the container groups in the container group set corresponding to each recovery component are respectively used as the second container group. For any second container group, the corresponding data snapshot is obtained based on the container group operation identification information corresponding to the second container group, and the relevant interface provided by K8s is called to generate the VSS and VSC corresponding to the second container group based on the data snapshot corresponding to the second container group, and the relevant interface provided by K8s is called to generate the PV corresponding to the second container group based on the VSC corresponding to the second container group, and the PVC corresponding to the second container group is generated based on the VSS corresponding to the second container group. The PVC and PV corresponding to the second container group are bound, and the PVC corresponding to the second container group is applied to the second container group. The second container group can read the business data from the corresponding hard disk and store it in its own directory. It can be understood that the container group operation identification information of the pod created based on the same metadata is the same. For example, before destruction, the name of the first pod is pod1, and when it is restored, the name of the first pod is also pod1.
[0146] For example, refer to Fig.11 , based on cluster1, three pods are created through the corresponding set. When cluster1 is destroyed, cluster1 is backed up, and snapshots corresponding to pod1, pod2, and pod3 are generated respectively. During the validity period of the data snapshot, the process of restoring cluster1 can be initiated at any time according to the needs. Cluster2 is generated based on the backup of cluster1, and a set is created based on cluster2. Three pods are created based on the set, namely pod1', pod2', and pod3'. For the business data that pod1', pod2', and pod3' need to store, the snapshots corresponding to pod1', pod2', and pod3' are obtained. Starting from the snapshot, VSS and VSC are created based on the creation, and VSS and VSC are bound to each other. Then, PVC is created with VSS as the data source, and PV is created with VSC as the data source. PVC and PV are bound to each other, and PVC is mounted under the corresponding pod. Finally, pod1', pod2', and pod3' will run, and finally cluster2 will run normally.
[0147] In the above embodiment, when the recovery of the service instance is triggered, based on the backup instance and data snapshot backed up in advance, the service model storing the business data consistent with that before the destruction can be quickly restored to ensure the continued operation of the target business service.
[0148] In one embodiment, the target business service is a target database service, the service instance is used to indicate metadata required to establish the target database service, each service component is responsible for implementing each function of the target database service, and each container group belonging to the same container group set is used to cooperate to implement the functions provided by the corresponding service component.
[0149] Specifically, with the widespread popularization and production practice of cloud-native technology, more and more database services need to migrate from traditional physical machine process management to cloud-native containerized management to achieve cloud-native rapid iteration, efficient deployment, elastic scaling, and underlying difference shielding. The method of the present application can be used for the containerized implementation of database services and is applicable to a variety of database services. Database services are usually composed of multiple components, so the containerization of multiple components needs to be considered to implement the containerized management of database services. Different components are responsible for implementing different functions of the target database service. For example, a database service includes a database coordination component and a database engine component. The database service is generally implemented through a node cluster. The database coordination component is used to coordinate the communication between the node clusters, and the database engine component is used to store and calculate the business data in the database to achieve business data management. Each container group belonging to the same container group set is used to cooperate to implement the functions provided by the corresponding service component. For example, for the database engine component, multiple shard pods and multiple replica pods can be set. A shard pod is responsible for managing a part of the business data. The business data managed by each shard pod is combined into complete business data stored in the database. A replica pod is used for data backup of a part of the business data. For the same part of the business data, multiple replica pods can be set for multiple backups.
[0150] In a specific embodiment, the method of the present application can be applied to a scenario where a cloud vendor provides database services to customers. Database services are a typical stateful service that requires data, sessions, or service states to be persistently stored.
[0151] Traditional technology generally uses StatefulSet in K8s to implement single component management and persistent storage of stateful services. The core capabilities are fixed Pod names and persistent data storage, but it cannot achieve common management capabilities for multiple databases and multiple components, such as component dependencies, differentiated configurations, dynamic expansion and contraction, dynamic upgrade and downgrade, data backup and recovery, etc. This application method realizes the general model abstraction of database services and the above-mentioned database core management capabilities.
[0152] It can be understood that database services are composed of multiple components: common database services are generally composed of one or more components, so the containerization management of database services needs to consider the containerization of multiple components. The method of this application abstracts common database services into a general three-layer resource model, which is cluster->sets->pods from top to bottom, corresponding to database instances, database components, and database process pods, respectively. Through such a three-layer resource model, the containerization of multiple database services can be supported. When a customer purchases a database service from a cloud vendor, he can choose the database type and personalized demand information for the database service. After receiving the customer's request, the cloud vendor's processing server obtains the instance template corresponding to the database type required by the customer, and quickly creates the database instance required by the customer based on the customer's personalized demand information and the instance template. The database instance declares the various metadata required to implement the database service required by the user, creates the database component based on the component declaration information in the database instance, and creates the database process pod corresponding to the database component based on the pod declaration information inherited by the database component from the database instance.
[0153] In addition, there is usually a startup dependency order between the components of the database service. For example, the ClickHouse database service consists of two components, zookeeper and clickhouse. The zookeeper component needs to be started successfully before the clickhouse component that depends on the zookeeper component can be started. The database instance records the startup dependency order of the database components. This application method uses the K8s readinessProbe probe to detect the component that starts first. When all the pod detection results under the component are Running normally, the next component is started in sequence.
[0154] In addition, there are differentiated configurations between components of the database service. Multiple components of the database service have specific configurations, and different pods in each component may have different configurations. After creating the pod, the application method generates the configuration file required by the pod and quickly sends the configuration file to the pod to achieve differentiated configuration for the pod.
[0155] In addition, the database needs to be dynamically scaled up or down. As the upper-layer business volume supported by the database service increases or decreases, the underlying database service needs to support the dynamic scaling of the number of replicas without affecting the normal operation of the upper-layer business. The database also needs to be upgraded vertically. The database service not only needs to scale up or down the number of replicas, but also vertically upgrade or downgrade the specifications of the existing pods (such as CPU / Memory / Disk), such as upgrading CPU / Memory from 4C8G to 8C16G, without affecting the normal operation of the upper-layer business. If the database needs to be dynamically scaled up or down or vertically upgraded, you can modify the database instance. If the database instance is updated, it will be updated synchronously to achieve dynamic scaling or vertical upgrade. When performing dynamic scaling or vertical upgrade, the relevant Pod network traffic will be removed in advance. After the dynamic scaling or vertical upgrade is completed, the relevant Pod will be connected to the business traffic to achieve smooth operation and maintenance without affecting the business.
[0156] In addition, the database needs to be backed up and restored. In order to ensure the security and reliability of the data, the database service needs to take snapshots regularly during normal operation, such as taking a full database snapshot backup every hour; automatic snapshot backup is also required when the database service is destroyed, so that the database instance with complete data can be quickly restored based on the backup when needed. The present application method can back up the database instance on demand and back up the business data stored in the database process pod. It can be understood that the database components and database process pods are created based on the database instance. Only the database instance needs to be backed up to quickly restore the database components and database process pods, but the business data stored in the database process pod needs to be restored separately. The generated snapshot backup can support a variety of back-end storage, such as COS object storage, NFS, cloud snapshots, etc. Its cost is much lower than that of ordinary cloud hard disks, so it can bring significant cost reduction and efficiency improvement effects to the business.
[0157] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0158] Based on the same inventive concept, the embodiment of the present application also provides a business service establishment device for implementing the business service establishment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more business service establishment device embodiments provided below can refer to the limitations on the business service establishment method above, and will not be repeated here.
[0159] In one embodiment, Fig.12 As shown, a business service establishment device is provided, including: a data acquisition module 1202, an instance creation module 1204, a component creation module 1206, a container creation module 1208 and a model determination module 1210, wherein:
[0160] The data acquisition module 1202 is used to acquire service demand information for the target business service and acquire an instance template preset for the target business service as a target instance template.
[0161] The instance creation module 1204 is used to create a service instance corresponding to the target business service based on the service demand information and the target instance template.
[0162] The component creation module 1206 is used to create service components based on the component declaration information contained in the service instance to obtain various service components corresponding to the target business service; the component declaration information is used to instruct the creation of service components that match various component types specified by the target instance template.
[0163] The container creation module 1208 is used to create a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtain the container group set corresponding to each service component; the container group declaration information contained in the service component is obtained from the service instance.
[0164] The model determination module 1210 is used to obtain the service model corresponding to the target business service based on the service instance, each service component, and the container group set corresponding to each service component; the service model is used to provide the target business service to the demander corresponding to the service demand information.
[0165] In one embodiment, the instance creation module 1204 is further configured to:
[0166] Fill the service requirement information into the target instance template to obtain the service instance corresponding to the target business service; the target instance template includes a component declaration area and a container group declaration area; the component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.
[0167] In one embodiment, the component creation module 1206 is further configured to:
[0168] Based on the component declaration information contained in the service instance, determine the component types required for the target business service and the component configuration information corresponding to each component type; based on each component configuration information, create service components that match the corresponding component type to obtain the service components corresponding to the target business service.
[0169] In one embodiment, the container creation module 1208 is further configured to:
[0170] For any service component in each service component, based on the container group declaration information contained in the service component, determine the number of container groups required by the service component, and create each container group to be configured that matches the number of container groups; based on the container group declaration information contained in the service component, determine the container group configuration information corresponding to each container group to be configured, and based on the container group configuration information, initialize the corresponding container group to be configured to obtain a configured container group; based on each configured container group, obtain a container group set corresponding to the service component.
[0171] In one embodiment, the container creation module 1208 is further configured to:
[0172] For any container group to be configured, the container group runtime specific information corresponding to the container group to be configured is obtained through the container group configuration component, and the personalized information and the container group runtime specific information in the container group configuration information are rendered to obtain the container group personalized configuration information corresponding to the container group to be configured; the container group configuration file template corresponding to the target business service is obtained through the container group configuration component, and the container group personalized configuration information and the container group configuration file template are rendered to obtain the target configuration file corresponding to the container group to be configured; the target configuration file is sent to the container to be configured through the container group configuration component to obtain the configured container group initialized on the configuration file.
[0173] In one embodiment, the container creation module 1208 is further configured to:
[0174] A template index of a container group configuration file template for a target business service is obtained from the container group declaration information through a container group configuration component, and based on the template index, the container group configuration file template is obtained from a preset storage area; wherein the container group configuration file template is submitted to the preset storage area for storage through a template unification tool, and the template unification tool is used to unify the formats of container group configuration file templates respectively provided by multiple business developers corresponding to the business type to which the target business service belongs.
[0175] In one embodiment, the container creation module 1208 is further configured to:
[0176] Create a target persistent volume declaration that matches the storage specifications in the container group configuration information; generate the target persistent volume content based on the target persistent volume template contained in the target persistent volume declaration, and associate the target persistent volume content with the hard disk that matches the storage specifications in the container group configuration information; bind the target persistent volume content and the target persistent volume declaration, write the target persistent volume declaration to the container group to be configured, and obtain a configured container group initialized on the storage specifications; the data in the configured container group is used to write to the hard disk.
[0177] In one embodiment, the business service establishment device is further used to:
[0178] Start each service component in order based on the service component startup dependency sequence provided by the component declaration information; monitor the running status of each service component through the probes set for each service component; after the probes set for the service components with high startup priority monitor the successful startup of each container group in the container group set managed by the service component, trigger the startup of the service component with the next startup priority; after each service component is successfully started, return the creation success message corresponding to the target business service to the demander.
[0179] In one embodiment, the business service establishment device is further used to:
[0180] A container group adjustment request for a target business service is obtained; the container group adjustment request carries a container group adjustment parameter; the container group declaration information contained in the service instance is updated based on the container group adjustment parameter; and the corresponding service component and the corresponding container group set are updated based on the updated container group declaration information.
[0181] In one embodiment, the business service establishment device is further used to:
[0182] When the destruction of the service instance is triggered, the service instance is backed up to obtain a backup instance; the container groups in the container group set corresponding to each service component are respectively used as the first container group; a persistent volume snapshot declaration corresponding to the first container group is created based on the persistent volume declaration corresponding to the first container group, and the persistent volume snapshot content corresponding to the first container group is created based on the persistent volume content corresponding to the first container group, and the persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group are bound, and a data snapshot corresponding to the first container group is generated based on the bound persistent volume snapshot declaration and the persistent volume snapshot content corresponding to the first container group, and the container group operation identification information corresponding to the first container group and the data snapshot are associated and stored; the data snapshots corresponding to each container group in the backup instance and the container group set corresponding to each service component are associated and stored.
[0183] In one embodiment, the business service establishment device is further used to:
[0184] When triggering recovery of a service instance, obtain a backup instance; create a service component based on the component declaration information contained in the backup instance to obtain each recovery component; create a container group set corresponding to the recovery component based on the container group declaration information contained in the recovery component to obtain a container group set corresponding to each recovery component; use the container groups in the container group set corresponding to each recovery component as second container groups; obtain the corresponding data snapshot based on the container group operation identification information corresponding to the second container group, generate a persistent volume snapshot declaration and persistent volume snapshot content corresponding to the second container group based on the data snapshot corresponding to the second container group, generate a persistent volume content corresponding to the second container group based on the persistent volume snapshot content corresponding to the second container group, generate a persistent volume declaration corresponding to the second container group based on the persistent volume snapshot declaration corresponding to the second container group, bind the persistent volume content and persistent volume declaration corresponding to the second container group, and apply the persistent volume declaration corresponding to the second container group to the second container group.
[0185] In one embodiment, the target business service is a target database service, the service instance is used to indicate metadata required to establish the target database service, each service component is responsible for implementing each function of the target database service, and each container group belonging to the same container group set is used to cooperate to implement the functions provided by the corresponding service component.
[0186] The above-mentioned business service establishment device pre-sets instance templates corresponding to various business services so as to quickly establish corresponding business services. For the target business service, the personalized service demand information of the target business service and the instance template corresponding to the target business service are combined to obtain the service instance corresponding to the target business service, and the service components corresponding to the target business service are created based on the component declaration information contained in the service instance. The container group set corresponding to the service component is created based on the container group declaration information contained in the service component. The service model for providing the target business service is formed by the service instance corresponding to the target business service, each service component, and the container group set corresponding to each service component. The business service is abstracted into a three-layer structure model, which includes service instances, service components, and container group sets corresponding to service components. The service instance management creates relevant information about service components and container group sets, and each component management creates relevant information about its own container group set, so as to realize orderly business service establishment. Various business services can be abstracted into a three-layer structure model, which has strong versatility, ensures the versatility of business service establishment, and improves the efficiency of business service establishment. Based on such a three-layer structure model, business services are realized in a containerized manner in a cloud-native manner.
[0187] Each module in the above-mentioned business service establishment device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0188] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as instance templates and configuration file templates. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for establishing a business service is implemented.
[0189] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0190] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0191] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0192] In one embodiment, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0194] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0195] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0196] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for establishing a business service, characterized in that: The method comprises: Acquire service demand information for a target business service, and acquire an instance template preset for the target business service as a target instance template; Creating a service instance corresponding to the target business service based on the service demand information and the target instance template; Creating a service component based on component declaration information included in the service instance to obtain each service component corresponding to the target business service; the component declaration information is used to instruct the creation of service components that match each component type specified by the target instance template; Creating a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtaining a container group set corresponding to each of the service components; the container group declaration information contained in the service component is obtained from the service instance; Based on the service instance, the service components, and the container group sets corresponding to the service components, a service model corresponding to the target business service is obtained; the service model is used to provide the target business service to the demander corresponding to the service demand information.
2. The method according to claim 1, characterized in that The creating a service instance corresponding to the target business service based on the service requirement information and the target instance template includes: Fill the service requirement information into the target instance template to obtain the service instance corresponding to the target business service; the target instance template includes a component declaration area and a container group declaration area; the component declaration area is used to indicate component declaration information, and the container group declaration area is used to indicate container group declaration information.
3. The method according to claim 1, characterized in that The creating a service component based on the component declaration information included in the service instance to obtain each service component corresponding to the target business service includes: Based on the component declaration information included in the service instance, determining each component type required by the target business service and component configuration information corresponding to each component type; Based on the configuration information of each component, service components matching the corresponding component types are created respectively to obtain service components corresponding to the target business service.
4. The method according to claim 1, characterized in that The step of creating a container group set corresponding to the service component based on the container group declaration information contained in the service component to obtain a container group set corresponding to each service component includes: For any one of the service components, based on the container group declaration information included in the service component, determine the number of container groups required by the service component, and create each container group to be configured that matches the number of container groups; Based on the container group declaration information included in the service component, determine the container group configuration information corresponding to each container group to be configured, and initialize the corresponding container group to be configured based on the container group configuration information to obtain a configured container group; Based on each configured container group, the container group set corresponding to the service component is obtained.
5. The method according to claim 4, characterized in that Initializing the corresponding container group to be configured based on the container group configuration information to obtain the configured container group includes: For any container group to be configured, the container group runtime specific information corresponding to the container group to be configured is obtained through the container group configuration component, and the personalized information in the container group configuration information and the container group runtime specific information are rendered to obtain the container group personalized configuration information corresponding to the container group to be configured; Obtaining a container group configuration file template corresponding to the target business service through the container group configuration component, rendering the container group personalized configuration information and the container group configuration file template, and obtaining a target configuration file corresponding to the container group to be configured; The target configuration file is sent to the container to be configured through the container group configuration component, and a configured container group initialized on the configuration file is obtained.
6. The method according to claim 5, characterized in that The obtaining, through the container group configuration component, a container group configuration file template corresponding to the target business service includes: Obtaining, by the container group configuration component, a template index of a container group configuration file template for the target business service from the container group declaration information, and obtaining the container group configuration file template from a preset storage area based on the template index; The container group configuration file template is submitted to the preset storage area for storage through a template unification tool, and the template unification tool is used to unify the formats of container group configuration file templates respectively provided by multiple business developers corresponding to the business type to which the target business service belongs.
7. The method according to claim 4, characterized in that Initializing the corresponding container group to be configured based on the container group configuration information to obtain the configured container group includes: Creating a target persistent volume declaration that matches the storage specification in the container group configuration information; Generate target persistent volume content based on the target persistent volume template included in the target persistent volume declaration, and associate the target persistent volume content with a hard disk that matches the storage specification in the container group configuration information; The target persistent volume content and the target persistent volume declaration are bound, and the target persistent volume declaration is written into the container group to be configured to obtain a configured container group initialized on the storage specification; the data in the configured container group is used to write into the hard disk.
8. The method according to claim 1, characterized in that The method further comprises: Based on the service component startup dependency sequence provided by the component declaration information, start the service components in order; The running status of each service component is monitored by the probes set for each service component. After the probes set for the service components with high startup priority detect that each container group in the container group set managed by the service component is successfully started, the service component with the next startup priority is triggered to start. After each of the service components is successfully started, a creation success message corresponding to the target business service is returned to the demander.
9. The method according to claim 1, characterized in that: The method further comprises: Acquire a container group adjustment request for the target business service; the container group adjustment request carries a container group adjustment parameter; updating the container group declaration information included in the service instance based on the container group adjustment parameter; Based on the updated container group declaration information, the corresponding service component and the corresponding container group set are updated.
10. The method according to claim 1, characterized in that The method further comprises: When the destruction of the service instance is triggered, backing up the service instance to obtain a backup instance; Using the container groups in the container group sets corresponding to the respective service components as first container groups respectively; Creating a persistent volume snapshot declaration corresponding to the first container group based on the persistent volume declaration corresponding to the first container group, creating persistent volume snapshot content corresponding to the first container group based on the persistent volume content corresponding to the first container group, binding the persistent volume snapshot declaration corresponding to the first container group and the persistent volume snapshot content, generating a data snapshot corresponding to the first container group based on the bound persistent volume snapshot declaration and persistent volume snapshot content corresponding to the first container group, and associating and storing the container group operation identification information corresponding to the first container group with the data snapshot; The data snapshots corresponding to the backup instance and each container group in the container group set corresponding to each service component are associated and stored.
11. The method according to claim 10, characterized in that The method further comprises: When recovery of the service instance is triggered, obtaining the backup instance; Creating a service component based on the component declaration information included in the backup instance to obtain various recovery components; Creating a container group set corresponding to the recovery component based on the container group declaration information included in the recovery component, and obtaining a container group set corresponding to each recovery component; Using the container groups in the container group sets corresponding to the respective recovery components as second container groups respectively; Based on the container group running identification information corresponding to the second container group, a corresponding data snapshot is obtained; based on the data snapshot corresponding to the second container group, a persistent volume snapshot declaration and persistent volume snapshot content corresponding to the second container group are generated; based on the persistent volume snapshot content corresponding to the second container group, a persistent volume content corresponding to the second container group is generated; based on the persistent volume snapshot declaration corresponding to the second container group, a persistent volume declaration corresponding to the second container group is generated; the persistent volume content corresponding to the second container group and the persistent volume declaration are bound; and the persistent volume declaration corresponding to the second container group is applied to the second container group.
12. The method according to claim 1, characterized in that The target business service is a target database service, the service instance is used to indicate metadata required to establish the target database service, the various service components are used to be responsible for implementing the various functions of the target database service, and the various container groups belonging to the same container group set are used to cooperate to implement the functions provided by the corresponding service components.
13. A business service establishment device, characterized in that: The device comprises: A data acquisition module, used to acquire service demand information for a target business service, and acquire an instance template preset for the target business service as a target instance template; An instance creation module, used to create a service instance corresponding to the target business service based on the service demand information and the target instance template; A component creation module, used to create a service component based on the component declaration information contained in the service instance, and obtain each service component corresponding to the target business service; the component declaration information is used to instruct the creation of service components that match each component type specified by the target instance template; A container creation module, configured to create a container group set corresponding to the service component based on the container group declaration information contained in the service component, and obtain a container group set corresponding to each of the service components; the container group declaration information contained in the service component is obtained from the service instance; A model determination module is used to obtain a service model corresponding to the target business service based on the service instance, the various service components, and the container group set corresponding to each of the service components; the service model is used to provide the target business service to the demander corresponding to the service demand information.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
