Software upgrading method, device and equipment, readable storage medium and program product
By using upgrade template files in the main node of the storage system and dynamically configuring the upgrade nodes and methods, the problem of poor upgrade flexibility in the existing technology is solved, and flexible adaptation to different scenarios is achieved.
Patent Information
- Application Number
- CN202411455418.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-18
AI Technical Summary
The existing software upgrade method has the problem of poor upgrade flexibility and cannot adapt to the personalized needs of different scenarios.
By using upgrade template files in the primary node of the storage system, dynamically configure upgrade nodes and upgrade methods, flexible software upgrades are achieved. The upgrade template file contains multiple upgrade fields, each field corresponds to different upgrade methods and node ranges.
It improves the flexibility of software upgrades, and can flexibly configure upgrade nodes and methods according to the needs of different scenarios, and adapts to complex scenarios with large personalized differences.
Smart Images

Figure CN119473343A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software upgrade, and in particular to a software upgrade method, apparatus, device, readable storage medium and program product. Background Art
[0002] In storage systems, current software upgrade methods mainly include full offline upgrade, online upgrade of each node within the node redundancy range, and manual replacement of configuration files in nodes.
[0003] However, the above software upgrade methods all adopt a fixed upgrade process to perform software upgrade, which has the problem of poor upgrade flexibility. Summary of the invention
[0004] Based on this, it is necessary to provide a software upgrade method, device, equipment, readable storage medium and program product that can improve the flexibility of software upgrades in response to the above technical problems.
[0005] In a first aspect, the present application provides a software upgrade method for a master node in a storage system, the method comprising:
[0006] Acquire an upgrade template file corresponding to the current upgrade process, where the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, where the upgrade node includes the master node and / or a slave node in the storage system;
[0007] Perform software upgrade on the upgrade node according to the upgrade template file.
[0008] In this embodiment, for each upgrade process, the upgrade template file can be flexibly configured according to the needs of the actual scenario. Different upgrade processes can be configured with their corresponding upgrade nodes and / or upgrade methods, so that they can be well adapted to various scenarios with large personalized differences, thereby improving the upgrade flexibility.
[0009] In one embodiment, the upgrade template file includes at least one upgrade field, and performing software upgrade on the upgrade node according to the upgrade template file includes:
[0010] For each of the upgrade fields, determining the upgrade mode corresponding to the upgrade field, where different upgrade fields correspond to different upgrade modes;
[0011] According to the upgrade mode, software upgrade is performed on the upgrade nodes within the upgrade node range indicated by the upgrade field.
[0012] This embodiment indicates different upgrade methods through various upgrade fields in the upgrade template file, and each upgrade field can indicate the upgrade node range corresponding to the upgrade method. The master node can know the upgrade method and upgrade node range corresponding to the current upgrade process by identifying each field. The implementation method is simple and the computational complexity of the master node is small.
[0013] In one embodiment, the upgrade field includes a script field, the upgrade nodes include the master node and the slave node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade method includes:
[0014] Determining a service identifier from the upgrade template file according to the script field;
[0015] According to the service identifier, obtaining an upgrade script for the service corresponding to the service identifier;
[0016] According to the upgrade script, the historical script corresponding to the service is upgraded in the master node and the slave node.
[0017] In this embodiment, the script field in the upgrade template file can be used to easily realize flexible selection of upgrade nodes and flexible selection of services that need to be upgraded. In the actual implementation process, if a service needs to be upgraded, the corresponding service identifier can be added after the script field. The operation is simple and easy to implement.
[0018] In one embodiment, the upgrade field includes a first running field, the upgrade node includes the master node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode includes:
[0019] Reading a first system command from the upgrade template file according to the first operation field, and converting the first system command into a first operation command;
[0020] Execute the first run command.
[0021] In this embodiment, in the upgrade template file, through the first run field, an upgrade method that cannot be implemented by the script field can be implemented in the main node. In the actual implementation process, if it is necessary to implement some upgrade operations that cannot be implemented by the script field, the first system command can be flexibly added after the first run field, and the upgrade operation can be configured in a targeted manner through the first system command, thereby further improving the upgrade flexibility.
[0022] In one embodiment, the upgrade field includes a second running field, the upgrade node includes the master node and the slave node, and performing software upgrade on the upgrade node within the upgrade node range indicated by the upgrade field according to the upgrade mode includes:
[0023] reading a second system command from the upgrade template file according to the second operation field, and converting the second system command into a second operation command;
[0024] The second operation command is executed and sent to the slave node, where the second operation command is used by the slave node to execute the second operation command.
[0025] In this embodiment, in the upgrade template file, through the second running field, the upgrade method that cannot be achieved by the script field can be implemented in the master node and the slave node. In the actual implementation process, the first running field or the second running field can be configured according to the required upgrade node range to implement some upgrade operations that cannot be achieved by the script field. The upgrade method is flexible and conducive to adapting to various upgrade scenarios.
[0026] In one embodiment, the upgrade field includes a first parameter modification field, the upgrade node includes the master node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode includes:
[0027] Reading a first parameter modification command from the upgrade template file according to the first parameter modification field;
[0028] Execute the first parameter modification command to modify the parameters of the master node.
[0029] In this embodiment, the parameter modification can be implemented in the master node through the first parameter modification field in the upgrade template file. In the actual implementation process, if the master node needs to modify the parameters, the first parameter modification command can be added after the first parameter modification field, which is simple and easy to implement.
[0030] In one embodiment, the upgrade field includes a second parameter modification field, the upgrade node includes the master node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode includes:
[0031] Reading a second parameter modification command from the upgrade template file according to the second parameter modification field;
[0032] The current node parameters of the master node are rolled back and stored, and the second parameter modification command is executed to modify the node parameters.
[0033] In this embodiment, the second parameter modification field in the upgrade template file can be used to implement parameter modification in the master node, and the current node parameters of the master node can be saved for subsequent rollback. In the actual implementation process, if the master node needs to be modified and the parameter rollback function needs to be implemented, the second parameter modification command can be added after the second parameter modification field, and the implementation method is flexible.
[0034] In one of the embodiments, the upgrade template file is also used to indicate the upgrade sequence of each service in the upgrade node.
[0035] In this embodiment, flexible configuration can be performed according to different upgrade scenarios on site, and flexible upgrade configuration can be performed on some or all nodes in the entire storage system. After the master node reads the upgrade template file, personalized upgrades can be performed according to the upgrade order of each service and different upgrade fields in the upgrade template file.
[0036] In one embodiment, performing software upgrade on the upgrade node according to the upgrade template file includes:
[0037] Performing an environmental check on the storage system;
[0038] If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0039] In this embodiment, the software of the upgrade node is upgraded only after the environment check is passed, so as to avoid data anomalies caused by direct software upgrade in the case of disk degradation or data anomaly alarm, thereby ensuring the safety of the upgrade.
[0040] In one embodiment, the method further comprises:
[0041] In the case where the upgrade node includes the master node and the slave node, in the process of performing software upgrade on the upgrade node according to the upgrade template file, the upgrade status of each upgrade node is recorded, and the upgrade status includes a non-upgraded status, an upgrading status, an upgrade success status, and an upgrade failure status.
[0042] In this embodiment, by recording the upgrade status of each upgrade node, it is convenient to trace back the subsequent upgrade process, and nodes that have failed to upgrade or have not been upgraded can be upgraded again, thereby saving upgrade time.
[0043] In one embodiment, the method further comprises:
[0044] The software of the target node in the upgraded node is re-upgraded, and the upgrade status of the target node is the non-upgraded status and the upgrade failed status.
[0045] When the upgrade fields of some upgraded nodes fail to execute, the developer can trigger the upgrade after troubleshooting. Then, the master node can re-upgrade the software of the target node in the upgrade node. If the upgrade status of the target node is not upgraded or the upgrade fails, there is no need to upgrade the successfully upgraded nodes again, thereby improving the upgrade efficiency.
[0046] In one embodiment, after performing software upgrade on the upgrade node according to the upgrade template file, the method further includes:
[0047] The backup software package in the storage system is replaced according to the software package obtained after the software upgrade, and the backup software package is at least used for node expansion of the storage system.
[0048] This embodiment updates the backup software package and automatically replaces the files in the backup software package, so that the new backup software package can be used when the node is subsequently expanded. This can prevent the software of the newly expanded node from being inconsistent with the software of the upgraded nodes in the cluster when the node is subsequently expanded, saving manpower and improving the reliability of the storage system.
[0049] In a second aspect, the present application provides a software upgrade device, which is arranged in a master node in a storage system, and the device comprises:
[0050] An acquisition module, used to acquire an upgrade template file corresponding to the current upgrade process, wherein the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, wherein the upgrade node includes the master node and / or a slave node in the storage system;
[0051] An upgrade module is used to perform software upgrade on the upgrade node according to the upgrade template file.
[0052] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect are implemented.
[0053] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0054] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect above.
[0055] In the above-mentioned software upgrade method, apparatus, device, readable storage medium and program product, the master node in the storage system obtains the upgrade template file corresponding to the current upgrade process, and the upgrade template file is used to indicate the upgrade node corresponding to the current upgrade process and at least one of the upgrade methods. Then, the master node performs software upgrades on the upgrade nodes according to the upgrade template file. The upgrade nodes include the master node and / or the slave nodes in the storage system. In this way, for each upgrade process, the upgrade template file can be flexibly configured according to the needs of the actual scenario. Different upgrade processes can be configured with their corresponding upgrade nodes and / or upgrade methods, so that they can be well adapted to various scenarios with large personalized differences, thereby improving the upgrade flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] FIG1 is an application environment diagram of a software upgrade method in one embodiment;
[0058] FIG2 is a schematic diagram of a flow chart of a software upgrade method in one embodiment;
[0059] FIG3 is a schematic diagram of a flow chart of step 202 in another embodiment;
[0060] FIG4 is a schematic diagram of a flow chart of a software upgrade method in another embodiment;
[0061] FIG5 is a schematic diagram of a flow chart of a software upgrade method in another embodiment;
[0062] FIG6 is a schematic flow chart of a software upgrade method in another embodiment;
[0063] FIG7 is a structural block diagram of a software upgrading device in one embodiment;
[0064] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0066] In a storage system, when users need to upgrade software on site, if one or more files (such as process files and configuration files) have problems and need to be replaced, the operation and maintenance personnel often manually replace the files on each node. When the cluster size of the storage system is small, this operation can be allowed. However, as the number of nodes in the storage system continues to increase, manual replacement not only increases the risk of operation, but also has low execution efficiency.
[0067] Currently, there are many upgrade methods and strategies, such as full offline upgrade, online upgrade of each node within the node redundancy range, etc. Offline upgrade requires suspension of services on the storage system, which will affect business operations. Online upgrade is to upgrade all software on each node in the storage system, which may upgrade a lot of software that does not need to be upgraded. Moreover, these software upgrade methods all use a fixed upgrade process for software upgrade, which has the problem of poor upgrade flexibility.
[0068] In view of this, embodiments of the present application provide a software upgrade method, apparatus, device, readable storage medium, and program product, which can improve the flexibility of software upgrades.
[0069] In the software upgrade method provided by an embodiment of the present application, in an implementation environment as shown in FIG1 , the storage system shown in the implementation environment includes a master node 102 and multiple slave nodes 104 (slave node 1 to slave node n shown in FIG1 ), and the master node 102 can communicate with each slave node 104 through a network.
[0070] The master node 102 and the multiple slave nodes 104 can be servers, terminals, etc. respectively. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.
[0071] In an exemplary embodiment, as shown in FIG2 , a software upgrade method is provided, which is described by taking the method applied to the master node in FIG1 as an example, and includes the following steps 201 to 202. Among them:
[0072] Step 201, obtaining an upgrade template file corresponding to the current upgrade process, the upgrade template file is used to indicate an upgrade node corresponding to the current upgrade process and at least one of the upgrade methods, the upgrade node includes a master node and / or a slave node in the storage system.
[0073] When a software upgrade is required, the master node obtains the upgrade template file (or patch file template, Patch File template) corresponding to the current upgrade process.
[0074] Optionally, the master node can read the upgrade template file from a preset storage location in the master node; optionally, the master node can also receive upgrade template files sent by other devices / nodes; optionally, the master node can also display a configuration interface, and obtain user input based on the configuration interface, generate an upgrade template file based on the user input, and so on. There is no restriction on the way in which the master node obtains the upgrade template file.
[0075] In an embodiment of the present application, the upgrade template file is used to indicate the upgrade node corresponding to the current upgrade process and at least one of the upgrade methods, and the upgrade node includes a master node and / or a slave node in the storage system.
[0076] Optionally, the upgrade template file is used to indicate the upgrade nodes corresponding to the current upgrade process, for example, indicating the upgrade of all nodes in the storage system (master node and each slave node), or indicating the upgrade of some nodes in the storage system, such as the master node, all slave nodes or some slave nodes, etc. The some nodes can also be the master node and some slave nodes, and so on.
[0077] Optionally, the upgrade template file is used to indicate the upgrade mode corresponding to the current upgrade process. In this case, the upgrade node corresponding to the current upgrade process may be, for example, a default upgrade node, for example, all nodes in the storage system by default.
[0078] Optionally, the upgrade template file is used to indicate the upgrade node and upgrade method corresponding to the current upgrade process.
[0079] Step 202: Perform software upgrade on the upgrade node according to the upgrade template file.
[0080] Optionally, when the upgrade template file is used to indicate the upgrade node corresponding to the current upgrade process, the master node performs software upgrade on the upgrade node indicated by the upgrade template file according to a default upgrade method.
[0081] Optionally, when the upgrade template file is used to indicate the upgrade method corresponding to the current upgrade process, the master node performs software upgrade on the default upgrade node according to the upgrade method indicated by the upgrade template file.
[0082] Optionally, when the upgrade template file is used to indicate the upgrade nodes and upgrade methods corresponding to the current upgrade process, the master node performs software upgrade on the upgrade nodes indicated by the upgrade template file according to the upgrade method indicated by the upgrade template file.
[0083] In this way, the above embodiment can flexibly configure the upgrade template file according to the needs of the actual scenario for each upgrade process. Different upgrade processes can be configured with their corresponding upgrade nodes and / or upgrade methods, so that they can adapt well to various complex scenarios with large personalized differences, thereby improving the upgrade flexibility.
[0084] In one embodiment, based on the embodiment shown in FIG2 , referring to FIG3 , the following is an exemplary introduction to the process of the master node performing software upgrade on the upgrade node according to the upgrade template file. As shown in FIG3 , step 202 includes step 301 and step 302 shown in FIG3 :
[0085] Step 301: for each upgrade field, determine the upgrade method corresponding to the upgrade field.
[0086] In the embodiment of the present application, the upgrade template file includes at least one upgrade field, different upgrade fields correspond to different upgrade methods, and each upgrade field can indicate the upgrade node range corresponding to the upgrade method.
[0087] In this way, after the master node obtains the upgrade template file corresponding to the current upgrade process, it can parse the upgrade template file and identify each upgrade field in the upgrade template file. According to each upgrade field, the upgrade method and upgrade node range corresponding to the upgrade field can be determined. The upgrade node range is, for example, all nodes in the storage system. The upgrade nodes indicated by the characterization upgrade field are the master node and each slave node in the storage system. The upgrade node range is, for example, the master node in the storage system. The upgrade node indicated by the characterization upgrade field is the master node in the storage system.
[0088] Step 302: Perform software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode.
[0089] For each upgrade field, the master node performs software upgrade on the upgrade node indicated by the upgrade field according to the upgrade method indicated by the upgrade field.
[0090] Optionally, the upgrade template file may further configure an upgrade priority for each upgrade field, and the master node may be upgraded in sequence according to the upgrade priority corresponding to each upgrade field.
[0091] Optionally, the master node may randomly select an upgrade field from the upgrade template file each time, and then perform a software upgrade based on the selected upgrade field. After the upgrade is completed, the master node may randomly select an upgrade field from the remaining upgrade fields in the upgrade template file (i.e., the upgrade fields that have not been upgraded in the current upgrade process), and then perform a software upgrade based on the selected upgrade field, until the upgrade is completed based on the upgrade fields in the upgrade template file.
[0092] This embodiment indicates different upgrade methods through various upgrade fields in the upgrade template file, and each upgrade field can indicate the upgrade node range corresponding to the upgrade method. The master node can know the upgrade method and upgrade node range corresponding to the current upgrade process by identifying each field. The implementation method is simple and the computational complexity of the master node is small.
[0093] In the embodiment of the present application, the upgrade template file may include at least one of a script field, a first run field, a second run field, a first parameter modification field, and a second parameter modification field. The following is an exemplary introduction to several possible implementations of the upgrade field.
[0094] It should be noted that the following possible implementation methods of upgrading fields can be combined as needed during actual implementation.
[0095] 1) The upgrade field may include a script field. For example, the script field may be a SCRIPTS field.
[0096] In the case where the upgrade field includes a script field, the upgrade node includes a master node and a slave node, that is, the master node needs to upgrade each node in the storage system. In this way, the master node can implement the process of step 302 by executing the following steps A11 to A13:
[0097] Step A11, determining the service identifier from the upgrade template file according to the script field.
[0098] When configuring the upgrade template file for the current upgrade process, you can add a service identifier after the SCRIPTS field (script field). In this way, the master node can identify the script field in the upgrade template file and read the content added after the script field to obtain the service identifier. The upgrade method indicated by the script field is: replace the file of the service corresponding to the service identifier, such as a binary process file, a configuration file, etc.
[0099] Step A12: According to the service identifier, an upgrade script of the service corresponding to the service identifier is obtained.
[0100] Then, the master node searches for the upgrade script (or replacement script) corresponding to the file according to the service identifier. Exemplarily, the master node can obtain the upgrade script corresponding to the service in a preset storage location according to the service identifier.
[0101] Step A13: According to the upgrade script, the historical script corresponding to the service is upgraded in the master node and the slave node.
[0102] The master node calls the corresponding script to replace the corresponding historical scripts in the upgrade nodes (master nodes and slave nodes) with the upgrade scripts, thereby replacing the files of the corresponding services in the master node and slave nodes.
[0103] Optionally, when the master node upgrades the historical script corresponding to the service in the master node and the slave node according to the upgrade script, the master node can also save the historical script, which can be used as a rollback script for script rollback in case of upgrade failure.
[0104] In this embodiment, the script field in the upgrade template file can be used to easily realize flexible selection of upgrade nodes and flexible selection of services that need to be upgraded. In the actual implementation process, if a service needs to be upgraded, the corresponding service identifier can be added after the script field. The operation is simple and easy to implement.
[0105] 2) The upgrade field may include a first run field. Exemplarily, the first run field may be a RUN field.
[0106] In the case where the upgrade field includes the first run field, the upgrade node includes the master node, that is, the master node needs to upgrade itself. In this way, the master node can implement the process of step 302 by executing the following steps A21 to A22:
[0107] Step A21, reading a first system command from the upgrade template file according to the first operation field, and converting the first system command into a first operation command.
[0108] When configuring the upgrade template file for the current upgrade process, if some upgrade script fields for the master node cannot be implemented (for example, data in memory needs to be written to disk, or preset operations need to be performed on the operating system), it can be implemented through the first run field.
[0109] Exemplarily, a first system command, such as a Linux command, may be added after the RUN field (first run field), so that the master node can identify the first run field in the upgrade template file and read the content added after the first run field to obtain the first system command, and the master node converts the first system command into a first run command, for example, the master node converts the Linux command into a CMD (Command Prompt) command. The upgrade method indicated by the first run field is: converting the first system command into a first run command and executing the first run command.
[0110] Step A22, executing the first operation command.
[0111] The master node executes the first run command locally to upgrade the master node.
[0112] In this embodiment, in the upgrade template file, through the first run field, an upgrade method that cannot be implemented by the script field can be implemented in the main node. In the actual implementation process, if it is necessary to implement some upgrade operations that cannot be implemented by the script field, the first system command can be flexibly added after the first run field, and the upgrade operation can be configured in a targeted manner through the first system command, thereby further improving the upgrade flexibility.
[0113] 3) The upgrade field may include a second run field. Exemplarily, the second run field may be an ALL command.
[0114] In the case where the upgrade field includes the second run field, the upgrade node includes the master node and the slave node, that is, the master node needs to upgrade all nodes in the storage system. In this way, the master node can implement the process of step 302 by executing the following steps A31 to A32:
[0115] Step A31, reading a second system command from the upgrade template file according to the second operation field, and converting the second system command into a second operation command.
[0116] The second run field serves as a supplement to the upgrade node range of the first run field. When configuring the upgrade template file for the current upgrade process, if some upgrade script fields for the master node and the slave node cannot be implemented (for example, the data in the memory needs to be written to the disk, or the operating system needs to be preset), it can be implemented through the second run field.
[0117] Exemplarily, a second system command, such as a Linux command, can be added after the ALL field (second run field). In this way, the master node can identify the second run field in the upgrade template file and read the content added after the second run field to obtain the second system command. The master node converts the second system command into a second run command.
[0118] Step A32, execute the second operation command, and send the second operation command to the slave node, where the second operation command is used by the slave node to execute the second operation command.
[0119] As described above, the second running field serves as a supplement to the upgrade node range of the first running field. The upgrade nodes corresponding to the second running field include the master node and the slave node. Therefore, in addition to executing the second running command locally, the master node also sends the second running command to the slave node for the slave node to execute the second running command.
[0120] In this embodiment, in the upgrade template file, through the second running field, the upgrade method that cannot be achieved by the script field can be implemented in the master node and the slave node. In the actual implementation process, the first running field or the second running field can be configured according to the required upgrade node range to implement some upgrade operations that cannot be achieved by the script field. The upgrade method is flexible and conducive to adapting to various upgrade scenarios.
[0121] 4) The upgrade field may include a first parameter modification field. Exemplarily, the first parameter modification field may be a CLI (Command Line Interface) field.
[0122] In the case where the upgrade field includes the first parameter modification field, the upgrade node includes the master node, that is, the master node needs to upgrade itself. In this way, the master node can implement the process of step 302 by executing the following steps A41 to A42:
[0123] Step A41, reading a first parameter modification command from the upgrade template file according to the first parameter modification field.
[0124] When configuring the upgrade template file for the current upgrade process, if it is necessary to modify the parameters of the master node, a first parameter modification command can be added after the CLI field (first parameter modification field). In this way, the master node can identify the first parameter modification field in the upgrade template file and read the content added after the first parameter modification field to obtain the first parameter modification command. The upgrade method indicated by the first parameter modification field is: execute the first parameter modification command to modify the parameters of the master node.
[0125] Optionally, the first parameter modification field may not allow modification of global parameters by default, that is, the first parameter modification command indicates that the parameter to be modified is not a global parameter.
[0126] Step A42, execute the first parameter modification command to modify the parameters of the master node.
[0127] Next, the master node executes the first parameter modification command locally, thereby modifying the parameters of the master node.
[0128] In this embodiment, the parameter modification can be implemented in the master node through the first parameter modification field in the upgrade template file. In the actual implementation process, if the master node needs to modify the parameters, the first parameter modification command can be added after the first parameter modification field, which is simple and easy to implement.
[0129] 5) The upgrade field may include a second parameter modification field. Exemplarily, the second parameter modification field may be a PARAMETER field.
[0130] In the case where the upgrade node includes the second parameter modification field, the upgrade node includes the master node, that is, the master node needs to upgrade itself, so the master node can implement the process of step 302 by executing the following steps A51 to A52:
[0131] Step A51, reading a second parameter modification command from the upgrade template file according to the second parameter modification field.
[0132] When configuring the upgrade template file for the current upgrade process, if the parameters of the master node need to be modified, and before the parameters are modified, the current node parameters of the master node need to be saved for subsequent rollback, a second parameter modification command can be added after the PARAMETER field (second parameter modification field). In this way, the master node can identify the second parameter modification field in the upgrade template file, and read the content added after the second parameter modification field to obtain the second parameter modification command. The upgrade method indicated by the second parameter modification field is: first, the current node parameters of the master node are rolled back and stored, and then the second parameter modification command is executed to modify the parameters of the master node.
[0133] Step A52, roll back and store the current node parameters of the master node, and execute the second parameter modification command to modify the node parameters.
[0134] In this embodiment, the second parameter modification field in the upgrade template file can be used to implement parameter modification in the master node, and the current node parameters of the master node can be saved for subsequent rollback. In the actual implementation process, if the master node needs to be modified and the parameter rollback function needs to be implemented, the second parameter modification command can be added after the second parameter modification field, and the implementation method is flexible.
[0135] In this way, during the process of the master node performing software upgrade on the upgrade node according to the upgrade template file, if the upgrade fields included in the upgrade template file include the RUN field (first run field), the CLI field (first parameter modification field), and the PARAMETER field (second parameter modification field), the master node only needs to perform software upgrade locally. If the upgrade template file includes the SCRIPTS field (script field) and the ALL field (second run field), the master node needs to perform software upgrade on the node and the slave node.
[0136] Optionally, in an embodiment of the present application, the upgrade template file can also be used to indicate the upgrade order of each service in the upgrade node, so that it can be flexibly configured according to different upgrade scenarios on site, and flexible upgrade configuration can be performed on some or all nodes in the entire storage system. After the master node reads the upgrade template file, it can perform personalized upgrades according to the upgrade order of each service and different upgrade fields in the upgrade template file.
[0137] Optionally, the master node executes each upgrade field in the upgrade template file in sequence. If the execution is successful, it continues to execute the next upgrade field in the upgrade template file. If the execution fails, the upgrade is terminated and an abnormal prompt message is output to prompt the operation and maintenance personnel to conduct troubleshooting.
[0138] As an implementation method, when the upgrade node includes a master node and a slave node, the master node can record the upgrade status of each upgrade node during the process of performing software upgrades on the upgrade nodes according to the upgrade template file, and the upgrade status includes a non-upgraded status, an upgrading status, an upgrade success status, and an upgrade failure status.
[0139] Exemplarily, before the upgrade starts, the master node records each node as "not upgraded status". After the upgrade starts, the master node modifies the upgrade status of the upgrade node that starts the upgrade to "upgrading status" according to the actual upgrade node range. After the upgrade is completed, the master node modifies the upgrade status of the upgrade node to "upgrade success status" or "upgrade failure status" according to the result of the node execution.
[0140] By recording the upgrade status of each upgrade node, it is convenient to trace back the subsequent upgrade process, and nodes that failed to upgrade or were not upgraded can be upgraded again, thus saving upgrade time.
[0141] Exemplarily, during the process of the master node performing software upgrades on the master nodes and slave nodes in the storage system, the master node can output the upgrade results of each upgraded node. When the upgrade fields of some upgraded nodes fail to execute, the developer can trigger the upgrade to continue after troubleshooting. Then, the master node can re-upgrade the software of the target node in the upgrade node. If the upgrade status of the target node is the non-upgraded status and the upgrade failed status, there is no need to upgrade the successfully upgraded nodes again, thereby improving the upgrade efficiency.
[0142] Optionally, the embodiments of the present application also support a rollback process for failed upgrades. In the event of an upgrade interruption (i.e., it is impossible to continue upgrading nodes that have not been upgraded or are being upgraded), the master node may roll back the nodes in the storage system that have been successfully upgraded (such as script file rollback, parameter rollback, etc.) to prevent inconsistency in the message structures of the nodes in the storage system and ensure the reliability of the storage system.
[0143] In one embodiment, based on the embodiment shown in FIG2 , referring to FIG4 , this embodiment relates to a process in which a master node performs an environmental check on a storage system. As shown in FIG4 , step 202 may include steps 401 and 402 shown in FIG4 :
[0144] Step 401: Perform an environmental check on the storage system.
[0145] In an embodiment of the present application, the environmental check includes blocking check items and non-blocking check items. If there is a problem with the blocking check item, it is necessary to first deal with the problem found in the environmental check before the upgrade can continue. If there is a problem with the non-blocking check item, it is necessary to output a corresponding prompt and confirm it with the user before the upgrade can continue.
[0146] Step 402: If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0147] Passing the environmental check can mean that there are no problems corresponding to the blocking check items and the non-blocking check items; or, there are no problems corresponding to the blocking check items, but there are problems corresponding to the non-blocking check items, and the problems corresponding to the non-blocking check items have been confirmed by the customer; or, there are no problems corresponding to the non-blocking check items, but there are problems corresponding to the storage blocking check items, and the problems corresponding to the blocking check items have been resolved. In this way, if the environmental check passes, the master node will perform software upgrades on the upgrade nodes according to the upgrade template file.
[0148] In the embodiment of the present application, the software of the upgrade node will be upgraded only after the environmental check is passed, so as to avoid data anomalies caused by direct software upgrade in the case of disk degradation or data anomaly alarm, thereby ensuring the safety of the upgrade.
[0149] Optionally, when the slave node is a client, if the files of the client-related services are replaced, a prompt message can be output to remind the user that there may be business fluctuations during the client service upgrade to avoid the upgrade process affecting the client's user experience.
[0150] In one embodiment, based on the embodiment shown in FIG2 , referring to FIG5 , this embodiment relates to a process of backing up the software after the upgrade is completed. As shown in FIG5 , the software upgrade method of this embodiment may also include step 501 shown in FIG5 :
[0151] Step 501: Replace the backup software package in the storage system according to the software package obtained after the software upgrade.
[0152] The backup software package is at least used for node capacity expansion of the storage system.
[0153] Exemplarily, the backup software package can be stored in a management node in a storage system. Before the master node updates the backup software package, it can first detect whether the remaining storage space of the management node is sufficient (for example, greater than 10G). The management node will continue to update the backup software package only if it has sufficient storage space. If the management node does not have sufficient storage space, a prompt message can be output to prompt manual intervention in the backup.
[0154] Exemplarily, the master node may decompress the software package, and then compare the position of the patch file in the backup software package in the compressed package to replace it. After the replacement is completed, the new backup software package is recompressed, and the old backup software package is deleted.
[0155] This embodiment updates the backup software package and automatically replaces the files in the backup software package, so that the new backup software package can be used when the node is subsequently expanded. This can prevent the software of the newly expanded node from being inconsistent with the software of the upgraded nodes in the cluster when the node is subsequently expanded, saving manpower and improving the reliability of the storage system.
[0156] In one embodiment, as shown in FIG6 , a software upgrade method is provided, which is applied to the master node in FIG1 , and includes the following steps:
[0157] Step 601, obtaining the upgrade template file corresponding to the current upgrade process.
[0158] The upgrade template file is used to indicate at least one of the upgrade nodes and upgrade methods corresponding to the current upgrade process, and the upgrade nodes include the master node and / or the slave nodes in the storage system.
[0159] Step 602: Perform an environmental check on the storage system.
[0160] Step 603: If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0161] Step 604: Replace the backup software package in the storage system according to the software package obtained after the software upgrade.
[0162] If the environment check fails, the current upgrade process will be exited.
[0163] The following is an example to exemplarily introduce the process in which the master node performs software upgrade on the upgrade node according to the upgrade template file.
[0164] During the upgrade process, the operation and maintenance system will distribute the patch package compressed package to each upgrade node, and the upgrade node will verify the md5 value and decompress it to a fixed path. After the master node obtains the upgrade template file corresponding to the current upgrade process, the upgrade template file includes a script field, and then the master node executes the following steps:
[0165] 1. Determine whether the master node and slave node currently support upgrade (environmental check within the node).
[0166] 2. If the upgrade is supported, call the upgrade script corresponding to the script field to upgrade the master node and the slave node.
[0167] 3. Record the upgrade status of each node during the upgrade process.
[0168] 4. If the upgrade status of each node is successful, it is determined that the current upgrade process is successful.
[0169] 5. Replace the backup software package in the storage system according to the software package obtained after the software upgrade.
[0170] 6. In case of upgrade interruption, call the rollback script to roll back the script of the nodes that have been successfully upgraded.
[0171] 7. During the script rollback process, record the rollback process information and rollback results.
[0172] In general, the embodiments of the present application can flexibly configure the upgrade template file according to the needs of the actual scenario for each upgrade process. Different upgrade processes can be configured with their corresponding upgrade nodes and / or upgrade methods, so as to be well adapted to various complex scenarios with large personalized differences, thereby improving the upgrade flexibility; the automated upgrade and rollback process can reduce manual intervention, reduce the risk of problems introduced by manual operations, and improve the overall upgrade efficiency; the automatic update of the backup software package avoids software inconsistencies caused by subsequent node expansion, and reduces the workload of manual troubleshooting.
[0173] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0174] Based on the same inventive concept, the embodiment of the present application also provides a software upgrade device for implementing the software upgrade method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more software upgrade device embodiments provided below can refer to the limitations on the software upgrade method above, and will not be repeated here.
[0175] In an exemplary embodiment, as shown in FIG7 , a software upgrade device is provided, comprising:
[0176] An acquisition module 701 is used to acquire an upgrade template file corresponding to the current upgrade process, wherein the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, wherein the upgrade node includes the master node and / or a slave node in the storage system;
[0177] The upgrade module 702 is used to perform software upgrade on the upgrade node according to the upgrade template file.
[0178] In one embodiment, the upgrade template file includes at least one upgrade field, and the upgrade module 702 includes:
[0179] a determining unit, configured to determine, for each of the upgrade fields, the upgrade mode corresponding to the upgrade field, wherein different upgrade fields correspond to different upgrade modes;
[0180] An upgrading unit is used to perform software upgrading on the upgrading nodes within the upgrading node range indicated by the upgrading field according to the upgrading mode.
[0181] In one of the embodiments, the upgrade field includes a script field, the upgrade node includes the master node and the slave node, and the upgrade unit is specifically used to determine the service identifier from the upgrade template file according to the script field; obtain the upgrade script of the service corresponding to the service identifier according to the service identifier; and upgrade the historical script corresponding to the service in the master node and the slave node according to the upgrade script.
[0182] In one of the embodiments, the upgrade field includes a first running field, the upgrade node includes the master node, and the upgrade unit is specifically used to read a first system command from the upgrade template file according to the first running field, and convert the first system command into a first running command; and execute the first running command.
[0183] In one embodiment, the upgrade field includes a second run field, the upgrade node includes the master node and the slave node, and the upgrade unit is specifically used to read a second system command from the upgrade template file according to the second run field, and convert the second system command into a second run command; execute the second run command, and send the second run command to the slave node, and the second run command is used by the slave node to execute the second run command.
[0184] In one of the embodiments, the upgrade field includes a first parameter modification field, the upgrade node includes the master node, and the upgrade unit is specifically used to read a first parameter modification command from the upgrade template file according to the first parameter modification field; and execute the first parameter modification command to modify the parameters of the master node.
[0185] In one of the embodiments, the upgrade field includes a second parameter modification field, the upgrade node includes the master node, and the upgrade unit is specifically used to read a second parameter modification command from the upgrade template file according to the second parameter modification field; roll back and store the current node parameters of the master node, and execute the second parameter modification command to modify the node parameters.
[0186] In one of the embodiments, the upgrade template file is also used to indicate the upgrade sequence of each service in the upgrade node.
[0187] In one embodiment, the upgrade module 702 is specifically used to perform an environment check on the storage system; if the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0188] In one embodiment, the device further comprises:
[0189] A recording module is used to record the upgrade status of each upgrade node in the process of performing software upgrade on the upgrade node according to the upgrade template file, when the upgrade node includes the master node and the slave node, and the upgrade status includes a non-upgraded state, an upgrading state, an upgrade success state and an upgrade failure state.
[0190] In one of the embodiments, the upgrade module 702 is used to re-upgrade the software of the target node in the upgrade node, and the upgrade status of the target node is the non-upgraded status and the upgrade failure status.
[0191] In one embodiment, the device further comprises:
[0192] The replacement module is used to replace the backup software package in the storage system according to the software package obtained after the software upgrade, and the backup software package is at least used for node expansion of the storage system.
[0193] Each module in the above software upgrade device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0194] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store software upgrade data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a software upgrade method is implemented.
[0195] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0196] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0197] Acquire an upgrade template file corresponding to the current upgrade process, where the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, where the upgrade node includes the master node and / or a slave node in the storage system;
[0198] Perform software upgrade on the upgrade node according to the upgrade template file.
[0199] In one embodiment, the upgrade template file includes at least one upgrade field, and the processor executes the computer program to specifically implement the following steps:
[0200] For each of the upgrade fields, determining the upgrade mode corresponding to the upgrade field, where different upgrade fields correspond to different upgrade modes;
[0201] According to the upgrade mode, software upgrade is performed on the upgrade nodes within the upgrade node range indicated by the upgrade field.
[0202] In one embodiment, the upgrade field includes a script field, the upgrade node includes the master node and the slave node, and the processor specifically implements the following steps when executing the computer program:
[0203] Determining a service identifier from the upgrade template file according to the script field;
[0204] According to the service identifier, obtaining an upgrade script for the service corresponding to the service identifier;
[0205] According to the upgrade script, the historical script corresponding to the service is upgraded in the master node and the slave node.
[0206] In one embodiment, the upgrade field includes a first run field, the upgrade node includes the master node, and the processor specifically implements the following steps when executing the computer program:
[0207] Reading a first system command from the upgrade template file according to the first operation field, and converting the first system command into a first operation command;
[0208] Execute the first run command.
[0209] In one embodiment, the upgrade field includes a second run field, the upgrade node includes the master node and the slave node, and the processor specifically implements the following steps when executing the computer program:
[0210] reading a second system command from the upgrade template file according to the second operation field, and converting the second system command into a second operation command;
[0211] The second operation command is executed and sent to the slave node, where the second operation command is used by the slave node to execute the second operation command.
[0212] In one embodiment, the upgrade field includes a first parameter modification field, the upgrade node includes the master node, and the processor specifically implements the following steps when executing the computer program:
[0213] Reading a first parameter modification command from the upgrade template file according to the first parameter modification field;
[0214] Execute the first parameter modification command to modify the parameters of the master node.
[0215] In one embodiment, the upgrade field includes a second parameter modification field, the upgrade node includes the master node, and the processor specifically implements the following steps when executing the computer program:
[0216] Reading a second parameter modification command from the upgrade template file according to the second parameter modification field;
[0217] The current node parameters of the master node are rolled back and stored, and the second parameter modification command is executed to modify the node parameters.
[0218] In one embodiment, the upgrade template file is also used to indicate the upgrade sequence of each service in the upgrade node.
[0219] In one embodiment, when the processor executes the computer program, the following steps are specifically implemented:
[0220] Performing an environmental check on the storage system;
[0221] If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0222] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0223] In the case where the upgrade node includes the master node and the slave node, in the process of performing software upgrade on the upgrade node according to the upgrade template file, the upgrade status of each upgrade node is recorded, and the upgrade status includes a non-upgraded status, an upgrading status, an upgrade success status, and an upgrade failure status.
[0224] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0225] The software of the target node in the upgraded node is re-upgraded, and the upgrade status of the target node is the non-upgraded status and the upgrade failed status.
[0226] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0227] The backup software package in the storage system is replaced according to the software package obtained after the software upgrade, and the backup software package is at least used for node expansion of the storage system.
[0228] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0229] Acquire an upgrade template file corresponding to the current upgrade process, where the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, where the upgrade node includes the master node and / or a slave node in the storage system;
[0230] Perform software upgrade on the upgrade node according to the upgrade template file.
[0231] In one embodiment, the upgrade template file includes at least one upgrade field, and when the computer program is executed by the processor, the following steps are specifically implemented:
[0232] For each of the upgrade fields, determining the upgrade mode corresponding to the upgrade field, where different upgrade fields correspond to different upgrade modes;
[0233] According to the upgrade mode, software upgrade is performed on the upgrade nodes within the upgrade node range indicated by the upgrade field.
[0234] In one embodiment, the upgrade field includes a script field, the upgrade node includes the master node and the slave node, and when the computer program is executed by the processor, the following steps are specifically implemented:
[0235] Determining a service identifier from the upgrade template file according to the script field;
[0236] According to the service identifier, obtaining an upgrade script for the service corresponding to the service identifier;
[0237] According to the upgrade script, the historical script corresponding to the service is upgraded in the master node and the slave node.
[0238] In one embodiment, the upgrade field includes a first run field, the upgrade node includes the master node, and when the computer program is executed by a processor, the following steps are specifically implemented:
[0239] Reading a first system command from the upgrade template file according to the first operation field, and converting the first system command into a first operation command;
[0240] Execute the first run command.
[0241] In one embodiment, the upgrade field includes a second run field, the upgrade node includes the master node and the slave node, and when the computer program is executed by the processor, the following steps are specifically implemented:
[0242] reading a second system command from the upgrade template file according to the second operation field, and converting the second system command into a second operation command;
[0243] The second operation command is executed and sent to the slave node, where the second operation command is used by the slave node to execute the second operation command.
[0244] In one embodiment, the upgrade field includes a first parameter modification field, the upgrade node includes the master node, and when the computer program is executed by a processor, the following steps are specifically implemented:
[0245] Reading a first parameter modification command from the upgrade template file according to the first parameter modification field;
[0246] Execute the first parameter modification command to modify the parameters of the master node.
[0247] In one embodiment, the upgrade field includes a second parameter modification field, the upgrade node includes the master node, and when the computer program is executed by a processor, the following steps are specifically implemented:
[0248] Reading a second parameter modification command from the upgrade template file according to the second parameter modification field;
[0249] The current node parameters of the master node are rolled back and stored, and the second parameter modification command is executed to modify the node parameters.
[0250] In one embodiment, the upgrade template file is also used to indicate the upgrade sequence of each service in the upgrade node.
[0251] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:
[0252] Performing an environmental check on the storage system;
[0253] If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0254] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0255] In the case where the upgrade node includes the master node and the slave node, in the process of performing software upgrade on the upgrade node according to the upgrade template file, the upgrade status of each upgrade node is recorded, and the upgrade status includes a non-upgraded status, an upgrading status, an upgrade success status, and an upgrade failure status.
[0256] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0257] The software of the target node in the upgraded node is re-upgraded, and the upgrade status of the target node is the non-upgraded status and the upgrade failed status.
[0258] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0259] The backup software package in the storage system is replaced according to the software package obtained after the software upgrade, and the backup software package is at least used for node expansion of the storage system.
[0260] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0261] Acquire an upgrade template file corresponding to the current upgrade process, where the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, where the upgrade node includes the master node and / or a slave node in the storage system;
[0262] Perform software upgrade on the upgrade node according to the upgrade template file.
[0263] In one embodiment, the upgrade template file includes at least one upgrade field, and when the computer program is executed by the processor, the following steps are specifically implemented:
[0264] For each of the upgrade fields, determining the upgrade mode corresponding to the upgrade field, where different upgrade fields correspond to different upgrade modes;
[0265] According to the upgrade mode, software upgrade is performed on the upgrade nodes within the upgrade node range indicated by the upgrade field.
[0266] In one embodiment, the upgrade field includes a script field, the upgrade node includes the master node and the slave node, and when the computer program is executed by the processor, the following steps are specifically implemented:
[0267] Determining a service identifier from the upgrade template file according to the script field;
[0268] According to the service identifier, obtaining an upgrade script for the service corresponding to the service identifier;
[0269] According to the upgrade script, the historical script corresponding to the service is upgraded in the master node and the slave node.
[0270] In one embodiment, the upgrade field includes a first run field, the upgrade node includes the master node, and when the computer program is executed by a processor, the following steps are specifically implemented:
[0271] Reading a first system command from the upgrade template file according to the first operation field, and converting the first system command into a first operation command;
[0272] Execute the first run command.
[0273] In one embodiment, the upgrade field includes a second run field, the upgrade node includes the master node and the slave node, and when the computer program is executed by the processor, the following steps are specifically implemented:
[0274] reading a second system command from the upgrade template file according to the second operation field, and converting the second system command into a second operation command;
[0275] The second operation command is executed and sent to the slave node, where the second operation command is used by the slave node to execute the second operation command.
[0276] In one embodiment, the upgrade field includes a first parameter modification field, the upgrade node includes the master node, and when the computer program is executed by a processor, the following steps are specifically implemented:
[0277] Reading a first parameter modification command from the upgrade template file according to the first parameter modification field;
[0278] Execute the first parameter modification command to modify the parameters of the master node.
[0279] In one embodiment, the upgrade field includes a second parameter modification field, the upgrade node includes the master node, and when the computer program is executed by a processor, the following steps are specifically implemented:
[0280] Reading a second parameter modification command from the upgrade template file according to the second parameter modification field;
[0281] The current node parameters of the master node are rolled back and stored, and the second parameter modification command is executed to modify the node parameters.
[0282] In one embodiment, the upgrade template file is also used to indicate the upgrade sequence of each service in the upgrade node.
[0283] In one embodiment, when the computer program is executed by a processor, the following steps are specifically implemented:
[0284] Performing an environmental check on the storage system;
[0285] If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
[0286] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0287] In the case where the upgrade node includes the master node and the slave node, in the process of performing software upgrade on the upgrade node according to the upgrade template file, the upgrade status of each upgrade node is recorded, and the upgrade status includes a non-upgraded status, an upgrading status, an upgrade success status, and an upgrade failure status.
[0288] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0289] The software of the target node in the upgraded node is re-upgraded, and the upgrade status of the target node is the non-upgraded status and the upgrade failed status.
[0290] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0291] The backup software package in the storage system is replaced according to the software package obtained after the software upgrade, and the backup software package is at least used for node expansion of the storage system.
[0292] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0293] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0294] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0295] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A software upgrade method, characterized in that: For a master node in a storage system, the method comprises: Acquire an upgrade template file corresponding to the current upgrade process, where the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, where the upgrade node includes the master node and / or a slave node in the storage system; Perform software upgrade on the upgrade node according to the upgrade template file.
2. The method according to claim 1, characterized in that The upgrade template file includes at least one upgrade field, and performing software upgrade on the upgrade node according to the upgrade template file includes: For each of the upgrade fields, determining the upgrade mode corresponding to the upgrade field, where different upgrade fields correspond to different upgrade modes; According to the upgrade mode, software upgrade is performed on the upgrade nodes within the upgrade node range indicated by the upgrade field.
3. The method according to claim 2, characterized in that The upgrade field includes a script field, the upgrade nodes include the master node and the slave node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode, including: Determining a service identifier from the upgrade template file according to the script field; According to the service identifier, obtaining an upgrade script for the service corresponding to the service identifier; According to the upgrade script, the historical script corresponding to the service is upgraded in the master node and the slave node.
4. The method according to claim 2, characterized in that: The upgrade field includes a first running field, the upgrade node includes the master node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode includes: Reading a first system command from the upgrade template file according to the first operation field, and converting the first system command into a first operation command; Execute the first run command.
5. The method according to claim 2, characterized in that: The upgrade field includes a second running field, the upgrade nodes include the master node and the slave node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode includes: reading a second system command from the upgrade template file according to the second operation field, and converting the second system command into a second operation command; The second operation command is executed and sent to the slave node, where the second operation command is used by the slave node to execute the second operation command.
6. The method according to claim 2, characterized in that The upgrade field includes a first parameter modification field, the upgrade node includes the master node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode includes: Reading a first parameter modification command from the upgrade template file according to the first parameter modification field; Execute the first parameter modification command to modify the parameters of the master node.
7. The method according to claim 2, characterized in that The upgrade field includes a second parameter modification field, the upgrade node includes the master node, and performing software upgrade on the upgrade nodes within the upgrade node range indicated by the upgrade field according to the upgrade mode, includes: Reading a second parameter modification command from the upgrade template file according to the second parameter modification field; The current node parameters of the master node are rolled back and stored, and the second parameter modification command is executed to modify the node parameters.
8. The method according to claim 1, characterized in that The upgrade template file is also used to indicate the upgrade sequence of each service in the upgrade node.
9. The method according to claim 1, characterized in that: The performing software upgrade on the upgrade node according to the upgrade template file includes: Performing an environmental check on the storage system; If the environment check passes, the software of the upgrade node is upgraded according to the upgrade template file.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: In the case where the upgrade node includes the master node and the slave node, in the process of performing software upgrade on the upgrade node according to the upgrade template file, the upgrade status of each upgrade node is recorded, and the upgrade status includes a non-upgraded status, an upgrading status, an upgrade success status, and an upgrade failure status.
11. The method according to claim 10, characterized in that After performing software upgrade on the upgrade node according to the upgrade template file, the method further includes: The software of the target node in the upgraded node is re-upgraded, and the upgrade status of the target node is the non-upgraded status and the upgrade failed status.
12. The method according to claim 1, characterized in that After performing software upgrade on the upgrade node according to the upgrade template file, the method further includes: The backup software package in the storage system is replaced according to the software package obtained after the software upgrade, and the backup software package is at least used for node expansion of the storage system.
13. A software upgrade device, characterized in that: A master node is provided in a storage system, and the device comprises: An acquisition module, used to acquire an upgrade template file corresponding to the current upgrade process, wherein the upgrade template file is used to indicate at least one of an upgrade node and an upgrade method corresponding to the current upgrade process, wherein the upgrade node includes the master node and / or a slave node in the storage system; An upgrade module is used to perform software upgrade on the upgrade node according to the upgrade template file.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.