Method and device for upgrading distributed storage system
By determining the components to be upgraded and the target upgrade order in the distributed storage system, and combining the dependency relationship between master and slave storage nodes, a rolling upgrade strategy is adopted to solve the problems of long time consumption for full upgrades and complexity of incremental upgrades, thus achieving efficient and flexible system upgrades.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, full upgrades of distributed storage systems are time-consuming and inefficient, while incremental upgrades can only be performed on specific versions and are complex to maintain, making it difficult to upgrade efficiently in rapidly iterating clusters.
By acquiring upgrade data packets and transmitting them to storage nodes, the components to be upgraded and their target upgrade order are determined. Based on the dependencies and types of master and slave storage nodes, a rolling upgrade strategy is adopted to ensure uninterrupted online upgrades of the cluster.
It enables flexible and efficient upgrades to distributed storage systems, supporting upgrades from any historical version to the latest version, reducing operational complexity, and improving the efficiency of cluster upgrades and deployments during rapid iteration phases.
Smart Images

Figure CN121900779A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of system upgrades, and specifically relates to a method, apparatus, electronic device, and storage medium for upgrading a distributed storage system. Background Technology
[0002] A distributed system consists of multiple highly available, distributed components that work together to provide a unified storage service. As business grows and requirements change, the system needs to be continuously iterated upon, with specific modules being upgraded.
[0003] Currently, system upgrades are mainly divided into two types: full upgrades and incremental upgrades. A full upgrade completely replaces the old version with the new one. Its advantages are cross-version upgrades and high flexibility, but its disadvantages are large upgrade packages, long processing times, and low efficiency. An incremental upgrade only updates the differences between versions. Its advantages are small upgrade packages and fast speed, but its disadvantages are that it can only upgrade to specific versions and requires maintaining numerous differences between versions, making maintenance increasingly complex with version iterations. Summary of the Invention
[0004] The purpose of this application is to provide a method and apparatus for upgrading a distributed storage system, which can solve the problems of large upgrade packages, long time consumption, and low efficiency in full upgrades, and incremental upgrades that can only upgrade to specific versions and require maintaining the differential relationships between many versions, which makes operation and maintenance increasingly complex with version iterations.
[0005] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a method for upgrading a distributed storage system, the distributed storage system including multiple storage nodes, each storage node including multiple components, the method comprising: Obtain the upgrade data packet and transmit the upgrade data packet to the first storage node; In response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to the second storage node, and multiple components to be upgraded in the target storage node are identified; wherein, the multiple components to be upgraded include the components specified by the user in the upgrade command; Determine the target upgrade order for the plurality of components to be upgraded; The multiple components to be upgraded are upgraded according to the target upgrade order.
[0006] Optionally, the plurality of storage nodes includes a primary storage node and a standby storage node, and the target node includes at least one primary storage node and a standby storage node. Determining the target upgrade order of the plurality of components to be upgraded includes: The first upgrade order is determined based on the dependencies between multiple components in the target storage node; A second upgrade order is determined based on the node type of the target storage node where the plurality of components to be upgraded are located; in the second upgrade order, the backup storage node is placed before the primary storage node; The target upgrade order is determined based on the first upgrade order and the second upgrade order.
[0007] Optionally, it also includes: If the upgrade of the component to be upgraded fails, the reason for the upgrade failure will be reported. After the reason for the upgrade failure is resolved, the component to be upgraded is detected to obtain upgrade status data; Based on the upgrade status data, determine the upgrade failure breakpoint; Based on the upgrade failure breakpoint, the upgrade of the component to be upgraded continues.
[0008] Optionally, upgrading the plurality of components to be upgraded according to the target upgrade order includes: Stop the operation of the aforementioned components to be upgraded; Environmental detection is performed on the plurality of components to be upgraded, and if the environmental detection meets the preset upgrade conditions, the plurality of components to be upgraded are upgraded according to the component upgrade data package; The upgraded components undergo environmental testing, and the upgraded components are started if the environmental testing meets the preset startup conditions. Modify the corresponding environment configuration based on the upgraded components.
[0009] Optionally, determining multiple components to be upgraded in the target storage node includes: If the upgrade instruction does not include the user-specified component, multiple components to be upgraded in the target storage node are determined to be components determined according to a preset upgrade configuration.
[0010] Optionally, after upgrading the plurality of components to be upgraded, the method further includes: Perform garbage file cleanup on the target storage node and update the system version number of the distributed storage system.
[0011] Optionally, the component to be upgraded includes one of the following: Application process, configuration file directory, resource file directory, single resource file, single configuration file.
[0012] Secondly, embodiments of this application provide an apparatus for upgrading a distributed storage system, the distributed storage system including multiple storage nodes, each storage node including multiple components, and the apparatus including: The data acquisition module is used to acquire the upgrade data packet and transmit the upgrade data packet to the first storage node; A data transmission module is used to transmit the upgrade data packet from the first storage node to the second storage node in response to the user's upgrade command, and to determine multiple components to be upgraded in the target storage node; wherein, the multiple components to be upgraded include the components specified by the user in the upgrade command; The sequence determination module is used to determine the target upgrade order of the plurality of components to be upgraded; The upgrade module is used to upgrade the plurality of components to be upgraded according to the target upgrade order.
[0013] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0014] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0015] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0016] In this embodiment, by acquiring an upgrade data packet and transmitting it to a first storage node, in response to a user's upgrade command, the upgrade data packet is transmitted from the first storage node to a second storage node. Multiple components to be upgraded are identified in the target storage node, including the components specified by the user in the upgrade command. A target upgrade order for these components is determined, and the components are upgraded according to this order. This allows for user-specified component upgrades, which are more efficient and flexible than full upgrades. Furthermore, only one upgrade package needs to be maintained during development and maintenance to support upgrades from any historical version to the latest version. Therefore, it is easier to maintain than incremental upgrades, especially during rapid cluster iteration and changes, thus improving upgrade deployment efficiency. Attached Figure Description
[0017] To more clearly illustrate the technical solution of this application, the drawings used in the description of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the steps of a method for upgrading a distributed storage system provided in some embodiments of this application; Figure 2 This is a schematic diagram illustrating the steps of a distributed storage system upgrade process provided in some embodiments of this application; Figure 3 This is a structural block diagram of an apparatus for upgrading a distributed storage system provided in some embodiments of this application; Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application. Detailed Implementation
[0019] 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.
[0020] A distributed storage system consists of highly available, distributed, and consistent software components. These components collaborate to provide a unified storage service. Faced with complex business and application scenarios, the characteristics or functions of a distributed storage system may change with iterations and evolving requirements. Therefore, it is necessary to upgrade certain business modules. Generally, if the distributed storage system does not support online upgrades, the entire distributed storage system in the cluster must be shut down before any upgrade is performed. Then, the distributed storage system components in each device are upgraded one by one before the entire distributed storage system in the cluster is restarted.
[0021] Because this upgrade method requires shutting down the entire distributed storage system during the upgrade process, and data services cannot be provided during the downtime, the availability of the entire system will be severely affected if the storage cluster service is interrupted for a long time or data is lost.
[0022] Currently, system upgrades are divided into full upgrades and incremental upgrades. A full upgrade replaces all content of the current version on the device with the complete content of the target version. A full upgrade doesn't consider the currently running version and doesn't create a separate upgrade package; it can upgrade to any other version. However, a full upgrade updates more components, takes longer, and has lower efficiency. Incremental upgrades, on the other hand, can only upgrade to a specific version and require maintaining the differences between versions. As the product iterates, the amount of content to maintain increases, making maintenance and development work more difficult.
[0023] In one embodiment of this application, upgrades are combined through configuration and by specifying upgrade components, making the upgrade function more flexible, enabling rapid version iteration, and adapting to more diverse scenarios, ultimately achieving the goal of cluster upgrade. Simultaneously, distributed storage system upgrades must be performed while ensuring cluster system availability and data integrity. This application ensures online cluster upgrades during the upgrade process, enabling the cluster to provide services normally without interruption.
[0024] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0025] The following description, in conjunction with the accompanying drawings, details a method for upgrading a distributed storage system provided in this application through specific embodiments and application scenarios.
[0026] Reference Figure 1 This document illustrates a flowchart of a method for upgrading a distributed storage system according to some embodiments of this application. The distributed storage system includes multiple storage nodes, and each storage node includes multiple components. Specifically, the method may include the following steps: Step 101: Obtain the upgrade data packet and transmit the upgrade data packet to the first storage node.
[0027] To upgrade a distributed storage system, an upgrade data package can be obtained, which may be a full upgrade package. This upgrade data package is then deployed on the first storage node in the distributed storage system. The distributed storage system may include multiple storage nodes, and the first storage node can be any one of these nodes.
[0028] Step 102: In response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to the second storage node, and multiple components to be upgraded in the target storage node are identified; wherein, the multiple components to be upgraded include the components specified by the user in the upgrade command.
[0029] The upgrade data package can include the main upgrade program and the upgrade agent program. After the user issues the upgrade command, the main upgrade program can respond to the user's upgrade command, execute the upgrade command and specify the upgrade data package path without relying on the processing logic of the old version.
[0030] Specifically, in response to the user's upgrade command, the main upgrade program starts and changes the environment status of the distributed storage system to "upgrading" to prevent operations that modify the environment type of the distributed storage system during the upgrade. This is to prevent the old and new components from having different processing logics during the upgrade, which could lead to configuration or data problems and damage the entire distributed storage system environment.
[0031] The upgrade program performs an environment check on the distributed storage system. After the environment check, the upgrade data packet is transmitted from the first storage node to the second storage node. The second storage node can be any node in the distributed storage system other than the first storage node. Simultaneously, multiple components to be upgraded are identified in the target storage node. These multiple components can be those specified by the user in the user instructions.
[0032] It should be noted that there can be one or more target storage nodes, and the upgrade instruction can specify one of the target storage nodes to be upgraded.
[0033] In practical applications, the main upgrade program performs a pre-check on the distributed storage system environment and the version of the upgrade data package. If the distributed storage environment meets the upgrade conditions, the distributed storage system environment status is set to upgrade. Then, the upgrade data package is sent from the first storage node to the second storage node and the multiple components to be upgraded in the target storage node are identified.
[0034] In some embodiments of this application, determining multiple components to be upgraded in the target storage node includes: If the upgrade instruction does not include the user-specified component, multiple components to be upgraded in the target storage node are determined to be components determined according to a preset upgrade configuration.
[0035] If the user does not specify any specific components to upgrade in the upgrade command, the multiple components to be upgraded in the target storage node can be obtained according to the preset upgrade configuration of the distributed storage system. In other words, the user can specify multiple components to be upgraded in the target storage node in the upgrade command, or they can choose not to specify them.
[0036] Step 103: Determine the target upgrade order of the plurality of components to be upgraded.
[0037] After identifying multiple components to be upgraded in the target storage node, it is necessary to determine the target upgrade order of these components.
[0038] In some embodiments of this application, the plurality of storage nodes include a primary storage node and a standby storage node, and the target node includes at least one primary storage node and a standby storage node. Determining the target upgrade order of the plurality of components to be upgraded includes: Sub-step 11: Determine the first upgrade order based on the dependencies of multiple components in the target storage node.
[0039] In a distributed storage system, storage nodes are divided into multiple components that work together in coordination, with dependencies between them. Therefore, the main upgrade program can determine the first upgrade order by sorting the components in the target storage node according to their dependencies. It's worth noting that if the component to be upgraded is only one component within the target storage node, then there's no need to determine the upgrade order.
[0040] Sub-step 12: Determine the second upgrade order based on the node type of the target storage node where the multiple components to be upgraded are located; in the second upgrade order, the backup storage node is placed before the primary storage node.
[0041] The storage nodes are categorized into primary and standby storage nodes, and the target node includes at least one primary and one standby storage node. The main upgrade program distinguishes multiple components within the target storage node, that is, it distinguishes the node types of the target storage nodes containing the components to be upgraded, thereby sorting the storage nodes to be upgraded and determining the second upgrade order. Components on the standby storage node are upgraded first, and the upgrade operation of the primary storage node is executed only after the primary-standby or primary-slave switchover operation is completed.
[0042] Furthermore, online upgrades can be implemented simultaneously with the upgrade of the distributed storage system, ensuring high availability, preventing data loss, and enabling the cluster to continue providing services. By fully leveraging the high availability characteristics of distributed storage systems, differentiating the relationships between master-slave and master-standby storage nodes, and combining and prioritizing components and storage nodes according to their roles, a rolling upgrade strategy is adopted to ensure uninterrupted service during the upgrade process. This maximizes service availability during the upgrade, resulting in uninterrupted cluster operations. Compared to offline upgrades, this approach offers higher product availability and more reliable service.
[0043] Sub-step 13: Determine the target upgrade order based on the first upgrade order and the second upgrade order.
[0044] By combining the upgrade rules in the first and second upgrade sequences, the target upgrade sequence can be obtained. Furthermore, based on these rules, the upgrade order of components and their respective storage nodes can be determined. This ensures that the cluster can continue to provide services during upgrades, guaranteeing data integrity.
[0045] In some embodiments of this application, the component to be upgraded includes one of the following: Application process, configuration file directory, resource file directory, single resource file, single configuration file.
[0046] In practical applications, components can be not only application processes in a distributed cluster, but also smaller units and directories, including configuration file directories, resource file directories, or individual resource files. These finer-grained components can be specified and combined during upgrades, enabling more flexible upgrades and eliminating the problems of relying on fixed strategies, low efficiency, and difficult maintenance. For example, if an upgrade iteration only requires updating a file in a specific folder or a configuration file within the cluster, the folder or configuration file can be used as a component. Upgrades can be performed by user-input upgrade commands or by pre-arranged preset upgrade configurations, making updates more agile and flexible, while also allowing for finer-grained updates.
[0047] In one example, the upgrade package can be a full upgrade package. During the upgrade, the existing distributed storage system can be analyzed, and incremental upgrades can be performed based on the user-specified components and their dependencies. This allows for more flexible assembly of upgrade components, shortens the time required for full upgrades, reduces unnecessary operations, and allows for code logic reuse, minimizing the large amount of redundant logic required for incremental upgrades. When the user specifies upgrade components, the specified components are validated and sorted to determine the upgrade order on the storage nodes. For components with availability requirements, the upgrade order proceeds from backup nodes to primary nodes.
[0048] Step 104: Upgrade the plurality of components to be upgraded according to the target upgrade order.
[0049] After determining the target upgrade order, the main upgrade program sends a check command to the upgrade agent program. The upgrade agent program then performs pre-upgrade checks, such as checking the status of the target storage nodes, and returns the status information of the components under the target storage nodes to the main upgrade program. Based on the current status of the components under the target storage nodes, the main upgrade program performs preliminary data preparation and file generation operations. Finally, the main upgrade program issues upgrade commands to the target storage nodes, and the upgrade agent program upgrades the components according to the target upgrade order.
[0050] In some embodiments of this application, upgrading the plurality of components to be upgraded according to the target upgrade order includes: Sub-step 21: Stop running the multiple components to be upgraded.
[0051] The upgrade agent performs upgrades on multiple components to be upgraded. Before stopping the operation of the multiple components to be upgraded, the configuration, associated dependency files, packages, and other contents of the multiple components to be upgraded can be replaced, and then the operation of the multiple components to be upgraded can be stopped.
[0052] Sub-step 22 involves performing environmental detection on the plurality of components to be upgraded, and upgrading the plurality of components to be upgraded according to the component upgrade data package if the environmental detection meets the preset upgrade conditions.
[0053] After stopping the operation of the multiple components to be upgraded, the upgrade agent performs necessary environment checks. If the environment does not meet the preset upgrade conditions, the upgrade cannot proceed. At this point, the main upgrade program is interrupted, temporary files generated during the upgrade are cleaned up, and relevant abnormal environment information is transmitted to the user. The preset upgrade conditions are not specifically limited here, but may include some constraints commonly encountered when upgrading distributed storage systems.
[0054] If the environment meets the preset upgrade conditions, the upgrade agent will upgrade multiple components to be upgraded sequentially using upgrade data packets, according to the target upgrade order.
[0055] Sub-step 23 involves performing environmental detection on the upgraded components and starting the upgraded components if the environmental detection meets the preset startup conditions.
[0056] After upgrading multiple components, an environment check is required to ensure that the upgraded components can start normally. Then, if the environment check meets the preset startup conditions, the upgraded components are started. These preset startup conditions are not specifically limited here, but can include some common startup conditions or operations for components in a distributed storage system.
[0057] Sub-step 24: Modify the corresponding environment configuration based on the upgraded components.
[0058] After the upgraded components are started, the environment configuration needs to be modified to complete the upgrade of the components.
[0059] In some embodiments of this application, the method further includes: Step 105: If the upgrade of the component to be upgraded fails, provide feedback on the reason for the upgrade failure.
[0060] When upgrading multiple components, one or more may fail. In such cases, the reason for the failure can be provided to the user so that they can fix the problem. Step 106: After the upgrade failure reason is resolved, the component to be upgraded is detected to obtain upgrade status data.
[0061] After the user fixes the problem, i.e. after the reason for the upgrade failure is resolved, in order to re-upgrade and make the upgrade successful, the components that failed to upgrade can be checked to obtain the upgrade status of the components at the time of the upgrade failure.
[0062] Step 107: Determine the upgrade failure breakpoint based on the upgrade status data.
[0063] After obtaining the upgrade status data, the upgrade failure breakpoint of the corresponding upgrade-failed node can be determined.
[0064] Step 108: Based on the upgrade failure breakpoint, continue to upgrade the component to be upgraded.
[0065] After obtaining the upgrade failure breakpoint of the component to be upgraded that failed to upgrade, the upgrade agent program re-enters the breakpoint and continues the upgrade from the point of upgrade failure.
[0066] In one example, if the upgrade of a component fails, the upgrade can be re-attempted until it succeeds, at which point the status is changed and the component is notified of the successful upgrade. Alternatively, during a new round of distributed storage system upgrades, after determining the target upgrade order, the main upgrade program sends a check command to the upgrade agent. The upgrade agent performs pre-upgrade checks, such as checking storage node upgrade breakpoints. If any component under the target storage node fails to upgrade, the corresponding upgrade status data is obtained based on this status check, allowing re-entry from the breakpoint of the previous upgrade failure to continue the upgrade. In other words, this application supports re-entrant upgrade breakpoints, thereby shortening upgrade time and improving upgrade availability.
[0067] In some embodiments of this application, after upgrading the plurality of components to be upgraded, the method further includes: Perform garbage file cleanup on the target storage node and update the system version number of the distributed storage system.
[0068] After the upgrade agent completes the upgrade, it can uniformly clean up and restore redundant files, installation and decompression packages, intermediate files, etc. generated during the upgrade on the target storage node, as well as perform other subsequent upgrade operations. Upon completion, it notifies the main upgrade program, which then deletes the temporary data and files generated during the upgrade process for coordination and recording, restores the state of the distributed storage system (i.e., reverts to the state during the upgrade), and finally updates the version number of the distributed storage system to the new version number after the upgrade. Successful version number modification signifies a successful upgrade, and the user is notified of the upgrade completion.
[0069] In the embodiments of this application, by acquiring an upgrade data packet and transmitting the upgrade data packet to a first storage node, in response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to a second storage node, and multiple components to be upgraded in the target storage node are determined. The multiple components to be upgraded include the components specified by the user in the upgrade command. The target upgrade order of the multiple components to be upgraded is determined, and the multiple components to be upgraded are upgraded according to the target upgrade order. This realizes that the upgrade is performed by the user specifying the components. During the upgrade, only the specified components need to be upgraded, which is more efficient and flexible than a full upgrade. Moreover, during development and maintenance, only one upgrade package needs to be maintained to support upgrades from any historical version to the current latest version. Therefore, it is easier to maintain than incremental upgrades, especially in the stage of rapid cluster iteration and change, which can improve the efficiency of upgrade deployment.
[0070] Reference Figure 2This illustration shows a step-by-step diagram of a distributed storage system upgrade process provided by some embodiments of this application, which may specifically include the following steps: 1. Upgrade the main program: Preparation of the upgrade agent program environment and configuration and dependency environment before the upgrade. That is, the environment test of the distributed storage system is performed on the upgrade main program.
[0071] 2. Upgrade main program: Transmit upgrade data package and obtain the components to be upgraded. That is, after environment detection, the upgrade data package is transmitted from the first storage node to the second storage node.
[0072] Upgrade Agent: Obtains the upgrade data package, decompresses the package and prepares the upgrade environment, and returns the processing result to the main upgrade program.
[0073] 3. Upgrade the main program: Arrange the component upgrade order, that is, determine the target upgrade order of multiple components to be upgraded.
[0074] 4. Upgrade Main Program: Before upgrading, the main program performs a node environment check and issues an upgrade command. This involves the main program sending a check command to the upgrade agent program. Based on the current status of the components on the target storage node, the main program performs preliminary data preparation and file generation operations. Then, the main program issues the upgrade command to the target storage node, and the upgrade agent program upgrades the components according to the target upgrade order.
[0075] Upgrade Agent: The upgrade agent performs pre-upgrade detection operations such as the target storage node status (which may include upgrade status data), and returns the status information of the components under the target storage node to the upgrade main program.
[0076] Then, the upgrade agent performs the upgrade of multiple components to be upgraded. Before stopping the operation of the multiple components to be upgraded, the configuration, related dependency files, packages, and other contents of the multiple components to be upgraded can be replaced, and then the operation of the multiple components to be upgraded is stopped.
[0077] After stopping the operation of the multiple components to be upgraded, the upgrade agent performs necessary environment checks. If the environment meets the preset upgrade conditions, the upgrade agent will upgrade the multiple components to be upgraded sequentially according to the target upgrade order, using upgrade data packets.
[0078] After upgrading multiple components, an environment test needs to be performed on the upgraded components to ensure that they can start normally. Then, if the environment test meets the preset startup conditions, the upgraded components are started.
[0079] After the upgraded components are started, the environment configuration needs to be modified to complete the upgrade of the components. The upgrade results are then returned to the main upgrade program.
[0080] 5. Upgrade the main program: All upgrade operations are completed, meaning that the upgrade operations for multiple components to be upgraded in the target storage node are completed.
[0081] After the cluster (i.e., distributed storage system) upgrade is complete, the following operations are performed: the upgrade agent program can uniformly clean up and restore redundant files, installation and decompression packages, intermediate files, etc. generated during the upgrade on the target storage nodes, and perform other follow-up upgrade operations. Upon completion, the main upgrade program is notified, which then deletes the temporary data and files generated during the upgrade process for coordination and recording, restores the state of the distributed storage system (i.e., restores the state during the upgrade), and finally modifies the version number of the distributed storage system to the new version number after the upgrade. Successful version number modification signifies a successful upgrade, and the user is notified of the upgrade completion.
[0082] 6. This upgrade of the distributed storage system for the user is now complete.
[0083] In the embodiments of this application, by acquiring an upgrade data packet and transmitting the upgrade data packet to a first storage node, in response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to a second storage node, and multiple components to be upgraded in the target storage node are determined. The multiple components to be upgraded include the components specified by the user in the upgrade command. The target upgrade order of the multiple components to be upgraded is determined, and the multiple components to be upgraded are upgraded according to the target upgrade order. This realizes that the upgrade is performed by the user specifying the components. During the upgrade, only the specified components need to be upgraded, which is more efficient and flexible than a full upgrade. Moreover, during development and maintenance, only one upgrade package needs to be maintained to support upgrades from any historical version to the current latest version. Therefore, it is easier to maintain than incremental upgrades, especially in the stage of rapid cluster iteration and change, which can improve the efficiency of upgrade deployment.
[0084] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0085] Reference Figure 3The diagram illustrates a structural schematic of an apparatus for upgrading a distributed storage system according to some embodiments of this application. The distributed storage system includes multiple storage nodes, and each storage node includes multiple components, specifically including the following modules: Data acquisition module 301 is used to acquire upgrade data packets and transmit the upgrade data packets to the first storage node; The data transmission module 302 is used to transmit the upgrade data packet from the first storage node to the second storage node in response to the user's upgrade command, and to determine a plurality of components to be upgraded in the target storage node; wherein, the plurality of components to be upgraded include the components specified by the user in the upgrade command; Sequence determination module 303 is used to determine the target upgrade sequence of the plurality of components to be upgraded; The upgrade module 304 is used to upgrade the plurality of components to be upgraded according to the target upgrade order.
[0086] In one embodiment of this application, the plurality of storage nodes includes a primary storage node and a backup storage node, the target node includes at least one primary storage node and a backup storage node, and the order determination module 303 includes: The first order determination submodule is used to determine the first upgrade order based on the dependencies of multiple components in the target storage node; The second order determination submodule is used to determine the second upgrade order based on the node type of the target storage node where the plurality of components to be upgraded are located; in the second upgrade order, the backup storage node is placed before the primary storage node; The target order submodule is used to determine the target upgrade order based on the first upgrade order and the second upgrade order.
[0087] In one embodiment of this application, it further includes: The feedback module is used to provide feedback on the reason for the upgrade failure when the upgrade of the component to be upgraded fails. The detection module is used to detect the component to be upgraded after the upgrade failure reason is resolved, and obtain upgrade status data; The breakpoint determination module is used to determine the upgrade failure breakpoint based on the upgrade status data; The breakpoint upgrade module is used to continue upgrading the component to be upgraded based on the upgrade failure breakpoint.
[0088] In one embodiment of this application, the upgrade module 304 includes: The stop submodule is used to stop the operation of the multiple components to be upgraded. The component upgrade submodule is used to perform environmental detection on the plurality of components to be upgraded, and upgrade the plurality of components to be upgraded according to the component upgrade data package if the environmental detection meets the preset upgrade conditions; The startup submodule is used to perform environmental detection on multiple upgraded components, and to start the multiple upgraded components when the environmental detection meets the preset startup conditions; The configuration modification submodule is used to modify the corresponding environment configuration based on the upgraded components.
[0089] In one embodiment of this application, the data sending module 302 includes: The component determination submodule is used to determine, when the upgrade instruction does not include the user-specified component, multiple components to be upgraded in the target storage node as components determined according to a preset upgrade configuration.
[0090] In one embodiment of this application, after upgrading the plurality of components to be upgraded, the method further includes: The version number update module is used to clean up junk files on the target storage node and update the system version number of the distributed storage system.
[0091] In one embodiment of this application, the component to be upgraded includes one of the following: Application process, configuration file directory, resource file directory, single resource file, single configuration file.
[0092] The apparatus for upgrading a distributed storage system in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0093] The apparatus for upgrading a distributed storage system in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0094] The apparatus for upgrading a distributed storage system provided in this application embodiment can achieve... Figures 1 to 2 The various processes implemented by the apparatus for upgrading a distributed storage system in the method embodiment are not described in detail here to avoid repetition.
[0095] In the embodiments of this application, by acquiring an upgrade data packet and transmitting the upgrade data packet to a first storage node, in response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to a second storage node, and multiple components to be upgraded in the target storage node are determined. The multiple components to be upgraded include the components specified by the user in the upgrade command. The target upgrade order of the multiple components to be upgraded is determined, and the multiple components to be upgraded are upgraded according to the target upgrade order. This realizes that the upgrade is performed by the user specifying the components. During the upgrade, only the specified components need to be upgraded, which is more efficient and flexible than a full upgrade. Moreover, during development and maintenance, only one upgrade package needs to be maintained to support upgrades from any historical version to the current latest version. Therefore, it is easier to maintain than incremental upgrades, especially in the stage of rapid cluster iteration and change, which can improve the efficiency of upgrade deployment.
[0096] Optionally, this application embodiment also provides an electronic device, including a processor 410, a memory 409, and a program or instructions stored in the memory 409 and executable on the processor 410. When the program or instructions are executed by the processor 410, they implement the various processes of the above-described method embodiment for upgrading the distributed storage system and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0097] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0098] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. The electronic device 400 includes, but is not limited to, components such as: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.
[0099] The user input unit 407 includes a touch panel 4071 and other input devices 4072, the display unit 406 includes a display panel 4061, and the input unit includes a graphics processor 4041 and a microphone 4042.
[0100] Those skilled in the art will understand that the electronic device 400 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 410 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here. This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described method embodiment for upgrading a distributed storage system and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0101] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0102] This application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described method embodiments for upgrading the distributed storage system, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0103] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0104] In the embodiments of this application, by acquiring an upgrade data packet and transmitting the upgrade data packet to a first storage node, in response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to a second storage node, and multiple components to be upgraded in the target storage node are determined. The multiple components to be upgraded include the components specified by the user in the upgrade command. The target upgrade order of the multiple components to be upgraded is determined, and the multiple components to be upgraded are upgraded according to the target upgrade order. This realizes that the upgrade is performed by the user specifying the components. During the upgrade, only the specified components need to be upgraded, which is more efficient and flexible than a full upgrade. Moreover, during development and maintenance, only one upgrade package needs to be maintained to support upgrades from any historical version to the current latest version. Therefore, it is easier to maintain than incremental upgrades, especially in the stage of rapid cluster iteration and change, which can improve the efficiency of upgrade deployment.
[0105] It should be noted that, in this document, 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 a process, method, article, or apparatus. Without further limitations, 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. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0106] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0107] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for upgrading a distributed storage system, characterized in that, The distributed storage system includes multiple storage nodes, and each storage node includes multiple components. The method includes: Obtain the upgrade data packet and transmit the upgrade data packet to the first storage node; In response to the user's upgrade command, the upgrade data packet is transmitted from the first storage node to the second storage node, and multiple components to be upgraded in the target storage node are identified; wherein, the multiple components to be upgraded include the components specified by the user in the upgrade command; Determine the target upgrade order for the plurality of components to be upgraded; The multiple components to be upgraded are upgraded according to the target upgrade order.
2. The method according to claim 1, characterized in that, The plurality of storage nodes includes a primary storage node and a standby storage node, and the target node includes at least one primary storage node and a standby storage node. Determining the target upgrade order of the plurality of components to be upgraded includes: The first upgrade order is determined based on the dependencies between multiple components in the target storage node; A second upgrade order is determined based on the node type of the target storage node where the plurality of components to be upgraded are located; in the second upgrade order, the backup storage node is placed before the primary storage node; The target upgrade order is determined based on the first upgrade order and the second upgrade order.
3. The method according to claim 1, characterized in that, Also includes: If the upgrade of the component to be upgraded fails, the reason for the upgrade failure will be reported. After the reason for the upgrade failure is resolved, the component to be upgraded is detected to obtain upgrade status data; Based on the upgrade status data, determine the upgrade failure breakpoint; Based on the upgrade failure breakpoint, the upgrade of the component to be upgraded continues.
4. The method according to claim 1, characterized in that, The step of upgrading the plurality of components to be upgraded according to the target upgrade order includes: Stop the operation of the aforementioned components to be upgraded; Environmental detection is performed on the plurality of components to be upgraded, and if the environmental detection meets the preset upgrade conditions, the plurality of components to be upgraded are upgraded according to the component upgrade data package; The upgraded components undergo environmental testing, and the upgraded components are started if the environmental testing meets the preset startup conditions. Modify the corresponding environment configuration based on the upgraded components.
5. The method according to any one of claims 1-4, characterized in that, The determination of multiple components to be upgraded in the target storage node includes: If the upgrade instruction does not include the user-specified component, multiple components to be upgraded in the target storage node are determined to be components determined according to a preset upgrade configuration.
6. The method according to any one of claims 1-4, characterized in that, After upgrading the aforementioned components, the process also includes: Perform garbage file cleanup on the target storage node and update the system version number of the distributed storage system.
7. The method according to any one of claims 1-4, characterized in that, The component to be upgraded includes one of the following: Application process, configuration file directory, resource file directory, single resource file, single configuration file.
8. An apparatus for upgrading a distributed storage system, characterized in that, The distributed storage system includes multiple storage nodes, each storage node includes multiple components, and the device includes: The data acquisition module is used to acquire the upgrade data packet and transmit the upgrade data packet to the first storage node; A data transmission module is used to transmit the upgrade data packet from the first storage node to the second storage node in response to the user's upgrade command, and to determine multiple components to be upgraded in the target storage node; wherein, the multiple components to be upgraded include the components specified by the user in the upgrade command; The sequence determination module is used to determine the target upgrade order of the plurality of components to be upgraded; The upgrade module is used to upgrade the plurality of components to be upgraded according to the target upgrade order.
9. An electronic device, characterized in that, The system includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements a method for upgrading a distributed storage system as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, A computer program is stored on the readable storage medium, which, when executed by a processor, implements the method for upgrading a distributed storage system as described in any one of claims 1 to 7.