Method and device for upgrading distributed system components, storage medium, processor

By implementing batch parallel upgrades and failure rollback mechanisms, the problems of low efficiency and difficult operation and maintenance of distributed system components under microservice architecture are solved, and an efficient and stable component upgrade process is achieved.

CN115421747BActive Publication Date: 2026-01-23CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210952399.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2026-01-23
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

In the process of upgrading components of a distributed system under a microservice architecture, existing technologies suffer from inefficiency and operational difficulties. In particular, the upgrade process, which relies on manual or fixed strategies, cannot match the downtime requirements of each business component, resulting in high operational costs and a high risk of errors.

Method used

By obtaining the upgrade package and upgrade domain of the target component, the component upgrade orchestration is performed using upgrade batch configuration and cluster distribution configuration. The components are upgraded in batches in parallel according to preset logic, and failure rollback is performed during the upgrade process to ensure the stability and reliability of the components during the upgrade process.

Benefits of technology

It enables efficient upgrades of distributed system components, reduces operational and maintenance difficulty and costs, improves upgrade efficiency when adding or changing components, and ensures system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421747B_ABST
    Figure CN115421747B_ABST
Patent Text Reader

Abstract

The application discloses a kind of upgrading method and device of distributed system component, storage medium, processor.The method comprises: obtaining the upgrade package and upgrade domain of target component needing upgrading in distributed system, upgrade package includes the upgrade batch configuration and cluster distribution configuration needed for upgrading, and upgrade domain includes node needed for upgrading;According to upgrade batch configuration, cluster distribution configuration and upgrade domain, obtain component upgrade orchestration, component upgrade orchestration includes multiple upgrade batches, each upgrade batch includes multiple upgrade units, and each upgrade unit includes a target component needing upgrading and the node of target component upgrading;According to component upgrade orchestration, each upgrade unit is traversed, and target component on each node is upgraded according to preset logic.Solve the distributed system component upgrading in the related art, need to rely on manual or fixed strategy, there is the problem of low efficiency, operation and maintenance difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of system upgrades, and more specifically, to a method and apparatus for upgrading distributed system components, a storage medium, and a processor. Background Technology

[0002] With the development of the internet, and facing highly dynamic and continuously responsive market demands, enterprise application system architecture is evolving towards microservice architecture. This involves breaking down a large, all-encompassing application into a set of smaller, independently developable, deployable, and testable component applications, using lightweight, universal protocols for communication between components. The core idea of ​​microservice architecture is decoupling. Considering business scalability, typical microservice architecture applications include access management, business management, registration and configuration centers, public data storage services, basic communication components, cluster management modules, etc., with each service further broken down into smaller, more granular components. This means that unified operation and maintenance of numerous components becomes a significant challenge for microservice implementation, making upgrades a crucial part of operations and maintenance.

[0003] In existing technologies, component upgrades in distributed systems under a microservice architecture are typically performed manually or semi-automatically using scripts by operations personnel following the upgrade and configuration methods published for each component. This approach is costly and prone to errors. To improve efficiency, a customized one-click upgrade can be implemented based on the existing distributed system. However, adding new components or changing the upgrade order or configuration of components often leads to significant modifications and verification of deployment code, resulting in low efficiency. Using a uniform upgrade scheme fails to address the downtime requirements of each business component, causing service interruptions. Furthermore, the lack of unified rules leads to chaotic upgrade package and version management, further complicating operations.

[0004] Upgrading distributed system components in related technologies requires manual or fixed strategies, which leads to low efficiency and difficult operation and maintenance. Currently, no effective solution has been proposed. Summary of the Invention

[0005] The main purpose of this application is to provide a method and system for upgrading distributed system components, so as to solve the problems of low efficiency and difficult operation and maintenance in the related technologies that require manual or fixed strategies for upgrading distributed system components.

[0006] To achieve the above objectives, according to one aspect of this application, a method for upgrading a distributed system component is provided, comprising: obtaining an upgrade package of a target component to be upgraded in a distributed system, and an upgrade domain of the target component, wherein the number of target components is at least one, the upgrade package includes an upgrade batch configuration and a cluster distribution configuration required for the upgrade of the target component, and the upgrade domain includes nodes required for the upgrade of the target component; obtaining a component upgrade orchestration based on the upgrade batch configuration, the cluster distribution configuration, and the upgrade domain, wherein the component upgrade orchestration includes multiple upgrade batches, each upgrade batch includes multiple upgrade units, each upgrade unit includes a target component to be upgraded and a node for the target component to be upgraded; traversing each upgrade unit according to the component upgrade orchestration, and upgrading the target component on each node according to a preset logic.

[0007] Optionally, traversing each upgrade unit according to the component upgrade orchestration and upgrading the target component on each node according to a preset logic includes: selecting any one upgrade unit in the highest priority upgrade batch; upgrading the target component of the upgrade unit in the node of the upgrade unit according to the preset logic; after the component upgrade of the upgrade unit is completed, upgrading the target components of other upgrade units in the highest priority upgrade batch by traversal; when the target components of all upgrade units in the same upgrade batch have been upgraded, upgrading the target components of the upgrade units in the next priority upgrade batch, until the target components corresponding to all upgrade units in the component upgrade orchestration have been upgraded.

[0008] Optionally, in the nodes of the upgrade unit, upgrading the target component of the upgrade unit according to the preset logic includes: upgrading the target component of the upgrade unit according to the preset logic, wherein the preset logic includes a plurality of predetermined upgrade processes and a plurality of component rollback processes; if the first process stage in the plurality of upgrade processes fails, the component upgrade is determined to have failed, wherein the first process stage is a process stage in the plurality of upgrade processes that cannot be rolled back; if the second process stage in the plurality of upgrade processes fails, the component rollback process is entered; if all the plurality of upgrade processes are successful, the component upgrade is determined to have succeeded.

[0009] Optionally, the upgrade process includes at least one of the following: downloading the upgrade package, backing up before the upgrade, offline component, stopping the component, upgrading the component, starting the component, and deploying the component; the first process stage includes at least one of the following: downloading the upgrade package and backing up before the upgrade; the second process stage includes at least one of the following: offline component, stopping the component, upgrading the component, starting the component, and deploying the component; the component rollback process includes at least one of the following: uninstalling, rolling back the configuration, and rolling back the component.

[0010] Optionally, the method further includes: if the component upgrade fails or the component rollback succeeds, upgrading the component again until the component upgrade succeeds or the component rollback fails.

[0011] Optionally, obtaining the upgrade package of the target component to be upgraded in the distributed system, and the upgrade domain of the target component, includes: receiving upgrade information from the distributed system for upgrading components, wherein the upgrade information includes the upgrade package of the component, the dependencies between each component, the upgrade domain of each component, and the cluster distribution configuration of each component; comparing whether the deployment version currently used by each component is consistent with the version in the upgrade information, and determining the target component to be upgraded from the components; extracting the upgrade package of the target component, the dependencies between each target component, the upgrade domain of each target component, and the cluster distribution configuration of each target component from the upgrade information; determining the upgrade batch configuration according to the dependencies between the target components, and adding the upgrade batch configuration and the cluster distribution configuration to the upgrade package corresponding to the target component.

[0012] Optionally, before traversing each upgrade unit according to the component upgrade orchestration and upgrading the target component on each node according to preset logic, the method further includes: sending a check instruction to the upgrade agent of the target component, wherein the check instruction is used to instruct the target component to perform a pre-upgrade check; receiving the check result returned by the upgrade agent of the target component; and performing the upgrade of the target component if the check result indicates that the upgrade is possible.

[0013] To achieve the above objectives, according to another aspect of this application, an upgrade apparatus for a distributed system component is provided. The apparatus includes: an acquisition module, configured to acquire an upgrade package of a target component to be upgraded in the distributed system, and an upgrade domain of the target component, wherein the number of target components is at least one, the upgrade package includes an upgrade batch configuration and a cluster distribution configuration required for the upgrade of the corresponding target component, and the upgrade domain includes nodes required for the upgrade of the corresponding target component; an orchestration module, configured to obtain a component upgrade orchestration based on the upgrade batch configuration, the cluster distribution configuration, and the upgrade domain, wherein the component upgrade orchestration includes multiple upgrade batches, each upgrade batch includes multiple upgrade units, each upgrade unit includes a target component to be upgraded and a node for the target component to be upgraded; and an upgrade module, configured to traverse each upgrade unit according to the component upgrade orchestration and upgrade the target component on each node according to a preset logic.

[0014] According to another aspect of this application, a computer-readable storage medium is also provided for storing a program, wherein the program executes the upgrade method for a distributed system component as described in any of the preceding claims.

[0015] According to another aspect of this application, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the upgrade method of the distributed system component described in any one of the foregoing.

[0016] This application obtains the upgrade package and upgrade domain of the target component in a distributed system. The upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the target component upgrade. Based on the upgrade batch configuration, cluster distribution configuration, and upgrade domain, a component upgrade orchestration is obtained. Each upgrade unit is traversed according to the component upgrade orchestration, and the target component on each node is upgraded according to a preset logic. This allows for batch upgrades of numerous components in a distributed system, and is not limited to component upgrade templates. For scenarios requiring the addition or modification of components, simple modifications are sufficient to address the needs of addition and modification, thus achieving the purpose of component upgrades. This improves the efficiency of component upgrades in distributed systems, reduces the difficulty of upgrading components when adding or modifying them, and lowers the operational complexity of distributed system components. It also solves the problems of low efficiency and difficult operation and maintenance associated with manual or fixed strategies in related technologies for distributed system component upgrades. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a flowchart of a method for upgrading a distributed system component according to an embodiment of this application;

[0019] Figure 2 This is a flowchart of an intelligent upgrade method based on computational particle arrangement provided according to an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of the interaction process between the notification and registration mechanism provided according to the embodiments of this application;

[0021] Figure 4 This is a flowchart of upgrade and rollback provided according to the embodiments of this application;

[0022] Figure 5This is a schematic diagram of component upgrade arrangement provided according to the embodiments of this application;

[0023] Figure 6 This is a schematic diagram of an upgrade device for a distributed system component according to an embodiment of this application;

[0024] Figure 7 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0029] Example

[0030] The present invention will now be described in conjunction with preferred implementation steps. Figure 1This is a flowchart of a method for upgrading a distributed system component according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0031] Step S101: Obtain the upgrade package of the target component that needs to be upgraded in the distributed system, and the upgrade domain of the target component. The number of target components is at least one. The upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the upgrade of the target component. The upgrade domain includes the nodes required for the upgrade of the target component.

[0032] Step S102: Based on the upgrade batch configuration, cluster distribution configuration and upgrade domain, obtain the component upgrade orchestration, wherein the component upgrade orchestration includes multiple upgrade batches, each upgrade batch includes multiple upgrade units, and each upgrade unit includes a target component to be upgraded and the node to be upgraded for the target component;

[0033] Step S103: Traverse each upgrade unit according to the component upgrade orchestration and upgrade the target component on each node according to the preset logic.

[0034] Through the above steps, the upgrade package and upgrade domain of the target component to be upgraded in the distributed system are obtained. The upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the corresponding target component upgrade. Based on the upgrade batch configuration, cluster distribution configuration, and upgrade domain, the component upgrade orchestration is obtained. Each upgrade unit is traversed according to the component upgrade orchestration, and the target component on each node is upgraded according to preset logic. This method allows for batch upgrades of numerous components in the distributed system, and is not limited to component upgrade templates. For scenarios where new components need to be added or components are changed at any time, only simple modifications are needed to handle the addition and change requirements, thus achieving the purpose of component upgrades. This improves the efficiency of component upgrades in distributed systems, reduces the difficulty of upgrading when adding or changing components, and reduces the operational difficulty of distributed system components. It also solves the problems of low efficiency and difficult operation and maintenance associated with manual or fixed strategies in related technologies for distributed system component upgrades.

[0035] The entities executing the above steps can be distributed systems with a microservice architecture, or third-party devices used to manage and maintain distributed systems. These third-party devices possess data processing and computation capabilities and can be servers, processors, calculators, etc. The third-party devices upgrade the components in the distributed system according to the logic of the above steps, based on instructions. This may also include preliminary data preparation operations or steps, as well as further operations or steps such as testing or running the upgraded components or the distributed system afterward.

[0036] The aforementioned target components can be components of applications connected to the distributed system. For example, a distributed system under a microservice architecture may connect to multiple applications, including access management applications, business management applications, registration and configuration centers, public data storage services, basic communication components, cluster management modules, etc. These applications can be broken down into smaller units or components in the distributed system, and when an upgrade is needed, these smaller units or components can be used as target components.

[0037] In the aforementioned distributed system, there can be multiple target components that need to be upgraded. Typically, due to the complexity of the distributed system's structure, the number of target components requiring upgrades is usually quite large. However, in extreme cases, only one target component may need to be upgraded. That is, the number of target components is at least one. If there are no components in the distributed system that need upgrading, then there will be no need to upgrade any target components.

[0038] The aforementioned acquisition of the upgrade package for the target component can be achieved by receiving the upgrade command along with the upgrade package carried by the command, or by obtaining the necessary upgrade information from the system and packaging it into an upgrade package. This embodiment packages the upgrade package according to specifications, including a component application package, a component configuration package, a component deployment parameter configuration file, a version information file, a deployment parameter verification plugin, and a calculation granularity interface script. It should be noted that when determining the component upgrade orchestration for the target component, the required upgrade batch configuration and cluster distribution configuration can be directly recorded in the upgrade package, or they can be calculated based on the data in the upgrade package.

[0039] In this embodiment, the upgrade package includes the upgrade batch configuration and cluster distribution configuration. Simultaneously with obtaining the upgrade package, the upgrade domain of the target component is determined. Distributed clusters typically employ a strategy of offline upgrades for some nodes while maintaining normal service for others. Leveraging the reliability of distributed clusters, a smooth overall cluster upgrade is achieved. The set of nodes that allow offline upgrades for some nodes is called the upgrade domain. However, due to differences in functional implementation, cluster distribution, and even cluster size, the upgrade domains of each component may vary. This embodiment uses the deployment process registration and notification channel to query the upgrade domain of each component in real time, determining the component's upgrade orchestration.

[0040] The upgrade batch configuration described above refers to upgrade batches for multiple target components. These batches are arranged in priority order, and upgrades are performed sequentially according to this priority. The cluster distribution configuration described above refers to the distributed system nodes where a specific target component resides. The upgrade domain described above can be simply understood as the nodes on which a specific target component needs to be upgraded.

[0041] Based on the upgrade batch configuration, cluster distribution configuration, and upgrade domain, the component upgrade orchestration can be determined. The component upgrade orchestration includes multiple batches of upgrade units. Each upgrade unit includes a target component to be upgraded and the nodes on which that target component needs to be upgraded. It should be noted that each upgrade unit also records the preset logic for upgrading the corresponding target component. The target component on the nodes within that upgrade unit is upgraded by executing this preset logic.

[0042] Not limited to component upgrade templates, this technology allows for simple modifications to meet the needs of adding or changing components in scenarios where such changes are required at any time. This achieves the goal of component upgrades, thereby improving the efficiency of component upgrades in distributed systems, reducing the difficulty of upgrading components when adding or changing them, and lowering the operational complexity of distributed system components. It also solves the problems of low efficiency and difficult operation and maintenance associated with manual or fixed strategies for upgrading distributed system components in related technologies.

[0043] Optionally, traversing each upgrade unit according to the component upgrade orchestration and upgrading the target component on each node according to preset logic includes: selecting any upgrade unit in the highest priority upgrade batch; upgrading the target component of the upgrade unit in the node of the upgrade unit according to preset logic; after the component upgrade of the upgrade unit is completed, upgrading the target components of other upgrade units in the highest priority upgrade batch by traversal; if the target components of all upgrade units in the same upgrade batch have been upgraded, upgrading the target components of the upgrade units in the next priority upgrade batch, until the target components corresponding to all upgrade units in the component upgrade orchestration have been upgraded.

[0044] like Figure 5 As shown, the component upgrade orchestration described above includes multiple batches, each batch containing at least one upgrade unit. Each upgrade unit includes the target component to be upgraded and the node containing the target component. The priorities of the multiple batches are included in the component batch configuration; higher priority means the corresponding target component should be upgraded earlier. Therefore, any upgrade unit in the highest priority upgrade batch is selected, and the target component of that unit is upgraded according to a preset logic within its node. Then, the target components of other upgrade units in the highest priority upgrade batch are upgraded through a traversal process. Once all target components in the same upgrade batch have been upgraded, the target components of the upgrade units in the next priority upgrade batch are upgraded, until all target components corresponding to all upgrade units in the component upgrade orchestration have been upgraded. This process is then repeated to upgrade multiple target components according to the component upgrade orchestration.

[0045] It should be noted that during the upgrade of target components based on component upgrade orchestration, multiple components in the same batch can be upgraded in parallel to improve the upgrade efficiency of the target components. Specifically, the maximum number of upgrade units can be obtained sequentially according to the component upgrade orchestration, based on the maximum number of parallel upgrades. It should also be noted that in some cases, if the remaining upgrade units in the current batch are less than the aforementioned maximum number, the next batch of target components can be selected for parallel upgrades.

[0046] Optionally, in the nodes of the upgrade unit, upgrading the target component of the upgrade unit according to preset logic includes: upgrading the target component of the upgrade unit according to preset logic, wherein the preset logic includes multiple predetermined upgrade processes and multiple component rollback processes; if the first process stage in multiple upgrade processes fails, the component upgrade is determined to have failed, wherein the first process stage is a process stage in multiple upgrade processes that cannot be rolled back; if the second process stage in multiple upgrade processes fails, the component rollback process is entered; if all upgrade processes are successful, the component upgrade is determined to have succeeded.

[0047] like Figure 4 As shown, the above-mentioned preset logic may include multiple upgrade processes and multiple component rollback processes. Optionally, the upgrade process includes at least one of the following: downloading the upgrade package, backing up before the upgrade, offline component, stopping the component, upgrading the component, starting the component, and deploying the component; the first process stage includes at least one of the following: downloading the upgrade package and backing up before the upgrade; the second process stage includes at least one of the following: offline component, stopping the component, upgrading the component, starting the component, and deploying the component; the component rollback process includes at least one of the following: uninstalling, rolling back the configuration, and rolling back the component.

[0048] The component upgrade process is the process of upgrading the target component. The upgrade process includes at least one of the following: downloading the upgrade package, pre-upgrade backup, offline component installation, stopping the component, upgrading the component, starting the component, and deploying the component. The component rollback process is the process by which, if some upgrade processes fail during the execution of multiple upgrade processes, the target component being upgraded can be rolled back to its state before the upgrade. It should be noted that the component rollback process can also include multiple rollback steps, including at least one of the following: uninstallation, configuration rollback, and component rollback.

[0049] Specifically, if the first stage of multiple upgrade processes fails, the component upgrade is determined to have failed. The first stage is a non-reversible stage in the upgrade process and includes at least one of the following: downloading the upgrade package, or backing up before the upgrade. If the second stage of multiple upgrade processes fails, a component rollback process is initiated. The second stage includes at least one of the following: offline component, stopping the component, upgrading the component, starting the component, or deploying the component. The component rollback process can also result in a successful rollback or a failed rollback. A successful rollback indicates that the target component upgrade failed and has reverted to its pre-upgrade state, allowing the upgrade process to be restarted. A failed rollback indicates that the target component upgrade failed and cannot be reverted to its pre-upgrade state, nor can the upgrade be restarted; feedback on the target component upgrade failure can be provided.

[0050] Optionally, the method also includes: if the component upgrade fails or the component rollback succeeds, upgrade the component again until the component upgrade succeeds or the component rollback fails.

[0051] Therefore, in this embodiment, if the component upgrade fails or the component rollback succeeds, the component is upgraded again until the upgrade is successful. The status is then changed and the target component is notified of the successful upgrade. Alternatively, if the component rollback fails, feedback is sent indicating that the target component upgrade failed.

[0052] Optionally, obtaining the upgrade package and upgrade domain of the target component to be upgraded in the distributed system includes: receiving upgrade information from the distributed system for upgrading components, wherein the upgrade information includes the upgrade package of the component, the dependencies between each component, the upgrade domain of each component, and the cluster distribution configuration of each component; comparing whether the deployment version currently used by each component is consistent with the version in the upgrade information, and determining the target component to be upgraded from the components; extracting the upgrade package of the target component, the dependencies between each target component, the upgrade domain of each target component, and the cluster distribution configuration of each target component from the upgrade information; determining the upgrade batch configuration based on the dependencies between the target components, and adding the upgrade batch configuration and the cluster distribution configuration to the upgrade package corresponding to the target component.

[0053] Multiple batches and the target components within each batch are determined based on the dependencies between components in the distributed system. For example, given five components A, B, C, D, and E, with dependencies as follows: E, D->B, D->C, B->A, the deployment batches are structured as follows: A and C in the first batch, B in the second batch, and D and E in the third batch. This means that components that are more dependent on each other in the dependency relationship receive higher priority for upgrades. This ensures that dependent components are upgraded reliably and avoids the problem of dependent components becoming unusable after the upgraded dependent components are upgraded. This improves the accuracy of component upgrade processing to some extent.

[0054] Optionally, before traversing each upgrade unit according to the component upgrade orchestration and upgrading the target component on each node according to the preset logic, the method further includes: sending a check instruction to the upgrade agent of the target component, wherein the check instruction is used to instruct the target component to perform a pre-upgrade check; receiving the check result returned by the upgrade agent of the target component; and performing the upgrade of the target component only if the check result indicates that the upgrade is possible.

[0055] Before upgrading the target component, a registration and notification mechanism is used to notify the component to perform pre-upgrade checks, preventing unpredictable business interruptions during the upgrade due to cluster-related issues. This registration and notification mechanism serves as the communication framework between the deployment process and components. It is used for various tasks such as post-deployment notifications, pre-upgrade checks, upgrade domain queries, post-upgrade confirmation, component inspections, and safe component power-off, albeit with different command words. During deployment, components register their corresponding interfaces with the deployment agent as needed. The deployment framework then notifies registered components through the deployment agent at appropriate times. Detailed design is as follows... Figure 3 As shown. Considering the continuous expansion of the cluster size, this task can be completed concurrently across the entire cluster within the maximum concurrency capacity supported by the deployment process.

[0056] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0057] It should be noted that this application also provides an optional implementation method, which will be described in detail below.

[0058] This implementation proposes a general intelligent upgrade method for distributed system components. Through configuration files and the concept of computational granularity, it enables batch-based concurrent online upgrades of numerous components. This method is applicable to common large-scale distributed systems. By standardizing component package formats and deployment parameters, abstracting computational granularity, and combining a registration and notification mechanism, it achieves secure, stable, and reliable intelligent upgrades for numerous components. Furthermore, for scenarios requiring rapid market changes and scalability, such as the need to add or modify components at any time, this method only requires simple modifications to handle new additions and changes, significantly improving the daily maintenance and development efficiency of distributed system management teams in terms of upgrades.

[0059] The intelligent upgrade method of this embodiment mainly includes five core steps. Figure 2 This is a flowchart of an intelligent upgrade method based on computational particle arrangement provided in the embodiments of this application, such as... Figure 2 As shown, the specific steps are as follows.

[0060] Step 1: Identify the components to be upgraded. By comparing the deployment version of the components with the version information in the upgrade package, identify the components that need to be upgraded.

[0061] The intelligent upgrade method recommends packaging the upgrade package according to the specifications, including the component application package, component configuration package, component deployment parameter configuration file, version information file, deployment parameter verification plugin, and calculation granularity interface script. For example, the directory structure of the component_osd upgrade package is shown in Table 1, which is an example table of component upgrade packages.

[0062] Table 1 Examples of Component Upgrade Packages

[0063]

[0064]

[0065] Step Two: Pre-Upgrade Check. Through a registration and notification mechanism, components are notified to perform a pre-upgrade check to prevent unpredictable business interruptions during the upgrade process due to problems inherent in the cluster itself.

[0066] This implementation uses a general registration and notification mechanism as the communication framework between the deployment process and components. This framework is used for various processes such as post-deployment notifications, pre-upgrade checks, upgrade domain queries, post-upgrade confirmations, component inspections, and component safe power-off, although the command words differ. During deployment, components register their corresponding interfaces with the deployment agent as needed. The deployment framework then notifies the registered components through the deployment agent at the appropriate time. Detailed design is as follows... Figure 3 As shown, Figure 3This is a schematic diagram of the notification and registration mechanism interaction process provided according to the embodiments of this application. Considering the continuous expansion of the cluster size, this task can be completed concurrently across the entire cluster within the maximum concurrency capacity supported by the deployment process.

[0067] Step 3: Upgrade Domain Query. Distributed clusters typically employ a strategy of offline upgrades for some nodes while maintaining normal service for others. Leveraging the reliability of distributed clusters, a smooth overall cluster upgrade is achieved. The set of nodes that allow offline upgrades for some nodes is called the upgrade domain. However, due to differences in functionality, cluster distribution, and even cluster size, each component's upgrade domain may vary. This implementation uses a deployment process registration and notification channel to query the upgrade domain of each component in real time for use in the computational granularity orchestration of the next step.

[0068] Step 4: Upgrade computation granularity orchestration and execution. This implementation proposes an advanced intelligent orchestration algorithm based on real-time query upgrade domain by abstracting upgrade computation granules, enabling batch concurrent online upgrades of distributed systems.

[0069] Computational granules can be understood as a type of ordered task that can be executed independently, is reentrant, rollbackable, and persistent. The overall component upgrade process can be abstracted into five computational granule tasks: download, backup, offline, stop, upgrade, start, and online. These tasks enable the downloading of upgrade packages, pre-upgrade backup, offline component deployment, component shutdown, component upgrade, component startup, and component deployment. Because atomic tasks require rollback capabilities, components also need to provide corresponding computational granules such as uninstall, resume, and rollback to enable rollback and restoration in case of upgrade failure. These granules are used to perform uninstallation, configuration rollback, and component rollback when the upgrade fails. The state machine for computational granule failure can be referenced [reference needed]. Figure 4 , Figure 4 This is a flowchart of upgrade and rollback provided according to the embodiments of this application, such as... Figure 4 As shown, users can choose between two modes: rollback and retry, to attempt a repair.

[0070] Intelligent upgrades require maintaining two core configuration files: an upgrade batch configuration file that records the smooth upgrade of dependencies between components and the distribution of component cluster deployments, and an upgrade computation granularity that needs to be orchestrated in conjunction with the distribution of the upgrade domain.

[0071] For example, consider five components: A, B, C, D, and E. The cluster has three nodes: node1, node2, and node3. The dependencies are: E, D->B, D->C, B->A. Components are distributed as follows: A is deployed on node1 and node2; B, C, and D are deployed on all nodes; and E is deployed on node3. Based on these dependencies, the component deployment batches are: A and C in the first batch, B in the second batch, and D and E in the third batch. The configuration file for calculating the component batches in the granular orchestration is as follows:

[0072] 1: A, C;

[0073] 2:B;

[0074] 3: D, E;

[0075] The component cluster distribution is as follows:

[0076] node 1: A, B, C, D;

[0077] Node 2: A, B, C, D;

[0078] Node 3: B, C, D, E;

[0079] Assuming the real-time query results show that component A's upgrade domains are {node1} and {node2}, component B's upgrade domains are {node1, node2} and {node3}, components C and D's upgrade domains are {node1, node2, node3}, and component E's upgrade domain is {node3}, then the upgrade computation granularity orchestration is as follows: Figure 5 As shown, Figure 5 This is a schematic diagram of the component upgrade arrangement provided according to the embodiments of this application.

[0080] Step 5: Post-upgrade confirmation. Some components may require activation of new features or cluster-wide checks after a full cluster upgrade. A registration and notification mechanism will be used to notify each component of the upgrade completion confirmation.

[0081] Compared to existing technologies, this implementation method has the following advantages: Based on intelligent upgrades, changes such as adding or deleting components, component upgrade batches, and parameter configurations only require modification of relevant templates, making it simple, efficient, and saving the distributed system management team's investment in maintaining component upgrades. A common log location mechanism is added at the interface between the upgrade framework and components, allowing business groups, testing groups, and operations groups to self-locate upgrade issues based on logs, while the management team only needs to focus on maintaining the framework's code. Through the intelligent upgrade framework, the different fault domain logics of all components can be integrated, maximizing the parallel execution of component upgrade tasks and greatly improving upgrade efficiency, which is of great significance for intelligent operations and maintenance. This method can be flexibly configured according to component requirements, enabling all components to be upgraded offline as needed, while the overall cluster does not interrupt external services, providing the possibility for stable online upgrades of distributed systems.

[0082] This implementation method can be applied to the entire storage product of the CStor distributed storage system. For public and private cloud storage scenarios, with approximately 20 components, without this intelligent upgrade framework, the deployment and upgrade investments by the management, testing, and operations teams would be substantial and require continuous increases. Using the intelligent upgrade framework of the CStor distributed storage system, compared to traditional upgrade solutions, the method proposed in this implementation method effectively decouples and stabilizes the deployment-related interfaces between the management and business teams, enabling internal refactoring and self-verification within each group; the time required for management personnel to synchronously modify and verify components during changes is significantly reduced; and the time complexity of intelligent upgrades is reduced to O(log n), with short execution time, meeting the needs of rapid online upgrades and other cloud scenarios. Therefore, this implementation method is more suitable for use in the CStor distributed storage system.

[0083] This implementation utilizes a computationally granular intelligent programming algorithm, enabling the intelligent upgrade framework to be widely applied in numerous distributed systems. It aligns with the variability and diversity of components in microservice scenarios, reducing the time complexity of upgrade operations and maintenance to O(log n), resulting in short processing times and meeting the intelligent operation and maintenance needs of applications such as distributed storage systems and distributed order systems. The smooth online upgrade method based on real-time query of the upgrade domain is suitable for microservice scenarios where component fault domains differ significantly, fulfilling the market demand for smooth upgrades of the entire distributed system.

[0084] This application also provides an upgrade apparatus for distributed system components. It should be noted that the upgrade apparatus for distributed system components in this application can be used to execute the upgrade method for distributed system components provided in this application. The upgrade apparatus for distributed system components provided in this application will be described below.

[0085] Figure 6This is a schematic diagram of an upgrade device for a distributed system component according to an embodiment of this application, such as... Figure 6 As shown, the device includes: an acquisition module 62, an arrangement module 64, and an upgrade module 66. The device will be described in detail below.

[0086] The acquisition module 62 is used to acquire the upgrade package of the target component to be upgraded in the distributed system, as well as the upgrade domain of the target component. The number of target components is at least one. The upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the upgrade of the target component. The upgrade domain includes the nodes required for the upgrade of the target component. The orchestration module 64 is connected to the acquisition module 62 and is used to obtain the component upgrade orchestration according to the upgrade batch configuration, cluster distribution configuration and upgrade domain. The component upgrade orchestration includes multiple upgrade batches. Each upgrade batch includes multiple upgrade units. Each upgrade unit includes a target component to be upgraded and the node to be upgraded. The upgrade module 66 is connected to the orchestration module 64 and is used to traverse each upgrade unit according to the component upgrade orchestration and upgrade the target component on each node according to a preset logic.

[0087] The distributed system component upgrade device provided in this application embodiment obtains the upgrade package of the target component to be upgraded in the distributed system, as well as the upgrade domain of the target component. The upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the upgrade of the corresponding target component. Based on the upgrade batch configuration, cluster distribution configuration, and upgrade domain, a component upgrade orchestration is obtained. Each upgrade unit is traversed according to the component upgrade orchestration, and the target component on each node is upgraded according to a preset logic. This device upgrades numerous components in the distributed system in batches, and is not limited to component upgrade templates. For scenarios where new components need to be added or components need to be changed at any time, only simple modifications are needed to meet the needs of addition and change, thus achieving the purpose of component upgrade. This improves the efficiency of component upgrades in the distributed system, reduces the difficulty of upgrading when adding or changing components, and reduces the operational difficulty of distributed system components. It also solves the problems of low efficiency and difficult operation and maintenance in related technologies where distributed system component upgrades rely on manual or fixed strategies.

[0088] The upgrade device for distributed system components includes a processor and a memory. The aforementioned acquisition module 62, orchestration module 64, upgrade module 66, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0089] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. Upgrading distributed system components in related technologies is achieved by adjusting kernel parameters. However, this relies on manual or fixed strategies, resulting in low efficiency and difficult maintenance.

[0090] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0091] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a method for upgrading distributed system components.

[0092] This invention provides a processor for running a program, wherein the program executes a method for upgrading distributed system components during runtime.

[0093] Figure 7 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 7 As shown, this application embodiment provides an electronic device 70, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of any of the above methods.

[0094] The device in this application may be a server, PC, PAD, mobile phone, etc.

[0095] This application also provides a computer program product that, when executed on an upgrade device for a distributed system component, is suitable for executing a program that initializes any of the above-described method steps.

[0096] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of an upgrade device for a general-purpose computer, special-purpose computer, embedded processor, or other programmable distributed system component to produce a machine, such that the instructions, which execute via the processor of the upgrade device for the computer or other programmable distributed system component, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct an upgrade device that controls a computer or other programmable distributed system component to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0099] These computer program instructions can also be loaded onto an upgrade device of a computer or other programmable distributed system component, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0100] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0101] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0102] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0103] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0104] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0105] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for upgrading a distributed system component, characterized in that, include: Obtain the upgrade package of the target component that needs to be upgraded in the distributed system, and the upgrade domain of the target component, wherein the number of the target component is at least one, the upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the upgrade of the corresponding target component, and the upgrade domain includes the nodes required for the upgrade of the corresponding target component; Based on the upgrade batch configuration, the cluster distribution configuration, and the upgrade domain, a component upgrade orchestration is obtained, wherein the component upgrade orchestration includes multiple upgrade batches, each upgrade batch includes multiple upgrade units, and each upgrade unit includes a target component to be upgraded and the node to be upgraded for the target component; According to the component upgrade orchestration, each upgrade unit is traversed, and the target component on each node is upgraded according to the preset logic; The process of obtaining the upgrade package of the target component that needs to be upgraded in the distributed system, and the upgrade domain of the target component, includes: The system receives upgrade information from the distributed system to upgrade components, wherein the upgrade information includes the upgrade package of the component, the dependencies of each component, the upgrade domain of each component, and the cluster distribution configuration of each component. Compare the current deployment version of each component with the version in the upgrade information to determine the target component that needs to be upgraded. Extract the upgrade package of the target component, the dependency relationship between the target components, the upgrade domain of each target component, and the cluster distribution configuration of each target component from the upgrade information; Based on the dependencies between the target components, the upgrade batch configuration is determined, and the upgrade batch configuration and the cluster distribution configuration are added to the upgrade package corresponding to the target component.

2. The method according to claim 1, characterized in that, Based on the component upgrade orchestration, traverse each upgrade unit and upgrade the target component on each node according to the preset logic, including: Select any one upgrade unit from the highest priority upgrade batch; In the nodes of the upgrade unit, the target component of the upgrade unit is upgraded according to the preset logic; After the component upgrade of the upgrade unit is completed, the target components of other upgrade units in the highest priority upgrade batch are upgraded by traversal. When the target components of all upgrade units in the same upgrade batch have been upgraded, the target components of the upgrade units in the next priority upgrade batch are upgraded, until the target components corresponding to all upgrade units in the component upgrade orchestration have been upgraded.

3. The method according to claim 2, characterized in that, In the nodes of the upgrade unit, upgrading the target component of the upgrade unit according to the preset logic includes: The target component of the upgrade unit is upgraded according to the preset logic, wherein the preset logic includes multiple predetermined upgrade processes and multiple component rollback processes. If the first process stage in the plurality of upgrade processes fails, the component upgrade is determined to have failed, wherein the first process stage is a process stage in the plurality of upgrade processes that cannot be rolled back. If the second stage of any of the multiple upgrade processes fails, the component rollback process will proceed. If all the upgrade processes are successful, the component upgrade is determined to be successful.

4. The method according to claim 3, characterized in that, The upgrade process includes at least one of the following: downloading the upgrade package, backing up before the upgrade, offline components, stopping components, upgrading components, starting components, and going online components; The first process stage includes at least one of the following: downloading the upgrade package, or backing up before the upgrade; The second process phase includes at least one of the following: offline component, stop component, upgrade component, start component, and go-live component; The component rollback process includes at least one of the following: uninstallation, rollback configuration, and component rollback.

5. The method according to claim 3, characterized in that, The method further includes: If the component upgrade fails or the component rollback succeeds, the component will be upgraded again until the component upgrade succeeds or the component rollback fails.

6. The method according to claim 1, characterized in that, Before traversing each upgrade unit according to the component upgrade orchestration and upgrading the target component on each node according to the preset logic, the method further includes: Send a check instruction to the upgrade agent of the target component, wherein the check instruction is used to instruct the target component to perform a pre-upgrade check; Upon receiving the inspection results returned by the upgrade agent of the target component; If the inspection results indicate that an upgrade is possible, then the upgrade of the target component shall be performed.

7. An upgrade device for a distributed system component, characterized in that, include: The acquisition module is used to acquire the upgrade package of the target component that needs to be upgraded in the distributed system, and the upgrade domain of the target component. The number of target components is at least one. The upgrade package includes the upgrade batch configuration and cluster distribution configuration required for the upgrade of the target component. The upgrade domain includes the nodes required for the upgrade of the target component. An orchestration module is used to obtain component upgrade orchestration based on the upgrade batch configuration, the cluster distribution configuration, and the upgrade domain. The component upgrade orchestration includes multiple upgrade batches, each upgrade batch includes multiple upgrade units, and each upgrade unit includes a target component to be upgraded and the node to be upgraded for the target component. The upgrade module is used to traverse each upgrade unit according to the component upgrade orchestration and upgrade the target component on each node according to the preset logic; The acquisition module is specifically used for: receiving upgrade information from the distributed system for upgrading components, wherein the upgrade information includes the upgrade package of the component, the dependencies between the components, the upgrade domain of the components, and the cluster distribution configuration of the components; comparing whether the deployment version currently used by each component is consistent with the version in the upgrade information, and determining the target component that needs to be upgraded from the components; extracting the upgrade package of the target component, the dependencies between the target components, the upgrade domain of the target component, and the cluster distribution configuration of the target component from the upgrade information; determining the upgrade batch configuration according to the dependencies between the target components, and adding the upgrade batch configuration and the cluster distribution configuration to the upgrade package corresponding to the target component.

8. A computer-readable storage medium, characterized in that, The storage medium is used to store a program, wherein the program executes the upgrade method for a distributed system component according to any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for upgrading a distributed system component as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Distributed system deployment method, system, electronic device and storage medium

    CN109271170A

  • Upgrading method and device

    CN110162322A