A method, system and related components for software upgrade of a distributed system
By distributing upgrade packages to multiple download sources in distributed systems based on network topology and node status, the method addresses inefficiencies and bottlenecks, achieving efficient and controlled software upgrades.
Patent Information
- Application Number
- CN202011445245.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-11
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2040-12-11
AI Technical Summary
The existing distributed system software upgrade methods are inefficient, and the sequential upgrade takes a long time. There is a bandwidth bottleneck in distribution of upgrade packages, the upgrade progress cannot be controlled, and there is a lack of dynamic adjustment methods.
Obtain the upgrade package through the master node and determine the download source in multiple slave nodes. Distribute the upgrade package to multiple download sources. Control the slave node to select the download source according to its own status for downloading, and use the upgrade package to upgrade.
It improves the upgrade efficiency, alleviates network bandwidth pressure, avoids single-node bottlenecks, and realizes dynamic adjustment of the controllability of the slave node download process and overall upgrade progress.
Smart Images

Figure CN112486541B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed systems, and particularly to a method, a system and related components for software upgrade of a distributed system. Background Art
[0002] With the continuous development of social informatization, distributed systems are becoming increasingly popular, with an expanding scale and a continuously increasing upgrade difficulty. Currently, distributed systems generally adopt a sequential execution method to upgrade all nodes in sequence. This solution has the following problems:
[0003] Low efficiency. The time-consuming of sequential upgrade is proportional to the number of nodes in the system. When the system scale becomes larger and larger, sequential upgrade seems powerless;
[0004] There is a bottleneck in distributing upgrade packages. Whether actively pushing upgrade packages or having the nodes to be upgraded pull them actively, it will cause great pressure on the bandwidth of the master node;
[0005] The upgrade progress cannot be controlled. The sequential upgrade process is too rigid and cannot be dynamically adjusted in real time according to the cluster status. If an upgrade failure occurs, there is a lack of necessary means to intervene in the upgrade process.
[0006] Therefore, how to provide a solution to solve the above technical problems is an issue that needs to be solved by those skilled in the art at present. Summary of the Invention
[0007] In view of this, the purpose of the present invention is to provide a more flexible and efficient method, a system and related components for software upgrade of a distributed system. The specific solutions are as follows:
[0008] A method for software upgrade of a distributed system includes:
[0009] Obtaining an uploaded upgrade package through a master node;
[0010] Determining multiple download sources among the master node and multiple slave nodes according to the current network topology, and distributing the upgrade package to the multiple download sources;
[0011] Pushing download repository information to all the slave nodes through the master node, where the download repository information includes the address information of the download sources and the upgrade package;
[0012] Controlling each slave node to select a corresponding download source according to its own status to download the upgrade package, and using the upgrade package for upgrade.
[0013] Preferably, the process of controlling each slave node to select a corresponding download source according to its own status to download the upgrade package specifically includes:
[0014] Control each of the slave nodes to select a corresponding download source to download the upgrade package according to the node position in the current network topology and the network congestion situation.
[0015] Preferably, the process of controlling each of the slave nodes to select a corresponding download source to download the upgrade package according to the node position in the current network topology and the network congestion situation includes:
[0016] Control each of the slave nodes to select a download source according to the node position in the current network topology and the network congestion situation to download the upgrade package within a preset time period.
[0017] Preferably, the process of controlling each of the slave nodes to select a corresponding download source to download the upgrade package according to the node position in the current network topology and the network congestion situation includes:
[0018] Control each of the slave nodes to select multiple download sources according to the node position in the current network topology and the network congestion situation to download the upgrade package in chunks.
[0019] Preferably, the process of controlling each of the slave nodes to select a corresponding download source to download the upgrade package according to the node position in the current network topology and the network congestion situation includes:
[0020] Control each of the slave nodes to select multiple preset time periods according to the node position in the current network topology and the network congestion situation, and select a corresponding download source in each preset time period to download the upgrade package in a time-sharing and chunking manner.
[0021] Preferably, before controlling each of the slave nodes to select a corresponding download source to download the upgrade package according to its own status and using the upgrade package for upgrading, it further includes:
[0022] Send an upgrade instruction to the slave nodes to be upgraded through the master node;
[0023] Correspondingly, the process of controlling each of the slave nodes to select a corresponding download source to download the upgrade package according to its own status and using the upgrade package for upgrading includes:
[0024] Control each of the slave nodes that receives the upgrade instruction to select a corresponding download source to download the upgrade package according to its own status and use the upgrade package for upgrading.
[0025] Preferably, the upgrade instruction is specifically determined by the master node according to the upgrade package.
[0026] Correspondingly, the present application also discloses a distributed system software upgrade system, including:
[0027] Upgrade package upload module, used to obtain the uploaded upgrade package through the master node;
[0028] Download source determination module, used to determine multiple download sources among the master node and multiple slave nodes according to the current network topology, and distribute the upgrade package to the multiple download sources;
[0029] Download source push module, used to push download repository information to all slave nodes through the master node, where the download repository information includes the addresses of the download sources and the upgrade package;
[0030] Upgrade package download module, used to use the download repository information to control each slave node to select the corresponding download source according to its own status to download the upgrade package, and perform the upgrade using the upgrade package.
[0031] Correspondingly, the present application also discloses a distributed system software upgrade device, including:
[0032] Memory, used to store computer programs;
[0033] Processor, used to implement the steps of the distributed system software upgrade method as described in any one of the above when executing the computer program.
[0034] Correspondingly, the present application also discloses a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the distributed system software upgrade method as described in any one of the above.
[0035] The present application discloses a distributed system software upgrade method, including: obtaining the uploaded upgrade package through the master node; determining multiple download sources among the master node and multiple slave nodes according to the current network topology, and distributing the upgrade package to the multiple download sources; pushing download repository information to all slave nodes through the master node, where the download repository information includes the addresses of the download sources and the upgrade package; using the download repository information to control each slave node to select the corresponding download source according to its own status to download the upgrade package, and perform the upgrade using the upgrade package. In the present application, the upgrade package is distributed in sequence in the structure of the master node, download source, and slave node, the upgrade efficiency is significantly improved, and the network bandwidth pressure is relieved, avoiding the generation of a single-node network bottleneck, and the process of the slave node downloading the upgrade package is controllable, which can effectively control the software upgrade progress of the overall distributed system and adjust it at any time according to the cluster situation. Description of the Drawings
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0037] Figure 1 It is a flowchart of the steps of a method for software upgrade of a distributed system in an embodiment of the present invention;
[0038] Figure 2 It is a structural distribution diagram of a software upgrade system for a distributed system in an embodiment of the present invention. Detailed implementation manners
[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0040] The existing distributed system upgrade adopts a sequential execution method, which has defects such as low efficiency, bandwidth bottleneck in distributing upgrade packages, and uncontrollable upgrade progress. In this application, the upgrade package is sequentially distributed in the structure of the master node, download source, and slave nodes. The upgrade efficiency is significantly improved, and the network bandwidth pressure is relieved, avoiding the generation of a single-node network bottleneck. Moreover, the process of the slave node downloading the upgrade package is controllable, which can effectively control the software upgrade progress of the overall distributed system and adjust it at any time according to the cluster situation.
[0041] An embodiment of the present invention discloses a method for software upgrade of a distributed system. Refer to Figure 1 as shown, including:
[0042] S1: Obtain the uploaded upgrade package through the master node;
[0043] S2: Determine multiple download sources among the master node and multiple slave nodes according to the current network topology, and distribute the upgrade package to the multiple download sources;
[0044] S3: Push the download repository information to all slave nodes through the master node. The download repository information includes the address information of the download source and the upgrade package;
[0045] S4: Use the download repository information to control each slave node to select the corresponding download source according to its own status to download the upgrade package, and use the upgrade package for upgrade.
[0046] It can be understood that the network topology of a distributed system includes multiple nodes interconnected according to specific requirements. These nodes can be divided into master nodes and slave nodes. Users usually upload software upgrade packages to the master node, and the master node controls each slave node to download and upgrade the upgrade package in sequence. In this embodiment, the master node does not directly send the upgrade package from the master node to the slave node. Instead, it first distributes the upgrade package to multiple download sources and only pushes the download repository information to the slave nodes. The master node selects nodes with more common connections and better network status as download sources from all nodes according to the current network topology. Then, it controls the slave nodes to actively select download sources to download the upgrade package according to their own status and the download repository information. The own status includes the distance from each download source and the network environment with each download source, etc. The slave nodes select download sources with a more friendly download environment. The download sources of these slave nodes are inconsistent, and there is no single-point bandwidth bottleneck. The download efficiency is much higher than that of the prior art.
[0047] It can be seen that the autonomy of the slave nodes is relatively high. After the slave nodes execute relevant actions, they can return information to the master node. If an upgrade failure occurs in the slave nodes, they can send failure information to the master node and try to upgrade again.
[0048] Further, before controlling each slave node to select a corresponding download source according to its own status to download the upgrade package and perform the upgrade using the upgrade package, it further includes:
[0049] Sending an upgrade instruction to the slave nodes to be upgraded through the master node;
[0050] Correspondingly, the process of controlling each slave node to select a corresponding download source according to its own status to download the upgrade package and perform the upgrade using the upgrade package includes:
[0051] Controlling each slave node that receives the upgrade instruction to select a corresponding download source according to its own status to download the upgrade package and perform the upgrade using the upgrade package.
[0052] It can be understood that the upgrade instruction here can be the designation of the object node to be upgraded of the upgrade package, which is specifically determined by the master node according to the upgrade package. The upgrade instruction can also include the designation of the upgrade time, and can also include the determination rule of the download source for each slave node. In short, the upgrade instruction is a more specific description of the action of controlling the slave nodes to select download sources to download the upgrade package, and can be set according to needs.
[0053] The present application discloses a method for software upgrade of a distributed system, including: obtaining an uploaded upgrade package through a master node; determining a plurality of download sources among the master node and a plurality of slave nodes according to the current network topology, and distributing the upgrade package to the plurality of download sources; pushing download repository information to all the slave nodes through the master node, where the download repository information includes the addresses of the download sources and the upgrade package; and controlling each slave node to select a corresponding download source according to its own status to download the upgrade package, and performing an upgrade using the upgrade package. In the present application, the upgrade package is sequentially distributed in the structure of the master node, the download sources, and the slave nodes, the upgrade efficiency is significantly increased, the network bandwidth pressure is relieved, the single-node network bottleneck is avoided, and the process of the slave nodes downloading the upgrade package is controllable, so that the software upgrade progress of the overall distributed system can be effectively controlled and adjusted at any time according to the cluster situation.
[0054] An embodiment of the present invention discloses a specific method for software upgrade of a distributed system. Compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
[0055] Specifically, the process of controlling each slave node to select a corresponding download source according to its own status to download the upgrade package includes:
[0056] Controlling each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package.
[0057] It can be understood that the node position here mainly refers to the topological relationship between a certain slave node and other download sources. The shorter the topological relationship between the download source and the slave node, the easier it is to be selected as the download source corresponding to the node; the network congestion situation is mainly judged from the network bandwidth occupancy. The higher the available bandwidth between the download source and the node, the easier it is to be selected as the download source corresponding to the node. The upgrade packages downloaded by each slave node can be downloaded at different times or from different download sources, that is, downloaded in a time-sharing / block-by-block manner. Therefore, when selecting a download source, in addition to the download source with better node position and network congestion situation among all the download sources at the current moment, a corresponding download source selection criterion can also be set, for example, the topological relationship must be within 2-layer topological relationships and the network bandwidth occupancy must be within a certain set range, and then one or more download sources are determined among all the download sources that meet the download source selection criterion.
[0058] According to the above idea, the process of controlling each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package can include:
[0059] Controlling each slave node to select a download source according to the node position and network congestion situation in the current network topology to download the upgrade package within a preset time period.
[0060] Specifically, if the download process of a certain download source is interrupted, the subsequent download can continue from the same download source or another download source can be selected instead.
[0061] Similarly, the process of controlling each slave node to select a corresponding download source to download the upgrade package according to the node position and network congestion situation in the current network topology may also include:
[0062] Controlling each slave node to select multiple download sources according to the node position and network congestion situation in the current network topology to download the upgrade package in chunks.
[0063] Specifically, a slave node can simultaneously download different data blocks of the same upgrade package from multiple download sources and use the upgrade package for upgrading after the download is complete.
[0064] Similarly, the process of controlling each slave node to select a corresponding download source to download the upgrade package according to the node position and network congestion situation in the current network topology includes:
[0065] Controlling each slave node to select multiple preset time periods according to the node position and network congestion situation in the current network topology, and selecting a corresponding download source in each preset time period to download the upgrade package in time-division chunks.
[0066] Correspondingly, the embodiment of the present application also discloses a distributed system software upgrade system. Refer to Figure 2 as shown, including:
[0067] An upgrade package upload module 1, configured to obtain the uploaded upgrade package through the master node;
[0068] A download source determination module 2, configured to determine multiple download sources among the master node and multiple slave nodes according to the current network topology, and distribute the upgrade package to the multiple download sources;
[0069] A download source push module 3, configured to push download repository information to all slave nodes through the master node, where the download repository information includes the address information of the download source and the upgrade package;
[0070] An upgrade package download module 4, configured to use the download repository information to control each slave node to select a corresponding download source to download the upgrade package according to its own status, and use the upgrade package for upgrading.
[0071] In the embodiment of the present application, the upgrade package is distributed in sequence in the structure of the master node, download source, and slave node, the upgrade efficiency is significantly improved, the network bandwidth pressure is relieved, the single-node network bottleneck is avoided, and the process of the slave node downloading the upgrade package is controllable, which can effectively control the software upgrade progress of the overall distributed system and adjust it at any time according to the cluster situation.
[0072] Correspondingly, an embodiment of the present application also discloses a distributed system software upgrade device, including:
[0073] A memory for storing a computer program;
[0074] A processor for implementing the steps of the distributed system software upgrade method as described in any one of the above when executing the computer program.
[0075] Correspondingly, an embodiment of the present application also discloses a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the distributed system software upgrade method as described in any one of the above are implemented.
[0076] Among them, the specific details of the distributed system software upgrade method in this embodiment can be referred to the relevant descriptions in the above embodiments, and will not be elaborated here.
[0077] Among them, the distributed system software upgrade device and the readable storage medium in this embodiment have the same beneficial effects as the distributed system software upgrade method in the above embodiments, and will not be elaborated here.
[0078] Finally, it should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0079] The above has introduced in detail a distributed system software upgrade method, system and related components provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for software upgrade of a distributed system, characterized in that Including: Obtaining the uploaded upgrade package through the master node; Determining multiple download sources among the master node and multiple slave nodes according to the current network topology, and distributing the upgrade package to the multiple download sources; Pushing download repository information including the address information of the download source and the upgrade package to all the slave nodes through the master node; Using the download repository information to control each slave node to select a corresponding download source according to its own status to download the upgrade package, and using the upgrade package for upgrading; The process of controlling each slave node to select a corresponding download source according to its own status to download the upgrade package specifically includes: controlling each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package.
2. The distributed system software upgrade method according to claim 1, wherein The process of controlling each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package includes: Controlling each slave node to select a download source according to the node position and network congestion situation in the current network topology to download the upgrade package within a preset time period.
3. The distributed system software upgrade method according to claim 1, wherein The process of controlling each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package includes: Controlling each slave node to select multiple download sources according to the node position and network congestion situation in the current network topology to download the upgrade package in chunks.
4. The distributed system software upgrade method according to claim 1, wherein The process of controlling each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package includes: Controlling each slave node to select multiple preset time periods according to the node position and network congestion situation in the current network topology, and selecting a corresponding download source in each preset time period to download the upgrade package in a time-sharing and chunking manner.
5. The distributed system software upgrade method according to any one of claims 1 to 4, characterized in that Before controlling each slave node to select a corresponding download source according to its own status to download the upgrade package and using the upgrade package for upgrading, it further includes: Sending an upgrade instruction to the slave node to be upgraded through the master node; Correspondingly, the process of controlling each slave node to select a corresponding download source according to its own status to download the upgrade package and using the upgrade package for upgrading includes: Controlling each slave node that receives the upgrade instruction to select a corresponding download source according to its own status to download the upgrade package and using the upgrade package for upgrading.
6. The distributed system software upgrade method according to claim 5, wherein, The upgrade instruction is specifically determined by the master node according to the upgrade package.
7. A distributed system software upgrade system, characterized in that, Including: An upgrade package upload module for obtaining the uploaded upgrade package through the master node; A download source determination module for determining multiple download sources among the master node and multiple slave nodes according to the current network topology, and distributing the upgrade package to the multiple download sources; A download source push module, configured to push download repository information to all the slave nodes through the master node, where the download repository information includes the download source and the address information of the upgrade package; An upgrade package download module, configured to use the download repository information to control each slave node to select a corresponding download source according to its own status to download the upgrade package, and use the upgrade package for upgrading; Specifically, the upgrade package download module is configured to control each slave node to select a corresponding download source according to the node position and network congestion situation in the current network topology to download the upgrade package.
8. A distributed system software upgrade device, characterized in that Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the distributed system software upgrade method according to any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, characterized in that, A computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the distributed system software upgrade method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Equipment firmware upgrading method in Mesh network
CN111541564A
Distributed system upgrading method and system based on zookeeper and computer equipment
CN111884834A