Service configuration updating method, system and electronic device for application program
By receiving service configuration deployment requests from the target cluster, synchronizing them to the data center cluster, and storing them in the server cluster memory, the problem of application service interruption caused by directly modifying configuration files is solved, ensuring the stability and reliability of the service.
Patent Information
- Application Number
- CN202311142003.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-09-05
AI Technical Summary
In existing technologies, directly modifying the configuration files of computing nodes can easily lead to errors, causing applications to fail to provide services properly.
The service configuration deployment request is received by the target cluster, the service configuration is synchronized to the data center cluster, and stored in memory by the server cluster, avoiding direct modification of the server cluster's configuration file.
This ensures that the application can provide normal service without directly modifying the server cluster configuration file, thus avoiding configuration errors.
Smart Images

Figure CN117407017B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more particularly to a method, system, and electronic device for updating service configuration of an application. Background Technology
[0002] In existing technologies, application systems are increasingly equipped with configurations, which are often stored in configuration files and distributed along with the application. These configuration files typically reside on compute nodes, and service initialization and subsequent business changes all depend on them. Directly modifying these configuration files on compute nodes can easily lead to errors, causing the application to fail to provide services properly.
[0003] In other words, in existing technologies, directly modifying the configuration files of computing nodes can easily lead to errors, causing applications to be unable to provide services normally. Summary of the Invention
[0004] This application provides a method, system, and electronic device for updating the service configuration of an application, in order to solve the technical problem that directly modifying the configuration file of a computing node can easily lead to errors, causing the application to be unable to provide services normally.
[0005] In a first aspect, this application provides a method for updating the service configuration of an application, comprising: upon receiving an online request indicating that the service configuration is online in a target cluster, synchronizing the service configuration in the target cluster to a data center cluster, wherein the target cluster is a cluster located outside multiple data centers, and each of the multiple data centers includes one data center cluster; storing the service configuration in the data center cluster in the memory of each server cluster in the server cluster, wherein the server cluster is a cluster on which the application is deployed; upon receiving an access request in any of the server clusters, retrieving the service configuration from the memory to provide a target service using the service configuration, wherein the target service is a service corresponding to the service configuration, and the access request is used to access the target service of the application on any of the server clusters.
[0006] Secondly, this application provides a service configuration update system for an application, comprising: a target cluster, configured to synchronize the service configuration in the target cluster to a data center cluster upon receiving an online request indicating that the service configuration is online, wherein the target cluster is a cluster located outside of multiple data centers, and each of the multiple data centers includes one data center cluster; a data center cluster, configured to store the service configuration; and a server cluster, configured to store the service configuration in the data center cluster in the memory of the server cluster, wherein the server cluster is a cluster on which the application is deployed; and upon receiving an access request, retrieving the service configuration from the memory to provide a target service using the service configuration, wherein the target service is a service corresponding to the service configuration, and the access request is used to access the target service of an application on any one of the server clusters.
[0007] As an optional example, the target cluster is further configured to: determine the target configuration that has changed in the service configuration of the target cluster, wherein the service configuration of the target cluster includes the data center service configuration of each data center and the shared service configuration shared by all data centers; if the target configuration is a data center service configuration, determine the target data center corresponding to the target configuration and synchronize the target configuration to the data center cluster of the target data center; if the target configuration is a shared service configuration, synchronize the target configuration to the data center cluster of each data center.
[0008] As an optional example, the service configurations of the target cluster and the data center cluster are stored in a tree-like hierarchical structure. The target cluster is further used to: synchronize the data center service configurations in the service configurations of the target cluster to the data center clusters that match the data center service configurations according to the tree-like hierarchical structure of the service configurations of the target cluster before determining the target configurations that have changed in the service configurations of the target cluster; or, synchronize the shared service configurations in the service configurations of the target cluster to each of the data center clusters according to the tree-like hierarchical structure of the service configurations of the target cluster.
[0009] As an optional example, each data center cluster is identified as the current cluster. The current cluster is further used to: obtain a first path or a second path in the current cluster, wherein the first path is used to indicate the path in the target cluster to be synchronized to the data center service configuration in the current cluster, and the second path is used to indicate the path to be synchronized to the shared service configuration in the current cluster; synchronize the data center service configuration to the current cluster according to the first path or synchronize the shared service configuration to the current cluster according to the second path.
[0010] As an optional example, the current cluster described above is also used to: determine each string segmented by a predetermined symbol in the first path as a node; perform node resolution operations from the first node to the last node in the first path; and load each non-repeating node into the current cluster as each non-repeating node is resolved; or, determine each string segmented by a predetermined symbol in the second path as a node; perform node resolution operations from the first node to the last node in the second path; and load each non-repeating node into the current cluster as each non-repeating node is resolved.
[0011] As an optional example, the server cluster is also used to pull the service configuration of the aforementioned data center cluster from the aforementioned data center cluster at predetermined intervals; if the pull of the aforementioned service configuration is successful, the pulled service configuration is used to overwrite the original service configuration in memory; if the pull of the aforementioned service configuration fails, the original service configuration in memory is retained.
[0012] As an optional example, the target cluster described above is also used to: save the service configuration as an executable file; copy and paste the executable file format of the service configuration into the data center cluster described above.
[0013] Thirdly, this application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement a service configuration update method for any of the above-described application programs when executing the computer program.
[0014] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for executing the service configuration update method of the application described in any one of the above claims.
[0015] Compared with the prior art, the above-mentioned technical solution provided in this application has the following advantages: The method provided in this application can modify the service configuration uniformly through the target cluster. When the target cluster receives a service configuration online request, the modified service configuration can be synchronized to the data center cluster. The service configuration synchronized to the data center cluster will be saved in the memory of the server cluster for the server cluster to call to provide the target service. Therefore, it is not necessary to directly modify the configuration file in the server cluster, avoid errors, and ensure that the application of the server cluster provides normal service. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0019] Figure 1 A flowchart illustrating a service configuration update method for an application provided in this application embodiment;
[0020] Figure 2 A cluster relationship diagram for a service configuration update method for an application provided in this application embodiment;
[0021] Figure 3 A cluster node diagram for a service configuration update method for an application provided in this application embodiment;
[0022] Figure 4 A flowchart illustrating another application service configuration update method provided in this application embodiment;
[0023] Figure 5 A tree-structure diagram of a service configuration update method for an application provided in this application embodiment;
[0024] Figure 6 A service configuration synchronization diagram for an application service configuration update method provided in this application embodiment;
[0025] Figure 7 A flowchart illustrating another application service configuration update method provided in this application embodiment;
[0026] Figure 8 A flowchart illustrating a service configuration update system for an application provided in this application embodiment;
[0027] Figure 9 A schematic diagram of the structure of a service configuration update system for an application provided in this application embodiment;
[0028] Figure 10This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0031] To address the technical problem in existing technologies where direct modification of computing node configuration files can easily lead to errors and cause applications to fail to provide services, this application provides a method for updating application service configurations that eliminates the need for direct modification of computing node configuration files, thus avoiding errors.
[0032] Figure 1 This is a flowchart illustrating a service configuration update method for an application provided in an embodiment of this application. Figure 1 As shown, the service configuration update method for the above application includes:
[0033] S102, when the target cluster receives an online request indicating that the service configuration is online, the service configuration in the target cluster is synchronized to the data center cluster. Each of the multiple data centers includes a data center cluster, and the data center cluster is a cluster in each of the multiple data centers.
[0034] S104, where the server cluster in each data center stores the service configuration of the data center cluster in the memory of the server cluster, where the server cluster is a cluster that has the application deployed.
[0035] S106, when any server cluster receives an access request, the service configuration is called from memory to provide the target service using the service configuration. The target service is the service corresponding to the service configuration, and the access request is used to access the target service of the application on any server cluster.
[0036] The above-described method for updating service configurations can be applied to the process of updating service configurations in a server cluster where the application is deployed.
[0037] Applications are deployed on server clusters. Different server clusters can belong to different data centers. In addition to server clusters, data centers can also include data center clusters. Data center clusters are used to synchronize service configurations with the target cluster (central service configuration cluster) outside the data center. The relationship diagram is as follows: Figure 2 As shown. The target cluster includes multiple nodes, with master and child nodes. The data center includes a data center cluster, which in turn includes master and child nodes. The data center cluster communicates with the server cluster through proxy nodes. The server cluster periodically pulls the service configuration from the data center cluster into its memory. Applications in the server cluster then provide services using the service configuration in the server cluster's memory.
[0038] The target cluster and data center cluster mentioned above can be an etcd cluster. etcd is a distributed, consistent key-value storage system used for shared configuration and service discovery. An etcd cluster can include multiple nodes, including a master node and child nodes. Using the etcd cluster as the target cluster, users can send requests to the master node through an etcd client to adjust the service configuration within the etcd cluster. The master node then sends the service configuration to the child nodes. After confirming the service configuration is adjusted correctly, a deployment request can be initiated, and the target cluster will deploy the service configuration online, synchronizing it with the etcd cluster in the data center. During synchronization with the etcd cluster in the data center, the master node is synchronized first, and then the master node sends the service configuration to the child nodes. For example, as shown... Figure 3 As shown, Figure 3 In the target cluster, node 1 is the master node, and nodes 2 and 3 are child nodes. In data center cluster 1 and data center cluster 2, node 2 is the master node, and nodes 1 and 3 are child nodes. The master node will synchronize the written data to the child nodes.
[0039] The server cluster described above can be a cluster with applications deployed on it. The server cluster pulls the service configuration from the etcd cluster in the data center into memory and stores it there. When the application needs to call the service configuration, it can call the service configuration in memory.
[0040] In this embodiment, when a user adjusts the service configuration on the target cluster through the client of the target cluster and initiates an online request, the target cluster will synchronize the service configuration to the data center cluster. Then, the service configuration in the data center cluster will be stored in the memory of the server cluster within the same data center. When an application on the server cluster receives an access request, it will invoke the service configuration to provide the corresponding service.
[0041] The method provided in this application embodiment can modify the service configuration uniformly through the target cluster. When the target cluster receives a service configuration online request, the modified service configuration can be synchronized to the data center cluster. The service configuration synchronized to the data center cluster will be saved in memory by the server cluster for the server cluster to call to provide the target service. This eliminates the need to directly modify the configuration file in the server cluster, avoids errors, and ensures that the application of the server cluster provides normal service.
[0042] As an optional example, such as Figure 4 As shown, when the target cluster receives an online request indicating that the service configuration is online, synchronizing the service configuration in the target cluster to the data center cluster includes:
[0043] S402, determine the target configuration that has changed in the service configuration of the target cluster, wherein the service configuration of the target cluster includes the data center service configuration of each data center and the shared service configuration shared by all data centers;
[0044] S404-1, when the target configuration is a data center service configuration, determine the target data center corresponding to the target configuration and synchronize the target configuration to the data center cluster of the target data center;
[0045] S404-2, when the target configuration is a shared service configuration, synchronizes the target configuration to the data center cluster in each data center.
[0046] In this embodiment, users can adjust the service configuration in the target cluster through the client. During online synchronization, they can either synchronize only the service configurations that have changed compared to the last time, or synchronize all service configurations. For the case where service configurations have changed, the first step is to determine the target configuration that has changed. The service configuration of the target cluster includes the data center service configuration for each data center and the shared service configuration shared by all data centers. It is determined whether the target configuration is a data center service configuration or a shared service configuration. If it is a data center service configuration, only the corresponding data center cluster needs to be synchronized; if it is a shared service configuration, it needs to be synchronized to the data center cluster of every data center.
[0047] As an optional example, the service configurations in the target cluster and the data center cluster are stored in a tree-like hierarchical structure. Before determining the target configuration that has changed in the service configuration of the target cluster, the above method further includes: synchronizing the data center service configuration in the service configuration of the target cluster to the data center cluster that matches the data center service configuration according to the tree-like hierarchical structure of the service configuration of the target cluster; or, synchronizing the shared service configuration in the service configuration of the target cluster to each data center cluster according to the tree-like hierarchical structure of the service configuration of the target cluster.
[0048] In this embodiment, the service configuration in the target cluster is stored in a tree-like hierarchical structure. When synchronized to the data center cluster, the storage structure of the data center service configuration synchronized to the data center cluster is consistent with that of the service configuration in the target cluster, both being tree-like hierarchical structures.
[0049] For example, such as Figure 5 This is a schematic diagram of a tree-like hierarchical structure. The service configurations of Data Center 1, Data Center 2, and Data Center 3 are data center service configurations, which are synchronized to the data center clusters of Data Center 1, Data Center 2, and Data Center 3, respectively. The shared data center configuration is synchronized to the data center clusters of Data Center 1, Data Center 2, and Data Center 3. Taking the data center service configuration of Data Center 2 as an example, the data center service configuration of Data Center 2 is divided into availability zone level, cluster level, compute node level, and service level. After the data center service configuration of Data Center 2 is synchronized to the data center cluster of Data Center 2, the data center service configuration of Data Center 2 is stored in the data center cluster of Data Center 2 with the same structure.
[0050] As an optional example, synchronizing the data center service configuration in the service configuration of the target cluster to data center clusters matching the data center service configuration according to the tree hierarchy of the service configuration of the target cluster, or synchronizing the shared service configuration in the service configuration of the target cluster to each data center cluster according to the tree hierarchy of the service configuration of the target cluster, includes: determining each data center cluster as the current cluster, and performing the following operations: obtaining a first path or a second path in the current cluster, wherein the first path is used to indicate the path of the data center service configuration to be synchronized to the current cluster in the target cluster, and the second path is used to indicate the path of the shared service configuration to be synchronized to the current cluster; synchronizing the data center service configuration to the current cluster according to the first path or synchronizing the shared service configuration to the current cluster according to the second path.
[0051] In this embodiment, each data center cluster contains two paths: a first path and a second path. The first path indicates the data center service configuration corresponding to the data center cluster in the target cluster. The second path is the path for shared service configuration. The first path is different for data center clusters in different data centers, but the second path is the same for all data center clusters. For example, continuing to combine... Figure 5 The first path for the data center cluster in Data Center 2 can be `key:="Data Center 2 / Availability Zone 2 / Cluster 3 / Compute Node 1 / Service"`, and the second path can be ` / Shared Data Center Configuration / Service Group / Service 1`, or ` / Shared Data Center Configuration / Service Group / Service 2`. Whether it's `Service 1` or `Service 2` depends on the required services, or both `Service 1` and `Service 2` can be synchronized.
[0052] As an optional example, synchronizing the data center service configuration to the current cluster according to the first path or synchronizing the shared service configuration to the current cluster according to the second path includes: determining each string separated by a predetermined symbol in the first path as a node; performing node resolution operations from the first node to the last node in the first path; and loading the node into the current cluster each time a non-duplicate node is resolved; or, determining each string separated by a predetermined symbol in the second path as a node; performing node resolution operations from the first node to the last node in the second path; and loading the node into the current cluster each time a non-duplicate node is resolved.
[0053] In this embodiment, during the process of synchronizing service configuration according to the first path or the second path, the first path and the second path can be parsed, and a predetermined symbol in the first path and the second path can be used as a separator. The predetermined symbol can be " / " in the path. After parsing the first path and the second path, each node obtained from the parsing is loaded into the data center cluster. Figure 6 As shown, taking data center 2 as an example, the service configuration of data center 2 is saved in the data center cluster of data center 2 in the form of a tree-like hierarchical structure, which is consistent with the hierarchical structure of the service configuration of data center 2 in the target cluster.
[0054] As an optional example, storing the service configurations for the data center cluster in the memory of the server cluster within each data center includes:
[0055] S702, where the server cluster in each data center pulls the service configuration of the data center cluster from the data center cluster at predetermined intervals;
[0056] S704-1: If the service configuration is successfully pulled, the pulled service configuration will overwrite the original service configuration in memory.
[0057] S704-2 retains the original service configuration in memory in the event that fetching the service configuration fails.
[0058] In this embodiment, the server cluster can periodically pull data center service configurations and shared service configurations from the data center cluster into memory, such as every 10 minutes. If the pull is successful, the pulled service configuration overwrites the original service configuration in memory. It should be noted that the pulled service configuration may be identical to the original service configuration; in such cases, it will still be overwritten to ensure that the service configuration in memory is up-to-date. Before the pulled service configuration overwrites the original service configuration, if a user access request is received, the original service configuration in memory will be used to provide the service, as the new service configuration has not yet been pulled. After the pulled service configuration overwrites the original service configuration, when a user access request is received, the new service configuration will be used.
[0059] As an optional example, when the target cluster receives an online request indicating that the service configuration is online, synchronizing the service configuration in the target cluster to the data center cluster includes: saving the service configuration as an executable file; and copying and pasting the executable file format service configuration into the data center cluster.
[0060] In this embodiment, the service configuration in the target cluster can be saved as an executable file during synchronization. This executable file can then be directly copied and pasted to complete the service configuration synchronization. The executable file is identical in both the target cluster and the data center cluster.
[0061] Figure 8 This is a system flowchart for this embodiment, described in conjunction with the accompanying drawings. Users update service configurations in the target cluster using an etcd client. The etcd client displays service configurations in a hierarchical tree structure for easy management and display. Furthermore, the etcd client supports user authentication and Transport Layer Security (TLS). The target cluster is an etcd cluster with the following characteristics: High availability: etcd supports a multi-replica architecture, ensuring high availability of configurations. Real-time updates: etcd can synchronize configuration updates in real time, ensuring real-time configuration. Version control support: etcd supports configuration version control, allowing easy rollback to historical versions. TLS encryption support: etcd supports TLS encryption, ensuring the security of configuration data. Access control support. After the service configuration of the target cluster is updated, it is synchronized online to the data center cluster. Online synchronization uses a step tool, which can operate according to executable file commands, allowing copying, pasting, and deleting of service configurations. The server cluster periodically pulls service configurations, and the service configurations of the data center cluster are periodically forwarded to the server cluster through proxy nodes. The proxy node is a stateless etcd reverse proxy running on the open-source framework (gRPC Remote Procedure Calls, gRPC), designed to reduce the overall processing load on the core etcd cluster. The gRPC proxy node merges monitoring and API call requests, achieving horizontal scalability. Simultaneously, to protect the cluster from abusive clients, the gRPC proxy node implements a key-value pair read request cache. Applications in the server cluster invoke in-memory service configurations to provide the corresponding services.
[0062] The data center cluster references the service configuration of the target cluster through a first path and a second path. For example, the first path could be `key:="Data Center 2 / Availability Zone 2 / Cluster 3 / Compute Node 1 / Service"`. The second path for the data center cluster in Data Center 2 could be `Second Path: / Shared Data Center Configuration / Service Group / Service 1`, or `Second Path: / Shared Data Center Configuration / Service Group / Service 2`. The service configuration obtained by the data center cluster consists of two parts. The first part is separated by a key and parsed layer by layer. If duplicate configuration items are encountered, the configuration of the lower-level node takes precedence. The second part is the shared service configuration, parsed layer by layer, and finally saved as a structure identical to the tree hierarchy in the target cluster.
[0063] Figure 9 This is a schematic diagram illustrating the structure of a service configuration update system for an application provided in an embodiment of this application. Figure 9 As shown, the service configuration update system for the above application includes:
[0064] Target cluster 902 is used to synchronize the service configuration in the target cluster to the data center cluster when it receives an online request indicating that the service configuration is online. The target cluster is a cluster located outside of multiple data centers, and each of the multiple data centers includes one of the aforementioned data center clusters.
[0065] Data center cluster 904 is used to store service configurations;
[0066] Server cluster 906 is used to store the service configuration of the data center cluster in the memory of the server cluster, where the server cluster is a cluster on which the application is deployed; when an access request is received, the service configuration is retrieved from memory to provide the target service using the service configuration, where the target service is the service corresponding to the service configuration, and the access request is used to access the target service of the application on any server cluster.
[0067] The service configuration update system described above can be used to update the service configuration in a server cluster where the application is deployed.
[0068] Applications are deployed on server clusters. Different server clusters can belong to different data centers. In addition to server clusters, data centers can also include data center clusters. Data center clusters are used to synchronize service configurations with the target cluster (central service configuration cluster) outside the data center. The relationship diagram is as follows: Figure 2 As shown. The target cluster includes multiple nodes, with master and child nodes. The data center includes a data center cluster, which in turn includes master and child nodes. The data center cluster communicates with the server cluster through proxy nodes. The server cluster periodically pulls the service configuration from the data center cluster into its memory. Applications in the server cluster then provide services using the service configuration in the server cluster's memory.
[0069] The target cluster and data center cluster mentioned above can be an etcd cluster. etcd is a distributed, consistent key-value storage system used for shared configuration and service discovery. An etcd cluster can include multiple nodes, including a master node and child nodes. Using the etcd cluster as the target cluster, users can send requests to the master node through an etcd client to adjust the service configuration within the etcd cluster. The master node then sends the service configuration to the child nodes. After confirming the service configuration is adjusted correctly, a deployment request can be initiated, and the target cluster will deploy the service configuration online, synchronizing it with the etcd cluster in the data center. During synchronization with the etcd cluster in the data center, the master node is synchronized first, and then the master node sends the service configuration to the child nodes. For example, as shown... Figure 3 As shown, Figure 3 In the target cluster, node 1 is the master node, and nodes 2 and 3 are child nodes. In data center cluster 1 and data center cluster 2, node 2 is the master node, and nodes 1 and 3 are child nodes. The master node will synchronize the written data to the child nodes.
[0070] The server cluster described above can be a cluster with applications deployed on it. The server cluster pulls the service configuration from the etcd cluster in the data center into memory and stores it there. When the application needs to call the service configuration, it can call the service configuration in memory.
[0071] In this embodiment, when a user adjusts the service configuration on the target cluster through the client of the target cluster and initiates an online request, the target cluster will synchronize the service configuration to the data center cluster. Then, the service configuration in the data center cluster will be stored in the memory of the server cluster within the same data center. When an application on the server cluster receives an access request, it will invoke the service configuration to provide the corresponding service.
[0072] The method provided in this application embodiment can modify the service configuration uniformly through the target cluster. When the target cluster receives a service configuration online request, the modified service configuration can be synchronized to the data center cluster. The service configuration synchronized to the data center cluster will be saved in memory by the server cluster for the server cluster to call to provide the target service. This eliminates the need to directly modify the configuration file in the server cluster, avoids errors, and ensures that the application of the server cluster provides normal service.
[0073] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.
[0074] like Figure 10As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0075] Memory 113 is used to store computer programs;
[0076] In one embodiment of this application, when the processor 111 executes the program stored in the memory 113, it implements the service configuration update method of the application provided in any of the foregoing method embodiments.
[0077] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the service configuration update method for an application provided in any of the foregoing method embodiments.
[0078] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0079] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general-purpose hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0080] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0081] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for updating service configuration of an application, characterized in that, include: When the target cluster receives an online request indicating that the service configuration is online, the service configuration in the target cluster is synchronized to the data center cluster. The target cluster is a cluster located outside of multiple data centers, and each of the multiple data centers includes one data center cluster. Each server cluster stores the service configuration of the data center cluster in the memory of the server cluster, wherein the server cluster is a cluster in which the application is deployed; When any of the server clusters receives an access request, the service configuration is invoked from the memory to provide the target service using the service configuration, wherein the target service is the service corresponding to the service configuration, and the access request is used to access the target service of the application on any of the server clusters.
2. The method according to claim 1, characterized in that, The step of synchronizing the service configuration in the target cluster to the data center cluster when the target cluster receives an online request indicating that the service configuration is online includes: The target configuration that has changed in the service configuration of the target cluster is determined, wherein the service configuration of the target cluster includes the data center service configuration of each data center and the shared service configuration shared by all data centers; If the target configuration is a data center service configuration, determine the target data center corresponding to the target configuration, and synchronize the target configuration to the data center cluster of the target data center; If the target configuration is a shared service configuration, the target configuration will be synchronized to the data center cluster in each data center.
3. The method according to claim 2, characterized in that, The target cluster and the service configurations in the data center cluster are stored in a tree-like hierarchical structure. Before determining the target configuration that has changed in the service configuration of the target cluster, the method further includes: The data center service configuration in the service configuration of the target cluster is synchronized to the data center cluster that matches the data center service configuration according to the tree hierarchy of the service configuration of the target cluster; or, The shared service configuration in the service configuration of the target cluster is synchronized to each of the data center clusters according to the tree-like hierarchical structure of the service configuration of the target cluster.
4. The method according to claim 3, characterized in that, The step of synchronizing the data center service configuration in the service configuration of the target cluster to the data center cluster matching the data center service configuration according to the tree-like hierarchical structure of the service configuration of the target cluster, or synchronizing the shared service configuration in the service configuration of the target cluster to each of the data center clusters according to the tree-like hierarchical structure of the service configuration of the target cluster, includes: To designate each data center cluster as the current cluster, perform the following operations: Obtain a first path or a second path in the current cluster, wherein the first path is used to indicate the path in the target cluster to synchronize the data center service configuration to the current cluster, and the second path is used to indicate the path to synchronize the shared service configuration to the current cluster; The data center service configuration is synchronized to the current cluster via the first path, or the shared service configuration is synchronized to the current cluster via the second path.
5. The method according to claim 4, characterized in that, The step of synchronizing the data center service configuration to the current cluster according to the first path or synchronizing the shared service configuration to the current cluster according to the second path includes: Each string segmented by a predetermined symbol in the first path is identified as a node; node parsing is performed from the first node to the last node in the first path; each non-repeating node is loaded into the current cluster; or, Each string segmented by a predetermined symbol in the second path is identified as a node; node parsing is performed from the first node in the second path to the last node; each non-repeating node is parsed and then loaded into the current cluster.
6. The method according to claim 1, characterized in that, The step of storing the service configuration of the data center cluster in the memory of the server cluster in each of the data centers includes: The server cluster in each of the data centers pulls the service configuration of the data center cluster from the data center cluster at predetermined intervals; If the service configuration is successfully pulled, the pulled service configuration will overwrite the original service configuration in memory. If fetching the service configuration fails, the original service configuration in memory is retained.
7. The method according to claim 1, characterized in that, The step of synchronizing the service configuration in the target cluster to the data center cluster when the target cluster receives an online request indicating that the service configuration is online includes: Save the service configuration as an executable file. Copy and paste the service configuration in executable file format into the data center cluster.
8. A service configuration update system for an application, characterized in that, include: The target cluster is used to synchronize the service configuration in the target cluster to the data center cluster when an online request is received to indicate that the service configuration is online. The target cluster is a cluster located outside of multiple data centers, and each of the multiple data centers includes one data center cluster. The data center cluster is used to store the service configuration. A server cluster is used to store the service configuration of the data center cluster in the memory of the server cluster, wherein the server cluster is a cluster in which applications are deployed; upon receiving an access request, the service configuration is retrieved from the memory to provide a target service using the service configuration, wherein the target service is a service corresponding to the service configuration, and the access request is used to access the target service of an application on any server cluster.
9. An electronic device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; At least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor executes the computer program to implement the method of any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions for performing the method described in any one of claims 1 to 7 of this application.
Citation Information
Patent Citations
System and method for data storage on basis of key-value pair system tree-shaped directory achieving structure
CN103002027A
Domain name configuration management system
CN113596187A
