Cluster node upgrading method and device, electronic equipment and storage medium
Through the main agent node, the upgrade of cluster nodes is solved, and the problems of increased network load, large operation and maintenance burden, and unrecoverable upgrade interruption in upgrade management are solved, and efficient and stable cluster node upgrade management is achieved.
Patent Information
- Application Number
- CN202411763949.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The current cluster node upgrade management has problems such as increased network load, high burden on operation and maintenance personnel, and interruption of upgrade process cannot be restored.
The main agent node handles the upgrade of each node in the cluster, obtains the upgrade data packet, upgrades according to the data packet, and records the upgrade process status of the secondary agent node, generates the upgrade status file until the upgrade is completed.
It realizes the reduction of pressure on the cluster management platform, improves processing efficiency, and can record progress during the upgrade process, facilitate restarting control, and restore upgrades from the interrupt after interruption.
Smart Images

Figure CN119814558A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer network communications, and in particular to a cluster node upgrading method, a cluster node upgrading device, an electronic device and a storage medium. Background Art
[0002] With the increase in the number of cluster nodes and the expansion of internal servers, the current upgrade management of cluster nodes mainly relies on the management platform to directly manage the version of each device. However, this traditional upgrade method has some problems. First, as the scale of the cluster expands, the management platform needs to establish a communication connection with each node and its internal server to download the version, issue the configuration, upload the progress, etc., which leads to an increase in network load. It also increases the burden of operation and maintenance personnel to upgrade each server node, and it is impossible to upgrade a node at one time.
[0003] Secondly, there is a problem in the current upgrade process that unexpected interruptions cannot be recovered. During the node upgrade process, if an unexpected interruption occurs (such as network interruption, equipment failure, etc.), the current upgrade management system cannot recover the upgrade from the interruption point and can only restart the upgrade process. This situation may cause the upgrade process to be abnormal or cause the upgrade process to be repeated, affecting the efficiency and stability of the upgrade. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a cluster node upgrade method, a cluster node upgrade device, an electronic device and a storage medium that overcome the above problems or at least partially solve the above problems.
[0005] In order to solve the above problems, in a first aspect of the present invention, an embodiment of the present invention discloses a cluster node upgrade method, which is applied to a master agent node, wherein the master agent node and the sub-agent node form a cluster, and the method comprises:
[0006] In response to the upgrade request, obtaining an upgrade data packet;
[0007] Upgrading according to the upgrade data package;
[0008] In response to the upgrade being completed, sending the upgrade data packet to the sub-agent node;
[0009] The upgrade process status of the sub-agent node is recorded, and an upgrade status file is generated until the upgrade of the sub-agent node is completed.
[0010] Optionally, the step of performing an upgrade according to the upgrade data package includes:
[0011] Get the local version data package;
[0012] Comparing the version number of the local version data package with the version number of the upgrade data package;
[0013] In response to the version number of the upgrade data packet being greater than the version number of the local version data packet, decompressing the upgrade data packet to obtain an upgrade script and a rollback script;
[0014] Execute the upgrade script or the rollback script.
[0015] Optionally, in response to the completion of the upgrade, the step of sending the upgrade data packet to the sub-agent node includes:
[0016] Determining a network address of the sub-agent node;
[0017] Sort the sub-agent nodes based on the network addresses to determine a sending order;
[0018] In response to the upgrade being completed, the upgrade data packet is sent to the sub-agent node based on the sending order.
[0019] Optionally, the step of recording the upgrade process status of the sub-agent node and generating an upgrade status file includes:
[0020] Detecting the current upgrade progress and upgrade result of the sub-agent node;
[0021] The current upgrade progress and the upgrade result are recorded in a preset data exchange format file to generate an upgrade status file.
[0022] Optionally, the method further comprises:
[0023] After an interruption or restart, reading the upgrade status file;
[0024] identifying an upgrade status of the sub-agent node based on the upgrade status file;
[0025] The sub-agent node is controlled to be upgraded based on the upgrade status of the sub-agent node and the upgrade data packet.
[0026] Optionally, the cluster includes multiple proxy nodes, and the multiple proxy nodes determine the master proxy node based on election.
[0027] Optionally, the method further comprises:
[0028] In response to the heartbeat signal sent by the secondary proxy node, a feedback signal is sent to the secondary proxy node; when the secondary proxy node does not receive the feedback signal, it is used to select a target proxy node among the secondary proxy nodes and update the target proxy node to the primary proxy node.
[0029] In a second aspect of the present invention, an embodiment of the present invention discloses a cluster node upgrade device, which is applied to a master agent node, wherein the master agent node and a sub-agent node form a cluster, and the device comprises:
[0030] A response module, used for obtaining an upgrade data packet in response to an upgrade request;
[0031] An upgrade module, used for performing upgrade according to the upgrade data package;
[0032] a sending module, configured to send the upgrade data packet to the sub-agent node in response to the upgrade being completed;
[0033] The recording module is used to record the upgrade process status of the sub-agent node and generate an upgrade status file until the upgrade of the sub-agent node is completed.
[0034] According to a third aspect of the present invention, an embodiment of the present invention discloses an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the cluster node upgrade method as described above.
[0035] In a fourth aspect of the present invention, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the cluster node upgrade method described above are implemented.
[0036] The embodiments of the present invention include the following advantages:
[0037] The embodiment of the present invention obtains an upgrade data packet in response to an upgrade request; performs an upgrade according to the upgrade data packet; sends the upgrade data packet to the sub-agent node in response to the upgrade completion; records the upgrade process status of the sub-agent node, generates an upgrade status file, until the sub-agent node upgrade is completed. The upgrade of each node in the entire cluster is processed by the master agent node. The master agent node can be adjusted according to the dynamic increase and decrease of the cluster with flexibility. A master agent node can control all sub-agent nodes while reducing the pressure on the cluster management platform and improving processing efficiency. A complex server software combination is formed into a system version for unified management, and the status of each cluster node is recorded during the upgrade process, which can retain the current progress and facilitate restart control. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flowchart of the steps of an embodiment of a cluster node upgrade method of the present invention;
[0039] Figure 2 is a flowchart of another cluster node upgrade method embodiment of the present invention;
[0040] Figure 3 is a schematic diagram of a management platform in a cluster of the present invention;
[0041] Figure 4 It is a schematic diagram of proxy node election in a cluster of the present invention;
[0042] Figure 5 It is a schematic diagram of cluster node upgrade of the present invention;
[0043] Figure 6 It is a schematic diagram of cluster node upgrade interruption recovery of the present invention;
[0044] Figure 7 is a flowchart of an example of a cluster node upgrade method of the present invention;
[0045] Figure 8 It is a structural block diagram of an embodiment of a cluster node upgrading device of the present invention;
[0046] Fig. 9 is a structural block diagram of an electronic device provided by an embodiment of the present invention;
[0047] Fig.10 It is a structural block diagram of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0049] It should be noted that a cluster refers to an architecture that connects multiple computers (also called nodes or servers) together to jointly complete computing tasks.
[0050] Server Node: A server node in a cluster refers to each independent computer or server in the cluster. Each node is an independent entity.
[0051] Agent Service: A service installed on the server that is used to download the server software version from the management platform and perform installation, upgrade, and rollback.
[0052] Reference Figure 1, shows a flow chart of steps of an embodiment of a cluster node upgrade method of the present invention, the cluster node upgrade method is applied to a master agent node, the master agent node and the sub-agent node form a cluster. That is, in the cluster, one server node is the master agent node, and the remaining server nodes are sub-agent nodes. The master agent node serves as a communication relay between the cluster management platform and the sub-agent nodes. The management platform is a web (network) service for users to manage the software system version of each cluster.
[0053] The cluster node upgrade method may specifically include the following steps:
[0054] Step 101, in response to an upgrade request, obtaining an upgrade data package;
[0055] When users need to upgrade the version of nodes in the cluster, they can initiate an upgrade request through the management platform.
[0056] The master agent node obtains the upgrade data packet from the management platform in response to the upgrade request.
[0057] Step 102, upgrading according to the upgrade data package;
[0058] Execute installation, upgrade, and rollback services based on the data content in the upgrade data package to complete the software upgrade.
[0059] Step 103, in response to the upgrade being completed, sending the upgrade data packet to the sub-agent node;
[0060] After the upgrade of the main agent node is completed, the upgrade data packet that has been completed by itself can be sent to the sub-agent node. That is, the notification of the completion of the upgrade of the main agent node sends the upgrade data packet to the sub-agent node. After receiving the upgrade data packet, the sub-agent node performs the corresponding installation, upgrade, and rollback services based on the upgrade data packet.
[0061] Step 104, recording the upgrade process status of the sub-agent node and generating an upgrade status file until the upgrade of the sub-agent node is completed.
[0062] During the upgrade process of the sub-agent nodes, the main agent node can continuously obtain the upgrade process status of each sub-agent node during the current upgrade; record the upgrade process status of each sub-agent node, and generate an upgrade status file until the sub-agent node upgrade is completed. Therefore, the upgrade status of each sub-agent node can be viewed through the upgrade status file, and the current upgrade progress of each sub-agent node can also be viewed and recorded.
[0063] The embodiment of the present invention obtains an upgrade data packet in response to an upgrade request; performs an upgrade according to the upgrade data packet; sends the upgrade data packet to the sub-agent node in response to the upgrade completion; records the upgrade process status of the sub-agent node, generates an upgrade status file, until the sub-agent node upgrade is completed. The upgrade of each node in the entire cluster is processed by the master agent node. The master agent node can be adjusted according to the dynamic increase and decrease of the cluster with flexibility. A master agent node can control all sub-agent nodes while reducing the pressure on the cluster management platform and improving processing efficiency. A complex server software combination is formed into a system version for unified management, and the status of each cluster node is recorded during the upgrade process, which can retain the current progress and facilitate restart control.
[0064] Reference Figure 2 , shows a flowchart of another cluster node upgrade method embodiment of the present invention, the cluster node upgrade method is applied to the master agent node, the master agent node and the sub-agent node form a cluster. On the communication link, the master agent node is located between the sub-agent node and the management platform. The management platform is a unified platform for managing the cluster. Figure 3 As shown, the management work such as the upgrade of the server system software within the cluster is completed by the management platform.
[0065] Wherein, the cluster includes multiple proxy nodes, and the multiple proxy nodes determine the master proxy node based on election. The object of election can be based on the performance, bandwidth, IP (Internet Protocol Address) address, etc. of each proxy node. For example, the CPU (central processing unit) model performance (number of cores + main frequency) of each proxy node can be used. The one with the highest CPU performance is elected as the master proxy node, and the other proxy nodes are deputy proxy nodes. If the CPU models are the same, the bandwidth sizes are compared. The one with the largest bandwidth is elected as the master proxy node, and the other proxy nodes are deputy proxy nodes. If the CPU models and bandwidths are the same, the IP addresses are compared. The node with the smallest IP address is preferentially selected as the master proxy node, such as Figure 4 As shown, the hardware configuration of the general cluster server is the same. After the election, server 1 with the smallest IP address starts and runs as the main agent node, and the other servers are sub-agent nodes. The sub-agent node records the IP address of the main agent node, which is used to receive instructions from the main agent node and report progress and results to the main agent node.
[0066] The cluster node upgrade method may specifically include the following steps:
[0067] Step 201, in response to an upgrade request, obtaining an upgrade data package;
[0068] When the software version of each node server in the cluster needs to be upgraded, the user can initiate an upgrade request through the management platform. The software version is a collection of cluster service software, component tools, and scripts, which are packaged into a compressed package. The total installation package collection uses a comprehensive version number. After the installation package is decompressed, there is an installation and upgrade script upgrade.sh for installation and upgrade purposes, and a rollback script rollback.sh for installation and rollback to the previous version after the upgrade fails.
[0069] The master agent node obtains the upgrade data packet in response to the upgrade request.
[0070] Step 202, upgrading according to the upgrade data package;
[0071] The master agent node can use the acquired upgrade data packet to upgrade itself first.
[0072] In an optional embodiment of the present invention, the step of upgrading according to the upgrade data packet includes: obtaining a local version data packet; comparing the version number of the local version data packet with the version number of the upgrade data packet; in response to the version number of the upgrade data packet being greater than the version number of the local version data packet, decompressing the upgrade data packet to obtain an upgrade script and a rollback script; and executing the upgrade script or the rollback script.
[0073] Before upgrading, you can also verify the upgrade data package to determine whether the upgrade can be performed. You can obtain the local version data package, that is, obtain the currently installed version data package. Identify the version number of the local version data package and the version number of the upgrade data package. Compare the version number of the local version data package with the version number of the upgrade data package to determine whether the version number of the upgrade data package is greater than the version number of the local version data package. Only when the version number of the upgrade data package is greater than the version number of the local version data package, it means that the software version in the upgrade data package is newer than the software version of the current local version data package, and the upgrade can be performed. Decompress the upgrade data package to obtain the upgrade script and the rollback script; execute the upgrade script or the rollback script to complete the corresponding service.
[0074] Step 203, in response to the upgrade being completed, sending the upgrade data packet to the sub-agent node;
[0075] After the upgrade of the main agent node is completed, the upgrade data packet can also be sent to each sub-agent node to allow the sub-agent node to be upgraded.
[0076] In an optional embodiment of the present invention, in response to the completion of the upgrade, the step of sending the upgrade data packet to the sub-agent node includes: determining the network address of the sub-agent node; sorting the sub-agent nodes based on the network address to determine the sending order; in response to the completion of the upgrade, sending the upgrade data packet to the sub-agent node based on the sending order.
[0077] The upgrade data packets sent to the sub-agent nodes can be sent one by one, so as to maintain the stability of the upgrade process. The network address of each sub-agent node can be determined from the management platform. The network address can be identified by an IP address. Then, the sub-agent nodes can be sorted based on the network address increment, that is, the network address is from small to large to determine the sending order. When the main agent node is upgraded, the upgrade data packets can be sent to the sub-agent nodes one by one based on the sending order.
[0078] The upgrade process of the secondary agent node is the same as that of the primary agent node. The upgrade data package can be decompressed to obtain the upgrade script and the rollback script; the upgrade script or the rollback script is executed to complete the corresponding service.
[0079] For example, see Figure 5 The version installation package contains installation packages for multiple services, such as business engine, web service, database, log collection, traffic monitoring, etc. In the upgrade script upgrade.sh and the rollback script rollback.sh, you can execute the upgrade script or rollback script to complete the corresponding service.
[0080] Specifically, the progress is the name of each component, and the result is success or failure. The upgrade and rollback scripts record each step and return the result to the main agent. The components and services of the installation package are installed, upgraded and rolled back in a fixed order. Therefore, when the progress is the name of the last upgrade package component and the result is success, the upgrade is successful. When the component progress result returned by any process is failure, the rollback process needs to be entered.
[0081] Step 204, recording the upgrade process status of the sub-agent node and generating an upgrade status file until the upgrade of the sub-agent node is completed;
[0082] During the upgrade process of the sub-agent node, the upgrade process status of the sub-agent node is continuously recorded and an upgrade status file is generated until the upgrade of the sub-agent node is completed.
[0083] In an optional embodiment of the present invention, the step of recording the upgrade process status of the sub-agent node and generating an upgrade status file includes: detecting the current upgrade progress and upgrade results of the sub-agent node; recording the current upgrade progress and the upgrade results to a preset data exchange format file to generate an upgrade status file.
[0084] The main agent node can detect the current upgrade progress and upgrade results of the sub-agent node in real time or periodically; record the current upgrade progress and upgrade results in the format of a preset data exchange format file to generate an upgrade status file.
[0085] For example, the preset data exchange format is a josn format file. The master agent node records the upgrade progress and status of itself and the sub-agent node, such as the current installed version, the last installed version, the version being upgraded, the upgrade progress, the upgrade status, the rollback progress, and the rollback status. When the upgrade and rollback status of each machine changes, it is saved in the josn format file. The josn format file is as follows:
[0086] {
[0087] "process":"Progress",
[0088] "result":"result"
[0089] }
[0090] Step 205, after interruption or restart, read the upgrade status file;
[0091] After the main agent node is abnormally interrupted or the service is restarted, the recorded upgrade status file can be read to identify the upgrade status of each sub-agent node before the interruption or restart from the upgrade status file.
[0092] Step 206, identifying the upgrade status of the sub-agent node based on the upgrade status file;
[0093] The current upgrade status of each sub-agent node can be identified through the upgrade status file.
[0094] Step 207: Control the sub-agent node to upgrade based on the upgrade status of the sub-agent node and the upgrade data packet.
[0095] Based on the upgrade status of the sub-agent node and the upgrade data packet, the sub-agent node is controlled to be upgraded again based on the progress at the time of interruption.
[0096] For example, see Figure 6, the master agent node can read the upgrade status file that saves each device, traverse the upgrade progress and status of each server and the rollback progress and status, and determine whether the version upgrade has been completed. If completed, the current installed version is replaced with the version number being upgraded, and the upgrade is reported to the management platform. If not completed, instructions (upgrade / rollback operations, and carrying parameters from which progress to start execution instead of starting from the beginning) are issued to each device according to the current progress of each device to continue the unfinished upgrade and rollback operations. The master agent node traverses the version installation status of all sub-agent nodes in the cluster. When a server is still in the upgrade state, it triggers the server to execute the upgrade.sh script with the parameter upgrade progress: process = component X (X takes 1 to N last execution and keeps the upgrade to a certain component and starts to execute downwards) and then continues to upgrade other server versions. When a server is still in the rollback state, it triggers the server to execute the rollback.sh script with the parameter rollback progress: process = component X (X takes 1 to N last execution and keeps the rollback to a certain component and starts to execute downwards) and then continues to roll back other server versions.
[0097] In addition, in response to the heartbeat signal sent by the secondary proxy node, a feedback signal is sent to the secondary proxy node; the secondary proxy node is used to select a target proxy node among the secondary proxy nodes and update the target proxy node to the primary proxy node when the feedback signal is not received.
[0098] A heartbeat mechanism is maintained between the sub-agent node and the main agent node. The sub-agent node will send a heartbeat signal to the main agent. The main agent node can respond to the heartbeat signal sent by the sub-agent node and send a feedback signal to the sub-agent node. The sub-agent node determines that the main agent node is running normally and continues to provide the corresponding service. When the sub-agent node does not receive a feedback signal, it elects a new target agent node among the sub-agent nodes and updates the target agent node to the main agent node. The election method can be the same as the initial election of the main agent node, and can be based on performance, bandwidth, and IP address.
[0099] For example, when the server of the main agent node is shut down or exits abnormally, the services of the remaining sub-agent nodes cannot get a response from the main agent node. After three retries, if no response from the main agent node is obtained, the sub-agent nodes trigger the re-election of the main agent node to communicate with the management platform.
[0100] In order to make the embodiments of the present invention clear to those skilled in the art, the following reference is made to Figure 7 Let's use an example to illustrate. First, deploy the agent service on the server inside the cluster and configure the management platform IP address, which is used for the agent to communicate with it.
[0101] Start the agent service. The agent joins the multicast 224.0.1.100, which is used for local information exchange between agents at multiple points. The agent obtains the server CPU model + export network card bandwidth + local IP address, and sends it to other server agents of the cluster node through multicast. The agent compares the information sent by other nodes and elects the main agent.
[0102] Upload the software version to the management platform, select a cluster to upgrade to this version, and trigger the upgrade. The management platform triggers cluster 1 to upgrade the version, and sends a command to the master agent of cluster 1. The master agent compares the local version with the version number of the upgrade sent, determines that the new version can be upgraded, starts downloading the new version installation package, decompresses it, and executes the upgrade script upgrade.sh. After the upgrade is complete, it triggers other server agents to download the new version from the master agent for upgrade. The upgrade of other server nodes starts from the node with the smallest IP address to the node with the largest IP address.
[0103] The version installation package contains installation packages for multiple services, such as business engine, web service, database, log collection, traffic monitoring, etc. During the execution of the upgrade script upgrade.sh and the rollback script rollback.sh, the execution steps are recorded. The master agent records the upgrade progress and status of itself and other servers, such as the current installed version, the previous installed version, the version being upgraded, the upgrade progress, the upgrade status, the rollback progress, and the rollback status.
[0104] The embodiment of the present invention uses a specific algorithm to recommend a proxy service node from within the cluster to handle the upgrade of the entire cluster from the management platform to the one-to-many upgrade of the internal nodes of the cluster. The proxy can be adjusted according to the dynamic increase or decrease of the cluster with flexibility, while reducing the pressure on the management platform and improving efficiency. A complex server software combination is formed into a system version for unified management, and the upgrade process is split into proxies to record cluster machines and upgrade progress and status, support upgrades after interruptions, improve upgrade efficiency after interruptions, and reduce software anomalies caused by repeated executions. It can reduce the communication load between the management platform and the nodes, improve the reliability and stability of the upgrade process, and can recover from the interruption when an unexpected interruption occurs during the upgrade process; so as to solve the problems existing in the current upgrade management method.
[0105] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0106] Reference Figure 8 , shows a structural block diagram of an embodiment of a cluster node upgrade device of the present invention, wherein the cluster node upgrade is applied to a master agent node, and the master agent node and the slave agent node form a cluster; the cluster node upgrade device may specifically include the following modules:
[0107] A response module 801 is used to obtain an upgrade data packet in response to an upgrade request;
[0108] An upgrade module 802, configured to perform an upgrade according to the upgrade data package;
[0109] A sending module 803, configured to send the upgrade data packet to the sub-agent node in response to the upgrade being completed;
[0110] The recording module 804 is used to record the upgrade process status of the sub-agent node and generate an upgrade status file until the upgrade of the sub-agent node is completed.
[0111] In an optional embodiment of the present invention, the upgrade module 802 includes:
[0112] Get submodule, used to get local version data package;
[0113] A comparison submodule, used to compare the version number of the local version data package with the version number of the upgrade data package;
[0114] A decompression submodule, configured to, in response to the version number of the upgrade data packet being greater than the version number of the local version data packet, decompress the upgrade data packet to obtain an upgrade script and a rollback script;
[0115] The execution submodule is used to execute the upgrade script or the rollback script.
[0116] In an optional embodiment of the present invention, the sending module 803 includes:
[0117] A determination submodule, used to determine the network address of the sub-agent node;
[0118] The sorting submodule does not sort the sub-agent nodes based on the network addresses to determine the sending order;
[0119] The sending submodule is used for sending the upgrade data packet to the sub-agent node based on the sending sequence in response to the upgrade completion.
[0120] In an optional embodiment of the present invention, the recording module 804 includes:
[0121] A detection submodule, used to detect the current upgrade progress and upgrade result of the sub-agent node;
[0122] The recording submodule is used to record the current upgrade progress and the upgrade result into a preset data exchange format file to generate an upgrade status file.
[0123] In an optional embodiment of the present invention, the device further comprises:
[0124] A reading module, used for reading the upgrade status file after interruption or restart;
[0125] A determination module, configured to identify the upgrade status of the sub-agent node based on the upgrade status file;
[0126] The control module is used to control the sub-agent node to upgrade based on the upgrade status of the sub-agent node and the upgrade data packet.
[0127] In an optional embodiment of the present invention, the cluster includes a plurality of proxy nodes, and the plurality of proxy nodes determine the master proxy node based on election.
[0128] In an optional embodiment of the present invention, the device further comprises:
[0129] The feedback module is used to send a feedback signal to the secondary proxy node in response to the heartbeat signal sent by the secondary proxy node; the secondary proxy node is used to select a target proxy node among the secondary proxy nodes and update the target proxy node to the primary proxy node when the feedback signal is not received.
[0130] The embodiment of the present invention obtains an upgrade data packet in response to an upgrade request; performs an upgrade according to the upgrade data packet; sends the upgrade data packet to the sub-agent node in response to the upgrade completion; records the upgrade process status of the sub-agent node, generates an upgrade status file, until the sub-agent node upgrade is completed. The upgrade of each node in the entire cluster is processed by the master agent node. The master agent node can be adjusted according to the dynamic increase and decrease of the cluster with flexibility. A master agent node can control all sub-agent nodes while reducing the pressure on the cluster management platform and improving processing efficiency. A complex server software combination is formed into a system version for unified management, and the status of each cluster node is recorded during the upgrade process, which can retain the current progress and facilitate restart control.
[0131] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0132] Reference Fig. 9 , an embodiment of the present invention further provides an electronic device, including:
[0133] A processor 901 and a storage medium 902, wherein the storage medium 902 stores a computer program executable by the processor 901, and when the electronic device is running, the processor 901 executes the computer program to perform the cluster node upgrade method as described in any one of the embodiments of the present invention.
[0134] The cluster node upgrade method is applied to a master agent node, wherein the master agent node and the sub-agent nodes form a cluster, and the method comprises:
[0135] In response to the upgrade request, obtaining an upgrade data packet;
[0136] Upgrading according to the upgrade data package;
[0137] In response to the upgrade being completed, sending the upgrade data packet to the sub-agent node;
[0138] The upgrade process status of the sub-agent node is recorded, and an upgrade status file is generated until the upgrade of the sub-agent node is completed.
[0139] Optionally, the step of performing an upgrade according to the upgrade data package includes:
[0140] Get the local version data package;
[0141] Comparing the version number of the local version data package with the version number of the upgrade data package;
[0142] In response to the version number of the upgrade data packet being greater than the version number of the local version data packet, decompressing the upgrade data packet to obtain an upgrade script and a rollback script;
[0143] Execute the upgrade script or the rollback script.
[0144] Optionally, in response to the completion of the upgrade, the step of sending the upgrade data packet to the sub-agent node includes:
[0145] Determining a network address of the sub-agent node;
[0146] Sort the sub-agent nodes based on the network addresses to determine a sending order;
[0147] In response to the upgrade being completed, the upgrade data packet is sent to the sub-agent node based on the sending order.
[0148] Optionally, the step of recording the upgrade process status of the sub-agent node and generating an upgrade status file includes:
[0149] Detecting the current upgrade progress and upgrade result of the sub-agent node;
[0150] The current upgrade progress and the upgrade result are recorded in a preset data exchange format file to generate an upgrade status file.
[0151] Optionally, the method further comprises:
[0152] After an interruption or restart, reading the upgrade status file;
[0153] identifying an upgrade status of the sub-agent node based on the upgrade status file;
[0154] The sub-agent node is controlled to be upgraded based on the upgrade status of the sub-agent node and the upgrade data packet.
[0155] Optionally, the cluster includes multiple proxy nodes, and the multiple proxy nodes determine the master proxy node based on election.
[0156] Optionally, the method further comprises:
[0157] In response to the heartbeat signal sent by the secondary proxy node, a feedback signal is sent to the secondary proxy node; when the secondary proxy node does not receive the feedback signal, it is used to select a target proxy node among the secondary proxy nodes and update the target proxy node to the primary proxy node.
[0158] The embodiment of the present invention obtains an upgrade data packet in response to an upgrade request; performs an upgrade according to the upgrade data packet; sends the upgrade data packet to the sub-agent node in response to the upgrade completion; records the upgrade process status of the sub-agent node, generates an upgrade status file, until the sub-agent node upgrade is completed. The upgrade of each node in the entire cluster is processed by the master agent node. The master agent node can be adjusted according to the dynamic increase and decrease of the cluster with flexibility. A master agent node can control all sub-agent nodes while reducing the pressure on the cluster management platform and improving processing efficiency. A complex server software combination is formed into a system version for unified management, and the status of each cluster node is recorded during the upgrade process, which can retain the current progress and facilitate restart control.
[0159] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.
[0160] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0161] Reference Fig.10 The embodiment of the present invention further provides a computer-readable storage medium 1001, on which a computer program is stored. When the computer program is executed by a processor, the cluster node upgrade method as described in any one of the embodiments of the present invention is executed.
[0162] The cluster node upgrade method is applied to a master agent node, wherein the master agent node and the sub-agent nodes form a cluster, and the method comprises:
[0163] In response to the upgrade request, obtaining an upgrade data packet;
[0164] Upgrading according to the upgrade data package;
[0165] In response to the upgrade being completed, sending the upgrade data packet to the sub-agent node;
[0166] The upgrade process status of the sub-agent node is recorded, and an upgrade status file is generated until the upgrade of the sub-agent node is completed.
[0167] Optionally, the step of performing an upgrade according to the upgrade data package includes:
[0168] Get the local version data package;
[0169] Comparing the version number of the local version data package with the version number of the upgrade data package;
[0170] In response to the version number of the upgrade data packet being greater than the version number of the local version data packet, decompressing the upgrade data packet to obtain an upgrade script and a rollback script;
[0171] Execute the upgrade script or the rollback script.
[0172] Optionally, in response to the completion of the upgrade, the step of sending the upgrade data packet to the sub-agent node includes:
[0173] Determining a network address of the sub-agent node;
[0174] Sort the sub-agent nodes based on the network addresses to determine a sending order;
[0175] In response to the upgrade being completed, the upgrade data packet is sent to the sub-agent node based on the sending order.
[0176] Optionally, the step of recording the upgrade process status of the sub-agent node and generating an upgrade status file includes:
[0177] Detecting the current upgrade progress and upgrade result of the sub-agent node;
[0178] The current upgrade progress and the upgrade result are recorded in a preset data exchange format file to generate an upgrade status file.
[0179] Optionally, the method further comprises:
[0180] After an interruption or restart, reading the upgrade status file;
[0181] identifying an upgrade status of the sub-agent node based on the upgrade status file;
[0182] The sub-agent node is controlled to be upgraded based on the upgrade status of the sub-agent node and the upgrade data packet.
[0183] Optionally, the cluster includes multiple proxy nodes, and the multiple proxy nodes determine the master proxy node based on election.
[0184] Optionally, the method further comprises:
[0185] In response to the heartbeat signal sent by the secondary proxy node, a feedback signal is sent to the secondary proxy node; when the secondary proxy node does not receive the feedback signal, it is used to select a target proxy node among the secondary proxy nodes and update the target proxy node to the primary proxy node.
[0186] The embodiment of the present invention obtains an upgrade data packet in response to an upgrade request; performs an upgrade according to the upgrade data packet; sends the upgrade data packet to the sub-agent node in response to the upgrade completion; records the upgrade process status of the sub-agent node, generates an upgrade status file, until the sub-agent node upgrade is completed. The upgrade of each node in the entire cluster is processed by the master agent node. The master agent node can be adjusted according to the dynamic increase and decrease of the cluster with flexibility. A master agent node can control all sub-agent nodes while reducing the pressure on the cluster management platform and improving processing efficiency. A complex server software combination is formed into a system version for unified management, and the status of each cluster node is recorded during the upgrade process, which can retain the current progress and facilitate restart control.
[0187] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0188] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0189] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0190] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0191] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0192] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0193] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0194] The above is a detailed introduction to a cluster node upgrade method, a cluster node upgrade device, an electronic device and a storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A cluster node upgrade method, characterized in that: Applied to a master agent node, the master agent node and the sub-agent nodes form a cluster, the method comprises: In response to the upgrade request, obtaining an upgrade data packet; Upgrading according to the upgrade data package; In response to the upgrade being completed, sending the upgrade data packet to the sub-agent node; The upgrade process status of the sub-agent node is recorded, and an upgrade status file is generated until the upgrade of the sub-agent node is completed.
2. The method according to claim 1, characterized in that The step of upgrading according to the upgrade data package comprises: Get the local version data package; Comparing the version number of the local version data package with the version number of the upgrade data package; In response to the version number of the upgrade data packet being greater than the version number of the local version data packet, decompressing the upgrade data packet to obtain an upgrade script and a rollback script; Execute the upgrade script or the rollback script.
3. The method according to claim 1, characterized in that In response to the upgrade being completed, the step of sending the upgrade data packet to the sub-agent node comprises: Determining a network address of the sub-agent node; Sort the sub-agent nodes based on the network addresses to determine a sending order; In response to the upgrade being completed, the upgrade data packet is sent to the sub-agent node based on the sending order.
4. The method according to claim 1, characterized in that: The step of recording the upgrade process status of the sub-agent node and generating an upgrade status file comprises: Detecting the current upgrade progress and upgrade result of the sub-agent node; The current upgrade progress and the upgrade result are recorded in a preset data exchange format file to generate an upgrade status file.
5. The method according to claim 1, characterized in that The method further comprises: After an interruption or restart, reading the upgrade status file; identifying an upgrade status of the sub-agent node based on the upgrade status file; The sub-agent node is controlled to be upgraded based on the upgrade status of the sub-agent node and the upgrade data packet.
6. The method according to claim 1, characterized in that The cluster includes a plurality of proxy nodes, and the plurality of proxy nodes determine the master proxy node based on election.
7. The method according to claim 1, characterized in that The method further comprises: In response to the heartbeat signal sent by the secondary proxy node, a feedback signal is sent to the secondary proxy node; when the secondary proxy node does not receive the feedback signal, it is used to select a target proxy node from the secondary proxy nodes and update the target proxy node to the primary proxy node.
8. A cluster node upgrade device, characterized in that: Applied to a master agent node, the master agent node and the sub-agent node form a cluster, the device comprises: A response module, used for obtaining an upgrade data packet in response to an upgrade request; An upgrade module, used for performing upgrade according to the upgrade data package; a sending module, configured to send the upgrade data packet to the sub-agent node in response to the upgrade being completed; The recording module is used to record the upgrade process status of the sub-agent node and generate an upgrade status file until the upgrade of the sub-agent node is completed.
9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the cluster node upgrading method according to any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of upgrading the cluster nodes according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Automatically updating method and apparatus for telecom multi-branch network management system
CN101136770A
Uninterrupted storage cluster node online upgrading method, device and equipment
CN109582335A
Method and system for adjusting state of service cluster
CN116723088A
Application cluster upgrading method and device
CN118631658A
Cluster upgrading method and device, storage medium and electronic equipment
CN118838618A