CN110377298B - Distributed cluster upgrading method and distributed cluster - Google Patents

Distributed cluster upgrading method and distributed cluster Download PDF

Info

Publication number
CN110377298B
CN110377298B CN201810332728.2A CN201810332728A CN110377298B CN 110377298 B CN110377298 B CN 110377298B CN 201810332728 A CN201810332728 A CN 201810332728A CN 110377298 B CN110377298 B CN 110377298B
Authority
CN
China
Prior art keywords
upgrading
current
upgrade
node equipment
node
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
CN201810332728.2A
Other languages
Chinese (zh)
Other versions
CN110377298A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201810332728.2A priority Critical patent/CN110377298B/en
Publication of CN110377298A publication Critical patent/CN110377298A/en
Application granted granted Critical
Publication of CN110377298B publication Critical patent/CN110377298B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality

Abstract

The embodiment of the invention provides a distributed cluster upgrading method and a distributed cluster, wherein the method comprises the following steps: the upgrade management equipment determines the current upgrade node equipment in the distributed cluster; switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment; upgrading a first type software layer in the current upgrading node equipment; upgrading a second type software layer in the current upgrading node equipment; therefore, in the first aspect, even if the node device receives the read-write operation instruction in the upgrading process, the read-write operation instruction is also switched to other non-current upgrading node devices, and the other non-current upgrading node devices continue to provide services, so that the scheme can continue to provide services while upgrading; in a second aspect, the present solution provides a new upgrade method for the node device by performing a hierarchical upgrade.

Description

Distributed cluster upgrading method and distributed cluster
Technical Field
The present invention relates to the field of distributed cluster technologies, and in particular, to a distributed cluster upgrading method and a distributed cluster.
Background
A distributed cluster typically includes a plurality of communicatively coupled node devices, and each node device in the system typically needs to be upgraded in turn when upgrading the distributed cluster. At present, more and more node devices in the distributed cluster have more and more complex functions, so that the upgrading operation of the distributed cluster consumes longer and longer time.
In general, a distributed cluster cannot provide service during an upgrade, that is, an upgrade operation of the distributed cluster is too long to affect normal use of the system.
Disclosure of Invention
The embodiment of the invention aims to provide a distributed cluster upgrading method and a distributed cluster, which can continuously provide services while upgrading.
The embodiment of the invention provides a distributed cluster upgrading method which is applied to upgrading management equipment, wherein the distributed cluster comprises a plurality of node equipment; the method comprises the following steps:
determining current upgrade node equipment in the plurality of node equipment;
switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment in the distributed cluster;
upgrading a first type software layer in the current upgrading node equipment; wherein, the first type software layer is: a software layer associated with internal communication of the distributed cluster;
upgrading a second type software layer in the current upgrading node equipment; wherein, the second type software layer is: a software layer associated with internal and external communications of the distributed cluster.
As one embodiment, the distributed cluster comprises a plurality of data centers, and each data center comprises at least one node device;
The determining, among the plurality of node devices, a current upgrade node device may include:
determining a current upgrade data center among the plurality of data centers;
taking each node device in the current upgrading data center as current upgrading node device;
the switching the read-write operation of the current upgrade node device to the non-current upgrade node device in the distributed cluster may include:
and switching the read-write operation of each node device in the current upgrading data center to the node device of the non-current upgrading data center.
As an embodiment, before the upgrading of the first type software layer in the current upgrading node device, the method may further include:
upgrading the operation system in the current upgrading node equipment;
and upgrading the software which is installed in the current upgrading node equipment and is irrelevant to the communication of the distributed cluster.
As an implementation manner, after the switching the read-write operation of the current upgrade node device to the non-current upgrade node device in the distributed cluster, the method may further include:
starting an upgrade service program, and generating an upgrade plan for current upgrade node equipment through the upgrade service program;
The upgrading of the first type software layer in the current rising stage number node equipment comprises the following steps:
upgrading the first type software layer in the current upgrading node equipment according to the upgrading plan;
the upgrading of the second type software layer in the current node device may include:
and upgrading the second type of software layer in the current upgrading node equipment according to the upgrading plan.
As an embodiment, the method may further include:
and deleting the version before upgrading in the current upgrading node equipment after the preset time period after the current upgrading node equipment is upgraded.
The embodiment of the invention also provides a distributed cluster upgrading method which is applied to the current upgrading node equipment in the distributed cluster, wherein the current upgrading node equipment comprises a first type software layer and a second type software layer, and the first type software layer is as follows: a software layer related to internal communication of the distributed cluster, wherein the second type of software layer is: a software layer associated with internal and external communications of the distributed cluster;
the method comprises the following steps:
switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment in the distributed cluster, wherein the non-current upgrading node equipment is as follows: node equipment which is not updated at the current moment;
Upgrading the first type software layer;
and upgrading the second type software layer.
As one embodiment, the distributed cluster includes at least one data center, and each data center includes at least one node device; the current upgrade node equipment belongs to a current upgrade data center;
the switching the read-write operation of the current upgrade node equipment to the non-current upgrade node equipment in the distributed cluster comprises the following steps:
switching the read-write operation of the current upgrading node equipment to the node equipment of a non-current upgrading data center in the distributed cluster, wherein the non-current upgrading data center is as follows: a data center which is not updated at the current moment;
or switching the read-write operation of the current upgrade node equipment to the upgraded node equipment in the current upgrade data center.
As an embodiment, before the switching the read-write operation of the current upgrade node device to the upgraded node device in the current upgrade data center, the method may further include:
judging whether updated node equipment exists in the current updating data center;
if the data does not exist, writing the data corresponding to the read-write operation into a cache file; after the updated node equipment exists in the current updated data center, processing data corresponding to the read-write operation through the updated node equipment;
And if so, executing the step of switching the read-write operation of the current upgrading node equipment to the upgraded node equipment in the current upgrading data center.
As an implementation manner, after the upgrading of the second type software layer, the method further includes:
switching the read-write operation belonging to the current upgrading node equipment back to the current upgrading node equipment, and starting a version calling program;
if the received read-write operation instruction aims at the version before upgrading, calling the version before upgrading to process the read-write operation instruction through the version calling program;
and if the received read-write operation instruction aims at the updated version, calling the updated version to process the read-write operation instruction through the version calling program.
As an embodiment, the upgrading the first type software layer includes:
acquiring a state of a new class corresponding to the first class software layer; wherein, the class is a template of the object, and the new class is an upgraded class;
converting the class state in the first class software layer into the state of the new class;
acquiring a new object corresponding to the first type software layer; wherein the object is an instance of a class, and the new object is an upgraded object;
And replacing the new object with the object in the first type software layer.
The embodiment of the invention also provides a distributed cluster, which comprises upgrade management equipment and a plurality of node equipment,
the upgrade management device is configured to determine a current upgrade node device from the plurality of node devices; sending a first switching instruction, a first software layer upgrading instruction and a second software layer upgrading instruction to the current upgrading node equipment;
the node equipment is used for switching the read-write operation of the node equipment to non-current upgrading node equipment in the distributed cluster after receiving the first switching instruction; after receiving the first software layer upgrading instruction, upgrading the first type of software layer of the user; wherein, the first type software layer is: a software layer associated with internal communication of the distributed cluster; after receiving the second software layer upgrading instruction, upgrading the second type software layer of the second type software layer; wherein, the second type software layer is: a software layer associated with internal and external communications of the distributed cluster.
As one embodiment, the distributed cluster comprises a plurality of data centers, and each data center comprises at least one node device;
The upgrade management apparatus is further configured to determine a current upgrade data center among the plurality of data centers; taking each node device in the current upgrading data center as current upgrading node device;
the node equipment is also used for switching the read-write operation of the node equipment to the node equipment of the non-current upgrading data center after receiving the first switching instruction.
As an implementation manner, the upgrade management device is further configured to send a second switching instruction to the node device after the upgrade is completed;
the node device is further configured to switch the read-write operation belonging to the node device back to the node device after receiving the second switching instruction.
As an implementation manner, the node device is further configured to start a version calling program after switching the read-write operation belonging to itself back to itself; if the received read-write operation instruction aims at the version before upgrading, calling the version before upgrading to process the read-write operation instruction through the version calling program; and if the received read-write operation instruction aims at the updated version, calling the updated version to process the read-write operation instruction through the version calling program.
By applying the embodiment of the invention, the upgrade management equipment determines the current upgrade node equipment in the distributed cluster; switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment; upgrading a first type software layer in the current upgrading node equipment; the first type of software layer is: a software layer associated with internal communication of the distributed cluster; upgrading a second type software layer in the current upgrading node equipment; the second type of software layer is: a software layer associated with internal and external communications of the distributed cluster; therefore, in the first aspect, even if the node device receives the read-write operation instruction in the upgrading process, the read-write operation instruction is also switched to other non-current upgrading node devices, and the other non-current upgrading node devices continue to provide services, so that the scheme can continue to provide services while upgrading; in a second aspect, the present solution provides a new upgrade method for the node device by performing a hierarchical upgrade.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a distributed cluster upgrade method applied to upgrade management equipment according to an embodiment of the present invention;
fig. 1a is a schematic diagram of a node device according to an embodiment of the present invention;
fig. 1b is a schematic hierarchical diagram of a node device according to an embodiment of the present invention;
fig. 1c is a schematic diagram of upgrade of each layer in a node device according to an embodiment of the present invention;
fig. 2 is a flow chart of a distributed cluster upgrade method applied to a node device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a distributed cluster according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to solve the technical problems, the embodiment of the invention provides a distributed cluster upgrading method applied to upgrading management equipment, a distributed cluster upgrading method applied to node equipment and a distributed cluster.
The following describes in detail a distributed cluster upgrade method applied to an upgrade management apparatus. The distributed cluster comprises a plurality of node devices; the upgrade management device may be a device in the distributed cluster, or may be a device outside the distributed cluster.
Fig. 1 is a flow chart of a distributed cluster upgrade method applied to upgrade management equipment according to an embodiment of the present invention, including:
s101: the current upgrade node device is determined among the plurality of node devices of the distributed cluster.
In one embodiment, the upgrade management device may upgrade each node device in turn according to a preset upgrade order, where the node device to be upgraded is the current upgrade node device. The upgrade management apparatus may upgrade one or more node apparatuses simultaneously, that is, may determine one or more currently upgraded node apparatuses.
In another embodiment, the node devices in the distributed cluster may be divided into different data centers in advance, where the different data centers may process different types of data, or the different data centers may process data from different areas, etc., and the division manner of the data centers is not specifically limited.
In such an embodiment, when upgrading the distributed cluster, an upgrade order between the data centers may be determined first, and in this order, a current upgrade data center among the plurality of data centers is determined. One or more data centers can be upgraded currently, or one or more data centers can be upgraded at the same time, and the specific upgrading sequence is not limited. The node devices in the current upgrade data center are all current upgrade node devices.
S102: and switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment in the distributed cluster.
In one embodiment, each node device is sequentially upgraded, and the node device that is not upgraded or the node device that has been upgraded may be referred to as a non-current upgrade node device.
In the other embodiment, the data centers are sequentially upgraded, and node devices which are not upgraded or node devices in the data centers which are already upgraded are all called non-current upgrade data centers, and node devices in the non-current upgrade data centers are all non-current upgrade node devices.
In this embodiment, S102 may be: and switching the read-write operation of each node device in the current upgrading data center to the node device of the non-current upgrading data center.
The upgrade management device may control each node device, for example, after the upgrade management device determines the current upgrade data center, the upgrade management device may send a first switching instruction to each node device in the current upgrade data center, so that each node device switches its own read-write operation to a node device in a non-current upgrade data center.
For example, an upgrade client may be installed in the upgrade management apparatus and the node apparatus, and control of the node apparatus by the upgrade management apparatus may be implemented through the upgrade client. As shown in fig. 1a, a client is installed in the node device, and the upgrade is performed under the control of the client.
S103: upgrading a first type software layer in the current upgrading node equipment; the first type of software layer is as follows: a software layer associated with internal communication of the distributed cluster.
S104: upgrading the second type software layer in each node device in the current upgrading data center; the second type of software layer is: a software layer associated with internal and external communications of the distributed cluster.
In this embodiment, the node device is upgraded in layers, and the first type of software layer is upgraded first, and then the second type of software layer is upgraded; or, the second type software layer may be upgraded first, and then the first type software layer may be upgraded.
The first type of software layer is related to internal communication of the distributed cluster, and specifically may include: single data center layer, cross data center layer, persistence layer. The single data center layer refers to: a software layer on which data interactions in a data center depend; cross data center layer refers to: a software layer on which data interactions between the plurality of data centers depend; the persistence layer refers to: the software layer where the logical structure of the database resides.
For example, there may be two databases in one distributed cluster, one being a single data center database and the other being a cross data center database, some data common among the data centers may be stored in the cross data center database, so that the common data is stored in only one copy, and occupies less storage resources. There is a persistence layer in the node device, the persistence layer comprising a logical structure of the database, through which the node device can invoke the database.
The second type of software layer is related to internal and external communication of the distributed cluster, and specifically may include: a platform services layer and an application layer. The platform service layer refers to: calling a software layer on which remote equipment depends, wherein the remote equipment is equipment outside the distributed cluster, and the remote equipment can be called through RPC (Remote Procedure Call Protocol ) in a platform service layer; the application layer refers to the software layer on which interactions with the user depend.
In one embodiment, the following steps may be performed prior to S103: upgrading the operation system in the current upgrading node equipment; and upgrading the software which is installed in the current upgrading node equipment and is irrelevant to the communication of the distributed cluster.
The software installed in the current upgrade node equipment that is not related to the communication of the distributed cluster may be referred to as a machine node layer, such as a standalone software, such as office software, or the like. For example, the machine node layer may be upgraded by way of a software package manager (Red Hat Package Manager, RPM).
In other embodiments, the operating system and the machine node layer may not be upgraded; alternatively, not every upgrade may require an upgrade to the operating system, as well as the machine node level.
As shown in fig. 1b, a node device may be split into multiple software layers: the operation system layer, the machine node layer, the single data center cluster layer, the cross data center cluster layer, the persistence layer, the platform service layer and the application layer can upgrade all software layers of the node equipment in sequence from bottom to top.
For example, assume that 15 node devices are included in a distributed cluster: node devices 1-15 divide the distributed cluster into three data centers: data center 1, data center 2 and data center 3, wherein, include 5 node device in the data center 1: the node devices 1-5, the data center 2 comprises 5 node devices: the node devices 6-10, the data center 3 comprises 5 node devices: node devices 11-15.
Taking the node device 1 as an example, the node device 1 may perform data interaction with other 4 devices (node devices 2-5) in the data center 1 through its own single data center layer. The node device 1 can perform data interaction with 5 node devices in the data center 2 and 5 node devices in the data center 3 through the data center crossing layer. The node device 1 may invoke the database in the distributed cluster through its own persistence layer. The node device 1 may invoke remote devices outside the distributed cluster through its own platform service layer. The node device 1 may interact with the user through its own application layer.
In fig. 1a, the client control node device performs an upgrade on each software layer, and each software layer in fig. 1b corresponds to being shielded, and each software layer cannot sense the upgrade process.
As an implementation manner, after S102, an upgrade service program may also be started, through which an upgrade plan for the current upgrade node device is generated; thus, S103 is: upgrading a first type software layer in the current upgrading node equipment according to the upgrading plan; s104 is as follows: and upgrading the second type of software layer in the current upgrading node equipment according to the upgrading plan.
As described above, an upgrade client may be installed in the upgrade management apparatus and the node apparatus, and an upgrade service program may be provided in the client, and the upgrade of the node apparatus is guided by the upgrade service program to be completed. The upgrade service program may generate an upgrade plan for each current upgrade node device according to the topology of the distributed cluster.
For example, the topology information of the distributed cluster may include a list of node devices, a list of services provided by the node devices, and the like, which is not limited in particular. The upgrade program can know data interaction between the node devices and the external devices of the distributed cluster according to the topological structure information, so that an upgrade plan for the current upgrade node device is generated.
As an implementation manner, after a preset period of time after the current upgrade node equipment is upgraded, the version before the upgrade in the current upgrade node equipment is deleted.
That is, after the upgrade of the node device is completed, the old version in the node device is not deleted immediately, but is deleted after waiting for a period of time. Thus, if the new version is run with errors, the old version can still be run, and the node device can still provide services. The preset time period may be set according to practical situations, for example, a day, a week, etc., and is not specifically limited.
In this embodiment, the node device is upgraded hierarchically, and each type of software layer may correspond to one version. For example, each software layer in FIG. 1b may correspond to a version. And after each software layer is upgraded, an old version and a new version exist at the same time, the upgrading process can be as shown in fig. 1c, version 1 is the old version, and version 2 is the new version: before upgrading, the three software layers are all version 1; after upgrading the software layer 1, the version 1 and the version 2 exist in the software layer 1 at the same time; upgrade 2 is performed on software layer 2, version 1 and version 2 exist in software layer 2 at the same time, and the like, which are not listed.
After the node equipment is upgraded, the upgrade management equipment switches the read-write operation belonging to the node equipment back to the node equipment. In addition, after the upgrade of each node device in the distributed cluster is completed, the upgrade management device may perform some post-upgrade processing operations on the distributed cluster, for example, delete some garbage data generated in the upgrade process, and the like, which is not specifically limited.
According to the embodiment of the invention shown in fig. 1, in the first aspect, even if the node equipment receives the read-write operation instruction in the upgrading process, the read-write operation instruction is switched to other non-current upgrading node equipment, and the other non-current upgrading node equipment continues to provide service, so that the scheme can continue to provide service while upgrading; in a second aspect, the present solution provides a new upgrade method for the node device by performing a hierarchical upgrade.
The following describes a distributed cluster upgrade method applied to a node device, where, as described above, the node device includes a first type software layer and a second type software layer, and the first type software layer is: a software layer related to internal communication of the distributed cluster, wherein the second type of software layer is: a software layer associated with internal and external communications of the distributed cluster. For the sake of distinguishing descriptions, in the embodiment of fig. 2, the execution body is referred to as a current upgrade node apparatus.
Fig. 2 is a flow chart of a distributed cluster upgrade method applied to a node device according to an embodiment of the present invention, including:
s201: and switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment in the distributed cluster.
Wherein, the non-current upgrade node equipment is: the node device that is not upgraded at the current time, for example, the non-current upgrade node device may be a node device that has already been upgraded, or may be a node device that has not yet been upgraded.
For example, the current upgrade node apparatus may perform S201 after receiving the upgrade instruction of the upgrade management apparatus, in other words, the node apparatus may determine itself as the current upgrade node apparatus after receiving the upgrade instruction of the upgrade management apparatus, and perform the embodiment shown in fig. 2.
The upgrade process of the node device may be controlled by the upgrade management device. For example, an upgrade client may be installed in the upgrade management apparatus and the node apparatus, and control of the node apparatus by the upgrade management apparatus may be implemented through the upgrade client. As shown in fig. 1a, a client is installed in the node device, and the upgrade is performed under the control of the client.
As one embodiment, the distributed cluster comprises a plurality of data centers, each data center comprises at least one node device, and the upgrade management device upgrades one or more data centers simultaneously; in this embodiment, a first switching scheme may be employed: switching the read-write operation of the current upgrading node equipment to the node equipment of a non-current upgrading data center in the distributed cluster, wherein the non-current upgrading data center is as follows: and the data center is not updated at the current moment. Specifically, the non-current upgrade data center may be a data center that has been upgraded, or may be a data center that has not been upgraded.
Alternatively, in this embodiment, a second switching scheme may be used: the current upgrade node equipment can also switch the read-write operation of the current upgrade node equipment to the upgraded node equipment in the current upgrade data center, wherein the current upgrade data center is the data center to which the current upgrade node equipment belongs.
In the case of the second switching scheme: the current upgrade node equipment switches the read-write operation of the current upgrade node equipment to the upgraded node equipment in the current upgrade data center, and can judge whether the upgraded node equipment exists in the current upgrade data center; if not, writing the data corresponding to the read-write operation into a cache file; after the updated node equipment exists in the current updated data center, the data corresponding to the read-write operation is processed through the updated node equipment; and if the updated node equipment exists, switching the read-write operation of the current updated node equipment to the updated node equipment in the current updated data center.
Specifically, the cache file may be a Log file (Log), or may be other, which is not specifically limited.
As another implementation manner, the distributed cluster may not be divided into data centers, or the distributed cluster includes only one data center, and the upgrade management device upgrades one or more node devices at the same time; in this case, the read-write operation of the current upgrade node apparatus may be switched to the non-current upgrade node apparatus.
S202: and upgrading the first type of software layer.
S203: and upgrading the second type of software layer.
In this embodiment, the node device is upgraded in layers, and the first type of software layer is upgraded first, and then the second type of software layer is upgraded; or, the second type software layer may be upgraded first, and then the first type software layer may be upgraded.
The first type of software layer is related to internal communication of the distributed cluster, and specifically may include: single data center layer, cross data center layer, persistence layer. The single data center layer refers to: a software layer on which data interactions in a data center depend; cross data center layer refers to: a software layer on which data interactions between the plurality of data centers depend; the persistence layer refers to: the software layer where the logical structure of the database resides.
For example, there may be two databases in one distributed cluster, one being a single data center database and the other being a cross data center database, some data common among the data centers may be stored in the cross data center database, so that the common data is stored in only one copy, and occupies less storage resources. There is a persistence layer in the node device, which includes a logical structure (Schema) of the database, through which the node device can invoke the database.
The second type of software layer is related to internal and external communication of the distributed cluster, and specifically may include: a platform services layer and an application layer. The platform service layer refers to: calling a software layer on which remote equipment depends, wherein the remote equipment is equipment outside the distributed cluster; the application layer refers to the software layer on which interactions with the user depend.
As an embodiment, the first type software layer or the second type software layer may be upgraded by:
acquiring the state of a new class corresponding to the software layer; wherein, the class is a template of the object, and the new class is an upgraded class;
converting the state of the class in the software layer into the state of the new class;
acquiring a new object corresponding to the software layer; wherein the object is an instance of a class, and the new object is an upgraded object;
replacing the new object with an object in the software layer.
The software layers may be a first type of software layer or a second type of software layer. Each class software layer can comprise classes (class) and objects, wherein the classes are templates of the objects, and the objects are instances of the classes; for distinguishing descriptions, a class before upgrading is called an old class, a class after upgrading is called a new class, an object before upgrading is called an old object, and an object after upgrading is called a new object.
Replacing the state of the new class with the state of the old class can be understood as converting the format of the data in the software layer to accommodate the new class. Replacement of the old object with the new object may be accomplished by node recovery.
In one embodiment, the following steps may be performed prior to S202: upgrading the operation system in the current upgrading node equipment; and upgrading the software which is installed in the current upgrading node equipment and is irrelevant to the communication of the distributed cluster.
The software installed in the current upgrade node equipment that is not related to the communication of the distributed cluster may be referred to as a machine node layer, such as a standalone software, such as office software, or the like. For example, the machine node layer may be upgraded by way of a software package manager (Red Hat Package Manager, RPM).
In other embodiments, the operating system and the machine node layer may not be upgraded; alternatively, not every upgrade may require an upgrade to the operating system, as well as the machine node level.
As shown in fig. 1b, a node device may be split into multiple software layers: the operation system layer, the machine node layer, the single data center cluster layer, the cross data center cluster layer, the persistence layer, the platform service layer and the application layer can upgrade all software layers of the node equipment in sequence from bottom to top.
In fig. 1a, the client control node device performs an upgrade on each software layer, and each software layer in fig. 1b corresponds to being shielded, and each software layer cannot sense the upgrade process.
As described above, the upgrade management apparatus controls the node apparatus to perform the upgrade, and specifically, the upgrade management apparatus may start an upgrade service program by which an upgrade plan for the current upgrade node apparatus is generated and issued to the current upgrade node apparatus so that the current upgrade node apparatus upgrade plan performs the upgrade.
After the current upgrade node equipment is upgraded, the upgrade management equipment switches the read-write operation belonging to the current upgrade node equipment back to the current upgrade node equipment.
As an embodiment, after the upgrade of the node device is completed, the old version in the node device is not deleted immediately, but is deleted after waiting for a period of time. Thus, if the new version is run with errors, the old version can still be run, and the node device can still provide services. The preset time period may be set according to practical situations, for example, a day, a week, etc., and is not specifically limited.
During the period that the upgrade is completed and the old version is not deleted, a version calling program can be started in the node equipment; if the read-write operation instruction received by the node equipment is directed at the version before upgrading during the period, calling the version before upgrading to process the read-write operation instruction through the version calling program; if the read-write operation instruction received by the node equipment is aimed at the updated version during the period, the updated version is called to process the read-write operation instruction through the version calling program.
After the old version is deleted, the version caller may be deleted.
In this embodiment, the node device is upgraded hierarchically, and each type of software layer may correspond to one version. For example, each software layer in FIG. 1b may correspond to a version. And after each software layer is upgraded, an old version and a new version exist at the same time, the upgrading process can be as shown in fig. 1c, version 1 is the old version, and version 2 is the new version: before upgrading, the three software layers are all version 1; after upgrading the software layer 1, the version 1 and the version 2 exist in the software layer 1 at the same time; upgrade 2 is performed on software layer 2, version 1 and version 2 exist in software layer 2 at the same time, and the like, which are not listed.
In fig. 1a, a client is installed in a node device, a version calling program may be set in the client, specifically, after the client receives a read-write operation instruction, a version number corresponding to the instruction is determined, and an object in a software layer corresponding to the version number is called to execute the read-write operation.
By applying the embodiment shown in fig. 2 of the present invention, in the first aspect, even if the node device receives the read-write operation instruction in the upgrading process, the read-write operation instruction is also switched to other non-current upgrading node devices, and the other non-current upgrading node devices continue to provide services, so that the scheme can continue to provide services while upgrading; in a second aspect, the present solution provides a new upgrade method for the node device by performing a hierarchical upgrade.
The embodiment of the invention also provides a distributed cluster, as shown in fig. 3, comprising upgrade management equipment and a plurality of node equipment (node equipment 1, node equipment 2 and … … node equipment N),
the upgrade management device is configured to determine a current upgrade node device from the plurality of node devices; sending a first switching instruction, a first software layer upgrading instruction and a second software layer upgrading instruction to the current upgrading node equipment;
The node equipment is used for switching the read-write operation of the node equipment to non-current upgrading node equipment in the distributed cluster after receiving the first switching instruction; after receiving the first software layer upgrading instruction, upgrading the first type of software layer of the user; wherein, the first type software layer is: a software layer associated with internal communication of the distributed cluster; after receiving the second software layer upgrading instruction, upgrading the second type software layer of the second type software layer; wherein, the second type software layer is: a software layer associated with internal and external communications of the distributed cluster.
As one embodiment, the distributed cluster comprises a plurality of data centers, and each data center comprises at least one node device;
the upgrade management apparatus is further configured to determine a current upgrade data center among the plurality of data centers; taking each node device in the current upgrading data center as current upgrading node device;
the node equipment is also used for switching the read-write operation of the node equipment to the node equipment of the non-current upgrading data center after receiving the first switching instruction.
As an implementation manner, the upgrade management device is further configured to send a second switching instruction to the node device after the upgrade is completed;
the node device is further configured to switch the read-write operation belonging to the node device back to the node device after receiving the second switching instruction.
As an implementation manner, the node device is further configured to start a version calling program after switching the read-write operation belonging to itself back to itself; if the received read-write operation instruction aims at the version before upgrading, calling the version before upgrading to process the read-write operation instruction through the version calling program; and if the received read-write operation instruction aims at the updated version, calling the updated version to process the read-write operation instruction through the version calling program.
An upgrade client can be installed in the upgrade management device and the node device, and the control of the upgrade management device to the node device is realized through the upgrade client.
The upgrade management apparatus in fig. 3 may also perform any of the distributed cluster upgrade methods in the embodiment of fig. 1, and the node apparatus in fig. 3 may also perform any of the distributed cluster upgrade methods in the embodiment of fig. 2.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the distributed cluster embodiment, since it is substantially similar to the distributed cluster upgrade method embodiment, the description is relatively simple, and the relevant points are referred to in the description of the distributed cluster upgrade method embodiment.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (12)

1. The distributed cluster upgrading method is characterized by being applied to upgrading management equipment, wherein the distributed cluster comprises a plurality of node equipment; the method comprises the following steps:
determining current upgrade node equipment in the plurality of node equipment;
switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment in the distributed cluster;
starting an upgrade service program, and generating an upgrade plan for the current upgrade node equipment according to the topology structure information of the distributed cluster through the upgrade service program, wherein the topology structure information is used for representing data interaction between the node equipment and external equipment of the distributed cluster;
upgrading the operating system in the current upgrading node equipment;
upgrading software which is installed in the current upgrading node equipment and is irrelevant to the communication of the distributed cluster;
Upgrading the first type software layer in the current upgrading node equipment according to the upgrading plan; wherein, the first type software layer is: a software layer associated with internal communication of the distributed cluster;
upgrading the second type of software layer in the current upgrading node equipment according to the upgrading plan; wherein, the second type software layer is: a software layer associated with internal and external communications of the distributed cluster.
2. The method of claim 1, wherein the distributed cluster comprises a plurality of data centers, each data center comprising at least one node device;
the determining, in the plurality of node devices, a current upgrade node device includes:
determining a current upgrade data center among the plurality of data centers;
taking each node device in the current upgrading data center as current upgrading node device;
the switching the read-write operation of the current upgrade node equipment to the non-current upgrade node equipment in the distributed cluster comprises the following steps:
and switching the read-write operation of each node device in the current upgrading data center to the node device of the non-current upgrading data center.
3. The method according to claim 1, wherein the method further comprises:
and deleting the version before upgrading in the current upgrading node equipment after the preset time period after the current upgrading node equipment is upgraded.
4. The distributed cluster upgrading method is characterized by being applied to current upgrading node equipment in a distributed cluster, wherein the current upgrading node equipment comprises an operating system, software irrelevant to communication of the distributed cluster, a first type software layer and a second type software layer, and the first type software layer is: a software layer related to internal communication of the distributed cluster, wherein the second type of software layer is: a software layer associated with internal and external communications of the distributed cluster;
the method comprises the following steps:
switching the read-write operation of the current upgrading node equipment to non-current upgrading node equipment in the distributed cluster, wherein the non-current upgrading node equipment is as follows: node equipment which is not updated at the current moment;
receiving an upgrade plan sent by upgrade management equipment for the current upgrade node equipment, wherein the upgrade plan is generated by the upgrade management equipment through an upgrade service program according to topology structure information of the distributed cluster, and the topology structure information is used for representing data interaction between the node equipment and external equipment of the distributed cluster;
Upgrading the operating system;
upgrading the software irrelevant to the communication of the distributed cluster;
upgrading the first type software layer according to the upgrade plan;
and upgrading the second type software layer according to the upgrading plan.
5. The method of claim 4, wherein the distributed cluster includes at least one data center, each data center including at least one node device; the current upgrade node equipment belongs to a current upgrade data center;
the switching the read-write operation of the current upgrade node equipment to the non-current upgrade node equipment in the distributed cluster comprises the following steps:
switching the read-write operation of the current upgrading node equipment to the node equipment of a non-current upgrading data center in the distributed cluster, wherein the non-current upgrading data center is as follows: a data center which is not updated at the current moment;
or switching the read-write operation of the current upgrade node equipment to the upgraded node equipment in the current upgrade data center.
6. The method of claim 5, further comprising, prior to said switching read and write operations of the current upgrade node device to an upgraded node device in the current upgrade data center:
Judging whether updated node equipment exists in the current updating data center;
if the data does not exist, writing the data corresponding to the read-write operation into a cache file; after the updated node equipment exists in the current updated data center, processing data corresponding to the read-write operation through the updated node equipment;
and if so, executing the step of switching the read-write operation of the current upgrading node equipment to the upgraded node equipment in the current upgrading data center.
7. The method of claim 4, further comprising, after said upgrading said second type of software layer:
switching the read-write operation belonging to the current upgrading node equipment back to the current upgrading node equipment, and starting a version calling program;
if the received read-write operation instruction aims at the version before upgrading, calling the version before upgrading to process the read-write operation instruction through the version calling program;
and if the received read-write operation instruction aims at the updated version, calling the updated version to process the read-write operation instruction through the version calling program.
8. The method of claim 4, wherein the upgrading the first type of software layer comprises:
acquiring a state of a new class corresponding to the first class software layer; wherein, the class is a template of the object, and the new class is an upgraded class;
converting the class state in the first class software layer into the state of the new class;
acquiring a new object corresponding to the first type software layer; wherein the object is an instance of a class, and the new object is an upgraded object;
and replacing the new object with the object in the first type software layer.
9. A distributed cluster is characterized by comprising upgrade management equipment and a plurality of node equipment,
the upgrade management device is configured to determine a current upgrade node device from the plurality of node devices; transmitting a first switching instruction, an operating system upgrading instruction, a software upgrading instruction irrelevant to communication of the distributed cluster, a first software layer upgrading instruction and a second software layer upgrading instruction to the current upgrading node equipment, and starting an upgrading service program, generating an upgrading plan aiming at the current upgrading node equipment according to topology structure information of the distributed cluster through the upgrading service program, and transmitting the upgrading plan to the node equipment, wherein the topology structure information is used for representing data interaction between the node equipment and external equipment of the distributed cluster;
The node equipment is used for receiving the upgrade plan sent by the upgrade management equipment and aiming at the node equipment, and switching the read-write operation of the node equipment to non-current upgrade node equipment in the distributed cluster after receiving the first switching instruction; after receiving the operating system upgrading instruction, upgrading the operating system of the operating system; after receiving an upgrade instruction of software irrelevant to the communication of the distributed cluster, upgrading the software which is installed by the software and is irrelevant to the communication of the distributed cluster; after receiving the first software layer upgrading instruction, upgrading the first type of software layer according to the upgrading plan; wherein, the first type software layer is: a software layer associated with internal communication of the distributed cluster; after receiving the second software layer upgrading instruction, upgrading the second type software layer according to the upgrading plan; wherein, the second type software layer is: a software layer associated with internal and external communications of the distributed cluster.
10. The distributed cluster of claim 9, wherein the distributed cluster comprises a plurality of data centers, each data center comprising at least one node device;
The upgrade management apparatus is further configured to determine a current upgrade data center among the plurality of data centers; taking each node device in the current upgrading data center as current upgrading node device;
the node equipment is also used for switching the read-write operation of the node equipment to the node equipment of the non-current upgrading data center after receiving the first switching instruction.
11. The distributed cluster of claim 9, wherein,
the upgrade management equipment is also used for sending a second switching instruction to the node equipment with the upgrade completed;
the node device is further configured to switch the read-write operation belonging to the node device back to the node device after receiving the second switching instruction.
12. The distributed cluster of claim 11, wherein,
the node equipment is also used for starting a version calling program after switching the read-write operation belonging to the node equipment back to the node equipment; if the received read-write operation instruction aims at the version before upgrading, calling the version before upgrading to process the read-write operation instruction through the version calling program; and if the received read-write operation instruction aims at the updated version, calling the updated version to process the read-write operation instruction through the version calling program.
CN201810332728.2A 2018-04-13 2018-04-13 Distributed cluster upgrading method and distributed cluster Active CN110377298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810332728.2A CN110377298B (en) 2018-04-13 2018-04-13 Distributed cluster upgrading method and distributed cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810332728.2A CN110377298B (en) 2018-04-13 2018-04-13 Distributed cluster upgrading method and distributed cluster

Publications (2)

Publication Number Publication Date
CN110377298A CN110377298A (en) 2019-10-25
CN110377298B true CN110377298B (en) 2023-12-05

Family

ID=68243744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810332728.2A Active CN110377298B (en) 2018-04-13 2018-04-13 Distributed cluster upgrading method and distributed cluster

Country Status (1)

Country Link
CN (1) CN110377298B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114697213A (en) * 2022-03-30 2022-07-01 联想(北京)有限公司 Upgrading method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140376362A1 (en) * 2013-06-24 2014-12-25 Oracle International Corporation Dynamic client fail-over during a rolling patch installation based on temporal server conditions
CN106803790A (en) * 2016-12-06 2017-06-06 浙江大华技术股份有限公司 The upgrade control method and device of a kind of group system
CN107479937A (en) * 2017-09-25 2017-12-15 郑州云海信息技术有限公司 A kind of multi-node cluster intersects the method for upgrading

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140376362A1 (en) * 2013-06-24 2014-12-25 Oracle International Corporation Dynamic client fail-over during a rolling patch installation based on temporal server conditions
CN106803790A (en) * 2016-12-06 2017-06-06 浙江大华技术股份有限公司 The upgrade control method and device of a kind of group system
CN107479937A (en) * 2017-09-25 2017-12-15 郑州云海信息技术有限公司 A kind of multi-node cluster intersects the method for upgrading

Also Published As

Publication number Publication date
CN110377298A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
US8589909B2 (en) Techniques for reducing down time in updating applications with metadata
JP2003504721A (en) Reconfiguration manager that controls electronic device upgrades
CN107844343A (en) The upgrade-system and method of a kind of complex services end application system
WO2019205828A1 (en) Android service framework, and method and device for implementing extended service
JP7161560B2 (en) Artificial intelligence development platform management method, device, medium
CN114844930B (en) Vehicle-end remote control method and system based on SOA architecture
CN107463390B (en) Software upgrading method and upgrading server
CN110377298B (en) Distributed cluster upgrading method and distributed cluster
CN104104701A (en) Online service configuration updating method and system
CN106990974A (en) A kind of APP applications update method, device and electronic equipment
CN116149713B (en) Program upgrading method and device for all-level equipment under tree-type heterogeneous network
US20200133709A1 (en) System and method for content - application split
CN109614442B (en) Data table maintenance method and device for data synchronization, storage medium and electronic equipment
CN104111862A (en) Method and system for obtaining IP (Internet Protocol) address of virtual machine in cloud computing platform
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
CN110941471A (en) Method and device for internationalizing basic data of software system
CN110908694A (en) Hot updating system and method for electronic bidding client application
US20090037493A1 (en) Method and device for updating an object with copyright attribute
CN111399866A (en) VNF (virtual network function) packet updating method and device
CN115495436A (en) Database upgrading method and device
CN110674220B (en) Data heterogeneous method, device and equipment
CN110532000B (en) Kbroker distributed operating system for operation publishing and operation publishing system
CN114237824A (en) Fault positioning method and device, computer readable medium and electronic equipment
CN111741102A (en) Upgrading method and device for distributed micro-service application
CN111008035B (en) Software operation and maintenance method, electronic equipment and storage medium

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