CN111459521B - Cluster upgrading method and device - Google Patents

Cluster upgrading method and device Download PDF

Info

Publication number
CN111459521B
CN111459521B CN202010240987.XA CN202010240987A CN111459521B CN 111459521 B CN111459521 B CN 111459521B CN 202010240987 A CN202010240987 A CN 202010240987A CN 111459521 B CN111459521 B CN 111459521B
Authority
CN
China
Prior art keywords
node
upgrade
cluster
upgrading
child
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010240987.XA
Other languages
Chinese (zh)
Other versions
CN111459521A (en
Inventor
黄程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Yitu Technology Co ltd
Original Assignee
Shanghai Yitu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Yitu Technology Co ltd filed Critical Shanghai Yitu Technology Co ltd
Priority to CN202010240987.XA priority Critical patent/CN111459521B/en
Publication of CN111459521A publication Critical patent/CN111459521A/en
Application granted granted Critical
Publication of CN111459521B publication Critical patent/CN111459521B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention provides a cluster upgrading method and device, wherein the cluster upgrading method comprises the following steps: step S1, forming a tree structure according to the subordinate relation of each device in a cluster, wherein the tree structure is a multi-layer hierarchical structure subordinate layer by layer from a root node, corresponding upper-layer devices in each two layers are father nodes, and corresponding lower-layer devices of each father node are child nodes; step S2, starting from the root node of the tree structure, sequentially upgrading the plurality of devices step by step, wherein each node is upgraded by using the same upgrading code and upgrading script, and the upgrading code is correspondingly set according to the position of each node. According to the cluster upgrading method, the cluster can be rapidly upgraded, and the normal use of the whole cluster is not affected in the upgrading process.

Description

Cluster upgrading method and device
Technical Field
The invention relates to the field of computers, in particular to a cluster upgrading method and device.
Background
Clusters refer to groups of machines connected by multiple machines that together perform a task or tasks, most of the clusters currently in use are partitioned into regions where multiple regions perform the task in combination.
In a common upgrading mode, the machines in the cluster are sequentially upgraded according to the numbers of the machines, and each machine is upgraded and then operates the next machine until all machines in the list are upgraded.
The upgrade preparation work for each machine is a linear process, and the upgrade would affect the normal use of the cluster.
The method of sequential upgrade is used, and the authority of all nodes in the cluster is the same, so that when a certain node is upgraded (the node is closed when a larger upgrade is performed), all the nodes connected with the node are affected.
Disclosure of Invention
In view of this, the present invention provides a method and apparatus for upgrading a cluster, which can upgrade quickly and the upgrade process does not affect the normal use of the whole cluster.
In order to solve the above technical problems, in one aspect, the present invention provides a cluster upgrade method, including the following steps:
step S1, forming a tree structure according to the subordinate relation of each device in a cluster, wherein the tree structure is a multi-layer hierarchical structure subordinate layer by layer from a root node, corresponding upper-layer devices in each two layers are father nodes, and corresponding lower-layer devices of each father node are child nodes;
step S2, starting from the root node of the tree structure, sequentially upgrading the plurality of devices step by step, wherein each node is upgraded by using the same upgrading code and upgrading script, and the upgrading code is correspondingly set according to the position of each node.
Further, the relationships of the parent node and child node are backed up or otherwise processed prior to the upgrade to avoid erasing the relationships.
Further, upgrades to its child nodes managed by the parent node are determined by the upgrade module.
Further, when the child node is updated, the corresponding parent node replaces the child node to perform corresponding task processing.
Further, the upgrade code and upgrade script are sent by the parent node to its child nodes.
Further, after the father node sends the upgrade code and the upgrade script to the child node, the father node starts the upgrade script according to the content required by upgrade and the relevant parameters of the child node, so that the child node can upgrade.
Further, after the child node finishes upgrading, the upgrade code is replaced by the new version upgrade code, and an upgrade success signal is sent to the parent node.
In a second aspect, the present invention provides a cluster upgrade apparatus for upgrading a cluster apparatus, the cluster apparatus comprising a plurality of devices,
the cluster upgrading device comprises:
the tree structure building module is used for forming a tree structure of a plurality of devices according to the affiliation, wherein the tree structure is a multi-layer hierarchy structure which is subordinate layer by layer from a root node, corresponding upper-layer devices in each two layers are father nodes, and corresponding lower-layer devices of each father node are child nodes;
an upgrade module for starting from the root node of the tree structure, sequentially upgrading the plurality of devices step by step,
and each node is upgraded by using the same upgrade code and upgrade script, and the upgrade code is correspondingly set according to the position of each node.
Further, the cluster upgrading device further includes:
and the relationship processing module is used for backing up or processing the relationship between the father node and the child node before upgrading so as to avoid erasing the relationship.
Further, the upgrade module includes:
and the management module is used for determining that the father node manages the upgrade of the child node.
Further, the management module includes:
and the substitute task processing module is used for monitoring the upgrading of the child node, and distributing the task to a father node of the child node for processing when the task needs to be processed by the child node in the upgrading process.
Further, the management module also comprises a transfer module for sending the upgrade code and upgrade script of the parent node to its child node.
Further, the management module further comprises a starting module, which is used for starting the upgrade script of the child node according to the requirement of the parent node so that the child node can upgrade.
Further, the management module further comprises a feedback module, which is used for sending the upgrade success signal of the child node to the parent node.
The technical scheme of the invention has at least one of the following beneficial effects:
according to the cluster upgrading method, a tree structure upgrading mode is adopted, so that the cluster can be upgraded rapidly;
the software can ensure survival by using full-scale upgrade (namely, the upgrade code and the upgrade script of each node are the same), so that the smooth progress of the upgrade is ensured;
further, when the child node is upgraded, the corresponding parent node replaces the child node to perform corresponding task processing, so that normal use of the cluster can be maintained in the upgrading process;
furthermore, the upgrade of the child node is managed by the parent node through the upgrade module, so that the upgrade process of the child node can be ensured to meet the expectations of the parent node, and the smooth progress of the upgrade is ensured.
Drawings
FIG. 1 is a flow chart of a cluster upgrade method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a tree structure according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a cluster lift device according to an embodiment of the invention.
Detailed Description
The following describes in further detail the embodiments of the present invention with reference to the drawings and examples. The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
The upgrade effect can be improved by linking the tree structure with the upgrade. The network with the tree structure is not used in the industry originally, because the network structure with short upgrading time and less upgrading content does not need the tree structure and can be directly upgraded next to each other. But for each node it is upgraded for a long time and for upgrades where retention of the node during the upgrade is important, it is not possible to upgrade next to each other.
In actual use, there are dependencies between the nodes within the cluster. Each node is either the highest-authority node or a node governed by some fixed node. This property allows dependencies between clusters and changes are less frequent. When upgrading, the subordinate relationship can ensure that the upper node keeps the jurisdiction of the lower node, and the subordinate relationship between the upper node and the lower node can ensure that the upgrading is performed simultaneously without affecting the normal use of the whole cluster because of the connection between the nodes.
Next, first, a cluster upgrade method according to an embodiment of the present invention is described with reference to fig. 1.
As shown in fig. 1, the cluster upgrading method in the embodiment of the invention includes:
step S1, forming a tree structure according to the subordinate relation of each device in the cluster, wherein the tree structure is a multi-layer hierarchical structure subordinate layer by layer from a root node, corresponding upper-layer devices in every two layers are father nodes, and corresponding lower-layer devices of every father node are child nodes.
For example, as shown in fig. 1, the tree structure is divided into 3 layers in total,
the top layer is the root node (representing a national node);
the second layer is a layer which is a east China area node, a middle China area node and a south China area node;
the third layer is Jiangsu node (subnode in eastern China), zhejiang node (subnode in eastern China), henan node (subnode in China), hunan node (subnode in China), guangdong node (subnode in southern China) and Fujian node (subnode in southern China).
Step S2, starting from the root node of the tree structure, sequentially upgrading the plurality of devices step by step, wherein each node is upgraded by using the same upgrading code and upgrading script, and the upgrading code is correspondingly set according to the position of each node.
For example, as shown in the tree structure of fig. 1, the upgrade process is:
1) Upgrading the nodes nationally;
2) After the national node is upgraded, the nodes in the east China, the middle China and the south China are upgraded;
3) After the nodes in the eastern China are upgraded, jiangsu and Guangdong nodes are upgraded; after the nodes in the China are upgraded, the nodes in Henan and Hunan are upgraded; and after the nodes in the south China are upgraded, the Fujian and Guangdong nodes are upgraded.
Thus, the tree structure can be upgraded at a faster rate than one-by-one.
According to the cluster upgrading method, the tree structure is used for upgrading management, and the same upgrading codes and upgrading scripts are used for each node for upgrading, namely, the whole quantity of upgrading is adopted, so that the survival of a software upgrading process can be ensured, and the smooth progress of upgrading is ensured.
The above relationships of the parent node and the child node are manually set, and preferably, the relationships of the parent node and the child node are backed up or processed before upgrading to avoid erasing the relationships. Therefore, the relationship between the father node and the child node can be ensured to be stable, and the upgrading is convenient.
According to some embodiments of the invention, during an upgrade, the parent node manages upgrades of its child nodes.
Further, when the child node is updated, the corresponding parent node replaces the child node to perform corresponding task processing.
The father node has higher authority than the child node, and the corresponding father node can replace the child node to process the corresponding task when the child node is upgraded.
For example, when the Jiangsu node is upgraded, the communication tasks of the Zhejiang node and the Jiangsu node can be temporarily replaced by the communication between the Jiangsu node and the Zhejiang node in the east China, so that the communication interruption between the Jiangsu node and the Zhejiang node is avoided when the Jiangsu node is upgraded.
For example, some important information is transmitted by the Zhejiang node and Jiangsu node, and when the east China node is upgraded, the national node can replace the east China node to transmit the information, so that the communication between the Zhejiang node and Jiangsu node can be maintained to be normal.
Therefore, the situation that the clusters are normally used in the upgrading process can be avoided, and the normal use of the clusters can still be ensured to the greatest extent in the upgrading process.
The following describes the process of parent node specific management child node upgrades:
firstly, a father node sends an upgrade code and an upgrade script to child nodes thereof;
for example, the parent node transmits a complete upgrade code and upgrade script to each child node.
And then, after the father node transmits the upgrade code and the upgrade script to the child node, the father node starts the upgrade script according to the content required by upgrade and the related parameters of the child node so that the child node can upgrade.
And finally, after the child node is upgraded, replacing the upgrade code with the new version of upgrade code, and sending an upgrade success signal to the parent node. For example, the upgrade script of the child node cleans up the old version on the child node and ensures the integrity of the environment, after which the replacement and upgrade code is started, and a new version is obtained by replacing the upgrade code.
After confirming that the version upgrade is successful, the script will also send the complete upgrade code and upgrade script to its own child node, starting the propagated operation. After the script confirms that all the child nodes are successfully upgraded, a message of successful upgrading is sent to the parent node of the script, and the upgrading is finished.
When the root node receives the upgrade success message, we can consider that the entire cluster has been upgraded successfully.
That is, the present invention enables a parent node to manage the upgrade of a child node through an upgrade module, according to which the parent node transmits an upgrade code and an upgrade script to its child node, and according to which the parent node starts the upgrade script according to the content required for the upgrade and the relevant parameters of the child node after having transmitted the upgrade code and the upgrade script to its child node, and according to which the child node replaces its upgrade code with a new version of upgrade code and transmits an upgrade success signal to its parent node. Therefore, the upgrading process of the child node can be ensured to meet the expectations of the father node, and the stability of upgrading is facilitated.
It should be noted that the above is only an alternative example, and that the subtrees may be upgraded, for example, only the subtrees in the eastern China are upgraded, and the starting node is the root node of the subtrees, i.e. the nodes in the eastern China, and is upgraded step by step down to the leaf node (the bottommost node), which is understood to be within the scope of the present invention.
Alternatively, it is also possible to upgrade from the lowest level node upwards. Therefore, local upgrading can be realized, disturbance to the whole tree structure is avoided, and upgrading can be customized or targeted.
Next, a cluster upgrade apparatus according to an embodiment of the present invention is described with reference to fig. 2.
As shown in fig. 2, the cluster upgrade apparatus 1000 includes: a plurality of devices 1001 and an upgrade module 1002, in a second aspect, the present invention provides a cluster upgrade apparatus 1000 for upgrading a cluster apparatus, the cluster apparatus comprising a plurality of devices,
the cluster upgrade apparatus 1000 includes:
the tree structure building module 1001 is configured to form a tree structure from a plurality of devices according to the affiliation, where the tree structure is a multi-layer hierarchical structure subordinate from a root node layer by layer, corresponding upper-layer devices in each two layers are parent nodes, and corresponding lower-layer devices of each parent node are child nodes;
an upgrade module 1002, configured to start from a root node of the tree structure, perform progressive upgrade on a plurality of devices in sequence,
and each node is upgraded by using the same upgrade code and upgrade script, and the upgrade code is correspondingly set according to the position of each node.
Further, the cluster upgrade apparatus 1000 further includes:
the relationship processing module 1003 is configured to backup or process the relationship between the parent node and the child node before upgrading, so as to avoid erasing the relationship.
Further, the upgrade module 1002 includes:
management module 10021 is configured to determine that the parent node manages upgrades to its child nodes.
Further, the management module 10021 includes:
and the substitute task processing module is used for monitoring the upgrading of the child node, and distributing the task to a father node of the child node for processing when the task needs to be processed by the child node in the upgrading process.
Further, the management module 10021 further includes a delivery module for sending the upgrade code and upgrade script of the parent node to its child node.
Further, the management module 10021 further includes a starting module, configured to start the upgrade script of the child node according to the requirement of the parent node, so that the child node performs the upgrade.
Further, the management module 10021 further includes a feedback module for sending an upgrade success signal of the child node to its parent node.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (12)

1. The cluster upgrading method is characterized by comprising the following steps:
step S1, forming a tree structure according to the subordinate relation of each device in a cluster, wherein the tree structure is a multi-layer hierarchical structure subordinate layer by layer from a root node, corresponding upper-layer devices in each two layers are father nodes, and corresponding lower-layer devices of each father node are child nodes; the parent node and the child node are divided by region;
step S2, starting from the root node of the tree structure, sequentially upgrading a plurality of devices step by step,
each node is upgraded by using the same upgrade code and upgrade script, and the upgrade code is correspondingly set according to the position of each node;
when the child node is updated, the corresponding parent node replaces the child node to perform corresponding task processing.
2. The cluster upgrade method according to claim 1, wherein the relationships of parent and child nodes are backed up or processed prior to upgrade to avoid erasing the relationships.
3. The cluster upgrade method according to claim 2, wherein the upgrade of its child nodes managed by the parent node is determined by an upgrade module.
4. A cluster upgrade method according to claim 3, wherein the upgrade code and upgrade script are sent by the parent node to its child nodes.
5. The method for upgrading a cluster according to claim 4, wherein after the parent node transmits the upgrade code and the upgrade script to its child nodes, the parent node starts the upgrade script according to the content required for the upgrade and relevant parameters of the child nodes, so that the child nodes perform the upgrade.
6. The method of claim 5, wherein after the child node upgrades, the child node upgrade code is replaced with a new version upgrade code, and sends an upgrade success signal to its parent node.
7. A cluster upgrading device is used for upgrading a cluster device, and is characterized in that the cluster device comprises a plurality of devices,
the cluster upgrading device comprises:
the tree structure building module is used for forming a tree structure of a plurality of devices according to the affiliation, wherein the tree structure is a multi-layer hierarchy structure which is subordinate layer by layer from a root node, corresponding upper-layer devices in each two layers are father nodes, and corresponding lower-layer devices of each father node are child nodes; the parent node and the child node are divided by region;
an upgrade module for starting from the root node of the tree structure, sequentially upgrading the plurality of devices step by step,
each node is upgraded by using the same upgrade code and upgrade script, and the upgrade code is correspondingly set according to the position of each node;
the management module comprises:
and the substitute task processing module is used for monitoring the upgrading of the child node, and distributing the task to a father node of the child node for processing when the task needs to be processed by the child node in the upgrading process.
8. The cluster upgrade apparatus of claim 7, further comprising:
and the relationship processing module is used for backing up or processing the relationship between the father node and the child node before upgrading so as to avoid erasing the relationship.
9. The cluster upgrade apparatus of claim 8, wherein the upgrade module comprises:
and the management module is used for determining that the father node manages the upgrade of the child node.
10. The cluster upgrade apparatus of claim 9, wherein the management module further comprises a delivery module for transmitting the upgrade code and upgrade script of the parent node to its child nodes.
11. The cluster upgrade apparatus according to claim 10, wherein the management module further comprises a start module for starting the upgrade script of its child node according to the requirement of the parent node, so that the child node performs the upgrade.
12. The cluster upgrade apparatus of claim 11, wherein the management module further comprises a feedback module for sending an upgrade success signal of a child node to its parent node.
CN202010240987.XA 2020-03-31 2020-03-31 Cluster upgrading method and device Active CN111459521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010240987.XA CN111459521B (en) 2020-03-31 2020-03-31 Cluster upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010240987.XA CN111459521B (en) 2020-03-31 2020-03-31 Cluster upgrading method and device

Publications (2)

Publication Number Publication Date
CN111459521A CN111459521A (en) 2020-07-28
CN111459521B true CN111459521B (en) 2024-03-22

Family

ID=71683358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010240987.XA Active CN111459521B (en) 2020-03-31 2020-03-31 Cluster upgrading method and device

Country Status (1)

Country Link
CN (1) CN111459521B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461240B (en) * 2021-06-30 2023-04-14 荣耀终端有限公司 Software upgrading method, software upgrading system and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069019A (en) * 2015-07-14 2015-11-18 惠龙易通国际物流股份有限公司 Data base uninterruptible update method and system
CN105337904A (en) * 2014-08-05 2016-02-17 杭州华三通信技术有限公司 Controller cluster upgrading method and device
CN106803790A (en) * 2016-12-06 2017-06-06 浙江大华技术股份有限公司 The upgrade control method and device of a kind of group system
US9747291B1 (en) * 2015-12-29 2017-08-29 EMC IP Holding Company LLC Non-disruptive upgrade configuration translator
CN108829420A (en) * 2018-06-12 2018-11-16 郑州云海信息技术有限公司 A kind of distributed memory system method for upgrading software based on RPM packet
CN109445825A (en) * 2018-11-09 2019-03-08 郑州云海信息技术有限公司 The method and apparatus that a kind of server cluster system updates upgrading
CN110688377A (en) * 2019-08-30 2020-01-14 阿里巴巴集团控股有限公司 Method and device for updating state Merck tree

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105337904A (en) * 2014-08-05 2016-02-17 杭州华三通信技术有限公司 Controller cluster upgrading method and device
CN105069019A (en) * 2015-07-14 2015-11-18 惠龙易通国际物流股份有限公司 Data base uninterruptible update method and system
US9747291B1 (en) * 2015-12-29 2017-08-29 EMC IP Holding Company LLC Non-disruptive upgrade configuration translator
CN106803790A (en) * 2016-12-06 2017-06-06 浙江大华技术股份有限公司 The upgrade control method and device of a kind of group system
CN108829420A (en) * 2018-06-12 2018-11-16 郑州云海信息技术有限公司 A kind of distributed memory system method for upgrading software based on RPM packet
CN109445825A (en) * 2018-11-09 2019-03-08 郑州云海信息技术有限公司 The method and apparatus that a kind of server cluster system updates upgrading
CN110688377A (en) * 2019-08-30 2020-01-14 阿里巴巴集团控股有限公司 Method and device for updating state Merck tree

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Configuring A MapReduce Framework For Performance-Heterogeneous Clusters;Hartog, Jessica等;《2014 IEEE INTERNATIONAL CONGRESS ON BIG DATA (BIGDATA CONGRESS)》;20150325;全文 *
云环境中集群监控数据采集与分析系统的研究与实现;支连意;《中国优秀硕士学位论文全文数据库(信息科技辑)》;20170315;全文 *
大规模集群一致性维护的网络传输控制方案;郭刚;卢宇彤;;科学技术与工程;20060330(06);全文 *

Also Published As

Publication number Publication date
CN111459521A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN101635640B (en) Method for automatically releasing terminal program version of WEB network station system server
CN105763369B (en) A kind of terminal unit remote software version distribution method and system
US8578371B2 (en) Software distribution method and system with automatic prerequisite installation
CN105808274A (en) Software upgrading method and system as well as corresponding clients and servers
US6854112B2 (en) System and method for the automatic installation and configuration of an operating system
CN101136770B (en) Automatically upgrading method and apparatus for telecom multi-branch network management system
CN101699399B (en) Software update system and method
US7698391B2 (en) Performing a provisioning operation associated with a software application on a subset of the nodes on which the software application is to operate
CN110413295B (en) Remote firmware updating method for embedded equipment
US8301935B2 (en) Distributed batch runner
CN106790432A (en) A kind of Oftware updating method and device
CN109189680B (en) A kind of system and method for application publication and configuration
CN102640108A (en) Monitoring of replicated data instances
CN102656565A (en) Failover and recovery for replicated data instances
CN1668010A (en) Tag-based schema for distributing update metadata in an update distribution system
CN103873534B (en) A kind of application cluster moving method and device
CN103516529A (en) Management method, device and system of configuration files
CN101365642A (en) Remote updating system for elevator control program
CN105808273B (en) Method for upgrading software and software updating apparatus
CN104133715A (en) Ethernet power supply equipment firmware upgrade method and device
CN111459521B (en) Cluster upgrading method and device
CN106936633A (en) Method and server that a kind of application installation package makes
CN109189431A (en) A kind of client side upgrading method, device, equipment and readable storage medium storing program for executing
CN113127023B (en) Service upgrading method, device and system
CN115809096B (en) Batch self-adaptive upgrading method for operating system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant