CN110096285B - Deployment method and device of software system, computer equipment and storage medium - Google Patents

Deployment method and device of software system, computer equipment and storage medium Download PDF

Info

Publication number
CN110096285B
CN110096285B CN201910354394.3A CN201910354394A CN110096285B CN 110096285 B CN110096285 B CN 110096285B CN 201910354394 A CN201910354394 A CN 201910354394A CN 110096285 B CN110096285 B CN 110096285B
Authority
CN
China
Prior art keywords
deployment
checksum
resource
file
target node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910354394.3A
Other languages
Chinese (zh)
Other versions
CN110096285A (en
Inventor
李鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN201910354394.3A priority Critical patent/CN110096285B/en
Publication of CN110096285A publication Critical patent/CN110096285A/en
Application granted granted Critical
Publication of CN110096285B publication Critical patent/CN110096285B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention provides a method and a device for deploying a software system, wherein the method comprises the following steps: the method comprises the steps that a deployment request including a target node identification of a software system is responded, and the current deployment resource of a target node corresponding to the target node identification is obtained; processing the deployment resource to obtain a checksum of the deployment resource; inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node; if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource; and if not, deploying the target node according to the deployment resource. Compared with the related art, whether the target node needs to be redeployed according to the corresponding deployment resources is judged by comparing whether the deployment resources deployed twice before and after are consistent, whether the target node needs to be redeployed can be quickly judged based on the deployment mode of the checksum, the deployed file is not required to be backed up every time, the occupied space is small, and the deployment efficiency is high.

Description

Deployment method and device of software system, computer equipment and storage medium
Technical Field
The present invention relates to the field of software deployment technologies, and in particular, to a deployment method and apparatus for a software system, a computer device, and a storage medium.
Background
Large software systems, particularly distributed systems, typically comprise a plurality of nodes, each running a different service. The deployment of a large-scale software system is usually complex, the number of steps is large, each step involves a plurality of nodes, and the situations that the deployment fails or needs to be adjusted for redeployment often occur.
In the related art, some schemes do not judge whether the redeployment of a certain node is needed in a certain step in the redeploying process, and simply repeat the redeployment. When some schemes are redeployed, whether a certain node in a certain step needs to be redeployed or not is judged, and the adopted schemes are as follows:
(1) for the addition and modification of the files, the originally deployed files are backed up during deployment, comparison is carried out during redeployment, and if the modification is consistent, the deployment action is not required to be executed;
(2) and for the executed instruction combination, recording the original instruction combination during deployment, comparing the original instruction combination during redeployment, and if the instruction combinations are consistent, determining that the deployment action is not required to be executed.
The above-mentioned redeployment judgment scheme occupies more disk space on the deployment initiation node, and is generally time-consuming to execute.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
To this end, a first object of the present invention is to propose a method for deploying a software system.
The second purpose of the invention is to provide a deployment device of a software system.
A third object of the invention is to propose a computer device.
A fourth object of the invention is to propose a storage medium.
To achieve the above object, an embodiment of a first aspect of the present invention provides a method for deploying a software system, including:
responding to a deployment request including a target node identifier for a software system, and acquiring the current deployment resource of a target node corresponding to the target node identifier;
processing the deployment resource to obtain a checksum of the deployment resource;
inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node;
if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource;
and if not, deploying the target node according to the deployment resource.
Further, after querying whether a checksum of the last resource deployment of the target node exists in a preset checksum database, the method further includes:
if the preset checksum database does not have the last deployment resource of the target node, deploying the target node according to the current deployment resource;
further, after the determining whether the checksum of the resource deployed this time is consistent with the checksum of the resource deployed last time, the method further includes:
and if the checksum of the deployment resource is consistent with the checksum of the deployment resource at the last time, refusing to deploy the target node according to the deployment resource at the present time.
Further, the deployment resource includes a deployment file and/or an execution instruction;
the processing the deployment resource to obtain the checksum of the deployment resource includes:
when the deployment resource comprises the deployment file, calculating a checksum of the deployment file;
and when the deployment resource comprises the execution instruction, calculating the checksum of the execution instruction.
Further, when the current deployment resource includes the current deployment file, the calculating the checksum of the current deployment file includes:
when the update type of the deployment file is an addition type or a modification type, calculating a checksum of the file content of the deployment file;
and when the update type of the deployment file is the deletion type, calculating the checksum of the full-path file name of the deployment file.
Further, when the current deployment resource includes the current deployment file, calculating a checksum of the current deployment file, further includes:
and when the update type of the deployment file is an addition type or a modification type, calculating the checksum of the full-path file name of the deployment file.
Further, when the current deployment resource includes the current execution instruction, calculating a checksum of the current execution instruction includes:
acquiring a script file recording the execution instruction, and calculating a checksum of file contents of the script file;
and acquiring the environment information corresponding to the current execution instruction, and calculating the checksum of the environment information.
Further, the method further comprises:
and storing the checksum of the deployment resource to the preset checksum database.
In the deployment method of the software system provided by the embodiment of the invention, the deployment resource of the target node corresponding to the target node identifier is acquired by responding to the deployment request including the target node identifier of the software system; processing the deployment resource to obtain a checksum of the deployment resource; inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node; if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource; and if not, deploying the target node according to the deployment resource. Compared with the related art, whether the target node needs to be redeployed according to the corresponding deployment resources is judged by comparing whether the deployment resources deployed twice before and after are consistent, whether the target node needs to be redeployed can be quickly judged based on the deployment mode of the checksum, the deployed file is not required to be backed up every time, the occupied space is small, and the deployment efficiency is high.
In order to achieve the above object, an embodiment of a second aspect of the present invention provides a deployment apparatus for a software system, including:
the system comprises an acquisition module, a deployment module and a management module, wherein the acquisition module is used for responding to a deployment request including a target node identifier of a software system and acquiring the current deployment resource of a target node corresponding to the target node identifier;
the processing module is used for processing the deployment resource to obtain the checksum of the deployment resource;
the query module is used for querying whether the preset checksum database has the checksum of the last resource deployment of the target node;
the judging module is used for judging whether the checksum of the resource deployed at this time is consistent with the checksum of the resource deployed at the last time when the checksum of the resource deployed at the last time of the target node exists in the preset checksum database;
and the deployment module is used for deploying the target node according to the deployment resource when the checksum of the deployment resource is consistent with the checksum of the last deployment resource.
Further, the deployment module is further configured to deploy the target node according to the current deployment resource if the last deployment resource of the target node is not queried in the preset checksum database;
further, the deployment module is further configured to refuse to deploy the target node according to the current deployment resource if the checksum of the current deployment resource is consistent with the checksum of the last deployment resource.
Further, the deployment resource includes a deployment file and/or an execution instruction;
the processing module is specifically configured to:
when the deployment resource comprises the deployment file, calculating a checksum of the deployment file;
and when the deployment resource comprises the execution instruction, calculating the checksum of the execution instruction.
Further, when the current deployment resource includes the current deployment file, the processing module is specifically configured to:
when the update type of the deployment file is an addition type or a modification type, calculating a checksum of the file content of the deployment file;
and when the update type of the deployment file is the deletion type, calculating the checksum of the full-path file name of the deployment file.
Further, when the current deployment resource includes the current deployment file, the processing module is specifically configured to:
and when the update type of the deployment file is an addition type or a modification type, calculating the checksum of the full-path file name of the deployment file.
Further, when the current deployment resource includes the current execution instruction, the processing module is specifically configured to:
acquiring a script file recording the execution instruction, and calculating a checksum of file contents of the script file;
and acquiring the environment information corresponding to the current execution instruction, and calculating the checksum of the environment information.
The deployment device of the software system provided by the embodiment of the invention responds to a deployment request including a target node identifier for the software system, and obtains the current deployment resource of the target node corresponding to the target node identifier; processing the deployment resource to obtain a checksum of the deployment resource; inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node; if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource; and if not, deploying the target node according to the deployment resource. Compared with the related art, whether the target node needs to be redeployed according to the corresponding deployment resources is judged by comparing whether the deployment resources deployed twice before and after are consistent, whether the target node needs to be redeployed can be quickly judged based on the deployment mode of the checksum, the deployed file is not required to be backed up every time, the occupied space is small, and the deployment efficiency is high.
To achieve the above object, an embodiment of a third aspect of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the deployment method of the software system as described above when executing the program.
In order to achieve the above object, a fourth aspect of the present invention provides a storage medium, where instructions of the storage medium, when executed by a processor, implement the deployment method of the software system as described above.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a deployment method of a software system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a deployment apparatus of a software system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a deployment method and apparatus of a software system according to an embodiment of the present invention with reference to the drawings.
Fig. 1 is a schematic flowchart of a deployment method of a software system according to an embodiment of the present invention. The embodiment provides a deployment method of a software system, wherein an execution main body of the deployment method is a deployment device of the software system, and the execution main body is composed of hardware and/or software. The deployment device of the software system may specifically be a hardware device, such as a terminal device, a background server, or the like, or software or an application installed on the hardware device.
As shown in fig. 1, the deployment method of the software system includes the following steps:
s101, responding to a deployment request including a target node identifier of a software system, and acquiring the current deployment resource of the target node corresponding to the target node identifier.
Specifically, the software system includes a plurality of nodes, and each node deploys a corresponding resource to implement different services running on each node.
In the process of deploying a software system, a plurality of deployment actions need to be performed, each involving several nodes. The deployment actions are mainly divided into a file class and an operation class, wherein the deployment actions of the text class are used for updating deployment files on a plurality of nodes, and the updating operations comprise one or more of the following operations: adding, deleting and modifying; the deployment actions of an operation class are, for example, executing execution instructions such as creating a directory, restarting a service, modifying a hostname, synchronizing a host time, etc., on several nodes.
In practical applications, a situation of adjusting deployment may occur, for example, a deployment scheme is changed, a software system needs to be redeployed, and a deployment failure may occur, and the software system also needs to be redeployed.
In this embodiment, the target node may be understood as a node involved in adjusting a deployment scheme or failing to deploy, and the like. For example, the deployment scheme of the target node is adjusted, or a deployment failure occurs when the target node is deployed. When a software system developer redeploys a software system, the software system developer reconfigures the deployment resources of each node. When the deployment device of the software system receives the deployment request, the deployment request is analyzed, the target node identification in the deployment request is obtained, and then the deployment resource of the target node corresponding to the target node identification is obtained.
In this embodiment, the deployment resources of the file class include an addition type deployment file, a modification type deployment file, and a deletion type deployment file.
The added type of deployment file may be understood as a file that needs to be deployed in the node to make the node run the corresponding service. The added types of deployment files are, for example, configuration files, executable files, data files.
The modified deployment file is, for example, a file recording modified contents in a configuration file, an executable file, a data file, and the like. For example, some parameters in the configuration file are modified and adjusted, and the deployment file of the modified type records some parameter values after the configuration file is adjusted.
For another example, there are 3 lines of content for a profile:
key1=value1
key2=value2
key3=value3
when redeploying, a software system developer needs to modify the 2 nd to 3 rd rows of the configuration file, the redeployed deployment resource comprises a modification type deployment file, and the file content of the modification type deployment file is the modified content of the 2 nd to 3 rd rows. When the target node executes the deployment action, the related configuration file is modified correspondingly.
It should be noted that before the deployment file of the original version is modified by the deployment file of the modification type, the deployment file of the original version is transferred to a backup directory, so that when the deployment file of the original version needs to be modified differently in the next deployment, the deployment file of the original version is transferred back from the backup directory.
Wherein, the deployment file of the deletion type can be understood as a file which is no longer required to be deployed on the node. The deployment file of the deletion type is, for example, a configuration file, an executable file, a data file, a modification file, or the like. It should be noted that, when some deployment files are to be deleted in a node, the deployment files to be deleted may be transferred to a backup directory, so that when the deployment files need to be deployed again in the next deployment, the deployment files may be transferred back from the backup target.
S102, processing the deployment resource to obtain the checksum of the deployment resource.
In this embodiment, when the current deployment resource includes the current deployment file, calculating a checksum of the current deployment file; and when the deployment resource comprises the execution instruction, calculating the checksum of the execution instruction. Any one of an SHA1 Algorithm, an SHA256 Algorithm, and an MD5(MD5Message-Digest Algorithm) Algorithm may be used to process the deployment resource this time to obtain the checksum of the deployment resource this time, and of course, the manner of obtaining the checksum of the deployment resource this time is not limited to the above manner. Wherein, SHA1 algorithm and SHA256 algorithm are both secure hash algorithms.
Specifically, when the update type of the deployment file is an addition type or a modification type, calculating a checksum of file contents of the deployment file; and when the update type of the deployment file is the deletion type, calculating the checksum of the full-path file name of the deployment file. It should be noted that when there are a plurality of deployment files, the checksum of the file content of each deployment file needs to be calculated.
For example, when the target node is deployed for the second time, three files are deployed, namely dir1/file1 (addition type), dir2/file2 (deletion type) and dir3/file3 (modification type), at this time, the checksum of the file contents of dir1/file1 is calculated to be 3eade08, the checksum of the full-path file names of dir2/file2 is calculated to be 40bb10d, and the checksum of the file contents of dir3/file3 is calculated to be eedccf. Wherein dir1, dir2 and dir3 are different path names, respectively, and file1, file2 and file3 are different file names, respectively.
It should be noted that, when calculating the checksum of the file content of the deployment file of the add type or the modified type this time, the checksum of the full-path file name of the deployment file of the add type or the modified type this time may also be calculated. For example, the checksum of the full path filename of dir1/file1 (add type) is also computed, and the checksum of the full path filename of dir3/file3 (modify type) is also computed. It should be noted that when there are multiple deployment files, the checksum corresponding to the full-path file name of each deployment file needs to be calculated.
It should be noted that, when the deployed file is a delete-type file, the deployed file corresponding to the delete-type file, which has been deployed in the target node, may be deleted according to the resource identifier of the delete-type file, and the checksum corresponding to the full-path filename of the delete-type file deployed twice before and after the comparison is not required, so it is not necessary to calculate the checksum corresponding to the full-path filename of the delete-type file.
Specifically, when the present deployment resource includes the present execution instruction, calculating the checksum of the present execution instruction includes: acquiring a script file recording the execution instruction, and calculating a checksum of file contents of the script file; and acquiring the environment information corresponding to the current execution instruction, and calculating the checksum of the environment information.
For example, in the present deployment, the target node deploys the deployment actions of the following operation classes:
Figure BDA0002044923690000071
for the deployment action of the operation class, firstly, script files recording each execution instruction are obtained, and the checksum of the file content of each script file is calculated respectively. It should be noted that after the checksum of the file content of the script file of each execution instruction is calculated, the script file corresponding to the execution instruction may be deleted, so as to save the storage space. Next, environment information related to each execution instruction is obtained, and a checksum of the environment information of each execution instruction is calculated, where the related environment information is, for example, an execution path, an environment variable, and the like.
S103, inquiring whether the preset checksum database has the checksum of the last resource deployment of the target node.
In this embodiment, the preset checksum database stores the checksums corresponding to the deployment resources of each node after each historical deployment. And after the deployment is finished, storing the checksum of the deployment resource into a preset checksum database.
Specifically, for the file class deployment action, a corresponding relationship between each node identifier, the deployment frequency identifier of each node, the file class deployment resource update type of each node, the resource identifier of the file class deployment resource of each node, and a checksum (including a checksum of file content and a checksum of a full-path file name) of the file class deployment resource of each node is established and stored in a preset checksum database.
Wherein, the node identifier is, for example, the name of the node; the deployment time identifier is used for representing deployment times, the deployment time identifier is 1 for example, and represents first deployment, and the deployment time identifier is 2 for example, and represents second deployment; the updating types of the file type deployment resources are addition, modification, deletion and the like; the file class deployment resource identification is, for example, a full path filename.
For example, when the target node A is deployed for the first time, file class resources of dir1/file1 (add type) and dir2/file2 (add type) are deployed; when the target node A is deployed for the second time, file class resources are dir1/file1 (addition type), dir2/file2 (deletion type) and dir3/file3 (modification type).
The relevant information of the storage node a in the preset checksum database is shown in table 1. In table 1, the checksum of the full-path filename of the add, modify, or delete type deployment file may or may not be stored. If the checksum of the full-path file names of the added, modified and deleted deployment files is stored, the comparison process of the path names can be accelerated by comparing the checksums of the full-path file names of the deployment files during path name verification.
TABLE 1
Figure BDA0002044923690000081
Specifically, for the operation class deployment action, a corresponding relationship between each node identifier, the deployment frequency identifier of each node, the resource identifier of the operation class deployment resource of each node, and a checksum (including a checksum of the file content and a checksum of the environment information) of the operation class deployment resource of each node is established and stored in a preset checksum database.
Wherein, the node identifier is, for example, the name of the node; the deployment time identifier is used for representing deployment times, the deployment time identifier is 1 for example, and represents first deployment, and the deployment time identifier is 2 for example, and represents second deployment; the file class deployment resource is identified as, for example, the name of the execution instruction.
For example, when the target node a is deployed for the first time, the following operation class deployment actions are also deployed:
mkdir dir1/dir2/dir3// create a directory of deployment actions belonging to the operation class
service restart mon// restart a service, deployment actions belonging to the operation class
When the target node A is deployed for the second time, the following operation class deployment actions are also deployed:
mkdir dir1/dir2/dir3// create a directory of deployment actions belonging to the operation class
service restart mon// restart a service, deployment actions belonging to the operation class
hostnamectl set-hostname myserver// setting host name myserver, and belonging to operation class deployment action
ntpdate 192.168.1.11// use the ntpdate instruction to synchronize time from the time server 192.168.1.11, deployment actions belonging to the operation class
The relevant information of the storage node a in the preset checksum database is shown in table 2.
TABLE 2
Figure BDA0002044923690000091
In this embodiment, if the preset checksum database has the checksum of the last resource deployment of the target node, it is further determined whether the checksum of the current resource deployment is consistent with the checksum of the last resource deployment; if not, the software system developer reconfigures the deployment resource of the target node, and at this time, deploys the target node according to the current deployment resource; if the deployment resources of the target node are consistent with the deployment resources of the target node, the software system developer does not reconfigure the deployment resources of the target node, and at this time, the target node is refused to be deployed according to the deployment resources, that is, the target node is not reconfigured by the deployment.
In this embodiment, if the preset checksum database does not have the checksum of the last resource deployment of the target node, it indicates that the target node is deployed for the first time, and the target node is directly deployed according to the current resource deployment.
And S104, if so, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource.
And S105, if the deployment resources are not consistent, deploying the target node according to the deployment resources.
In this embodiment, when the target node is redeployed, only the relevant checksum of the resource to be deployed this time needs to be compared with the relevant checksum of the resource to be deployed last time stored in the preset checksum, if the checksum changes, the corresponding deployment action is executed in the target node, and if the checksums are consistent, it is indicated that the corresponding deployment action is not redeployed this time, and the target node does not need to be redeployed again according to the corresponding deployment resource.
It should be noted that, if the deployment resource of the target node includes a plurality of deployment files or execution instructions, the checksums of the two previous times and the two subsequent times of each deployment file or execution instruction are respectively compared.
In order to make the deployment method of the software system of the embodiment of the present invention more clear to those skilled in the art, the following description is provided with reference to table 1 and table 2:
for example, when the target node a is deployed for the second time, the relevant checksum of the deployed resource for the second time is calculated, the preset checksum database is queried to obtain the relevant checksum of the deployed resource for the first time, and the target node is deployed according to the comparison result between the relevant checksum of the deployed resource for the second time and the relevant checksum of the deployed resource for the first time.
Through comparative analysis, the checksums of the file contents of the dir1/file1 before and after two times are determined to be different, which indicates that a developer of the software system modifies the file contents of the dir1/file1 during second deployment, and at this time, deploys the dir1/file1 to the target node.
Since the file dir2/file2 is deleted at this time, the deleted file is directly deleted in the target node for the file dir2/file2, and the comparison with the related checksum of the last file dir2/file2 is not needed. For management convenience, after the deployment of the target node is completed, a checksum of the full-path filename of the dir2/file2 may be calculated and stored in a preset checksum database.
Through comparative analysis, the files dir3/file3 of the modification type are deployed at this time but not last time, and at this time, the files dir3/file3 of the modification type are deployed in the target node.
Through comparison and analysis, the checksum of the environment information of the execution instruction of the first creation catalog is determined to be different from the checksum of the environment information of the execution instruction of the second creation catalog, and at the moment, the execution instruction of the second creation catalog is executed on the target node when the second deployment is carried out;
through comparative analysis, the checksum of the host name setting and the host time synchronizing is newly added in the second deployment, and at this time, the execution instruction of the host name setting and the host time synchronizing is executed on the target node in the second deployment.
In the deployment method of the software system provided by the embodiment of the invention, the deployment resource of the target node corresponding to the target node identifier is acquired by responding to the deployment request including the target node identifier of the software system; processing the deployment resource to obtain a checksum of the deployment resource; inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node; if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource; and if not, deploying the target node according to the deployment resource. Compared with the related art, whether the target node needs to be redeployed according to the corresponding deployment resources is judged by comparing whether the deployment resources deployed twice before and after are consistent, whether the target node needs to be redeployed can be quickly judged based on the deployment mode of the checksum, the deployed file is not required to be backed up every time, the occupied space is small, and the deployment efficiency is high.
Fig. 2 is a schematic structural diagram of a deployment apparatus of a software system according to an embodiment of the present invention. The embodiment provides a deployment device of a software system, which is an execution main body of a deployment method of the software system, and the execution main body is composed of hardware and/or software. As shown in fig. 2, the deployment apparatus of the software system includes: the system comprises an acquisition module 11, a processing module 12, an inquiry module 13, a judgment module 14 and a deployment module 15.
The acquiring module 11 is configured to respond to a deployment request including a target node identifier for a software system, and acquire a current deployment resource of a target node corresponding to the target node identifier;
the processing module 12 is configured to process the resource deployment this time to obtain a checksum of the resource deployment this time;
the query module 13 is configured to query whether a preset checksum database has a checksum of the last resource deployment of the target node;
a determining module 14, configured to determine whether a checksum of the resource deployed this time is consistent with a checksum of the resource deployed last time when the checksum of the resource deployed last time of the target node exists in the preset checksum database;
and the deployment module 15 is configured to deploy the target node according to the current deployment resource when the checksum of the current deployment resource is consistent with the checksum of the last deployment resource.
Further, the deployment module 15 is further configured to deploy the target node according to the current deployment resource if the last deployment resource of the target node is not queried in the preset checksum database;
further, the deployment module 15 is further configured to refuse to deploy the target node according to the current deployment resource if the checksum of the current deployment resource is consistent with the checksum of the last deployment resource.
Further, the deployment resource includes a deployment file and/or an execution instruction;
the processing module 12 is specifically configured to:
when the deployment resource comprises the deployment file, calculating a checksum of the deployment file;
and when the deployment resource comprises the execution instruction, calculating the checksum of the execution instruction.
Further, when the deployment resource includes the deployment file, the processing module 12 is specifically configured to:
when the update type of the deployment file is an addition type or a modification type, calculating a checksum of the file content of the deployment file;
and when the update type of the deployment file is the deletion type, calculating the checksum of the full-path file name of the deployment file.
Further, when the current deployment resource includes the current deployment file, the processing module 12 is specifically configured to:
and when the update type of the deployment file is an addition type or a modification type, calculating the checksum of the full-path file name of the deployment file.
Further, when the current deployment resource includes the current execution instruction, the processing module 12 is specifically configured to:
acquiring a script file recording the execution instruction, and calculating a checksum of file contents of the script file;
and acquiring the environment information corresponding to the current execution instruction, and calculating the checksum of the environment information.
It should be noted that the foregoing explanation on the embodiment of the deployment method of the software system is also applicable to the deployment apparatus of the software system of the embodiment, and details are not described here.
The deployment device of the software system provided by the embodiment of the invention responds to a deployment request including a target node identifier for the software system, and obtains the current deployment resource of the target node corresponding to the target node identifier; processing the deployment resource to obtain a checksum of the deployment resource; inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node; if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource; and if not, deploying the target node according to the deployment resource. Compared with the related art, whether the target node needs to be redeployed according to the corresponding deployment resources is judged by comparing whether the deployment resources deployed twice before and after are consistent, whether the target node needs to be redeployed can be quickly judged based on the deployment mode of the checksum, the deployed file is not required to be backed up every time, the occupied space is small, and the deployment efficiency is high.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention. The computer device includes:
memory 1001, processor 1002, and computer programs stored on memory 1001 and executable on processor 1002.
The processor 1002, when executing the program, implements the deployment method of the software system provided in the above-described embodiment.
Further, the computer device further comprises:
a communication interface 1003 for communicating between the memory 1001 and the processor 1002.
A memory 1001 for storing computer programs that may be run on the processor 1002.
Memory 1001 may include high-speed RAM memory and may also include non-volatile memory (e.g., at least one disk memory).
The processor 1002 is configured to implement the deployment method of the software system according to the foregoing embodiment when executing the program.
If the memory 1001, the processor 1002, and the communication interface 1003 are implemented independently, the communication interface 1003, the memory 1001, and the processor 1002 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
Optionally, in a specific implementation, if the memory 1001, the processor 1002, and the communication interface 1003 are integrated on one chip, the memory 1001, the processor 1002, and the communication interface 1003 may complete communication with each other through an internal interface.
The processor 1002 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The present embodiment also provides a storage medium having a computer program stored thereon, wherein the program is configured to implement the deployment method of the software system as described above when executed by a processor.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (18)

1. A method for deploying a software system, comprising:
responding to a deployment request including a target node identifier for a software system, and acquiring the current deployment resource of a target node corresponding to the target node identifier;
processing the deployment resource to obtain a checksum of the deployment resource, wherein the checksum of the deployment resource comprises a checksum of file contents and a checksum corresponding to a full-path file name;
inquiring whether a preset checksum database has a checksum of the last resource deployment of the target node, wherein the preset checksum database stores a checksum corresponding to the deployment resource of each node after each historical deployment, and the checksum corresponding to the deployment resource of each node after each historical deployment comprises a checksum of the file content of the last resource deployment of each node and a checksum corresponding to the full-path file name;
if yes, judging whether the checksum of the current deployment resource is consistent with the checksum of the last deployment resource;
and if not, deploying the target node according to the deployment resource.
2. The method according to claim 1, wherein after querying whether the checksum of the last resource deployed of the target node exists in the preset checksum database, the method further comprises:
and if the preset checksum database does not have the last deployment resource of the target node, deploying the target node according to the current deployment resource.
3. The method according to claim 1, wherein after the determining whether the checksum of the resource deployed this time is consistent with the checksum of the resource deployed last time, the method further includes:
and if the checksum of the deployment resource is consistent with the checksum of the deployment resource at the last time, refusing to deploy the target node according to the deployment resource at the present time.
4. The method according to any one of claims 1 to 3, wherein the current deployment resource includes a current deployment file and/or a current execution instruction;
the processing the deployment resource to obtain the checksum of the deployment resource includes:
when the deployment resource comprises the deployment file, calculating a checksum of the deployment file;
and when the deployment resource comprises the execution instruction, calculating the checksum of the execution instruction.
5. The method according to claim 4, wherein when the deployment resource includes the deployment file, the calculating the checksum of the deployment file includes:
when the update type of the deployment file is an addition type or a modification type, calculating a checksum of the file content of the deployment file;
and when the update type of the deployment file is the deletion type, calculating the checksum of the full-path file name of the deployment file.
6. The method according to claim 4, wherein when the deployment resource includes the deployment file, calculating a checksum of the deployment file further includes:
and when the update type of the deployment file is an addition type or a modification type, calculating the checksum of the full-path file name of the deployment file.
7. The method according to claim 4, wherein the calculating a checksum of the current execution instruction when the current deployment resource includes the current execution instruction includes:
acquiring a script file recording the execution instruction, and calculating a checksum of file contents of the script file;
and acquiring the environment information corresponding to the current execution instruction, and calculating the checksum of the environment information.
8. The method of claim 1, further comprising:
and storing the checksum of the deployment resource to the preset checksum database.
9. An apparatus for deploying a software system, comprising:
the system comprises an acquisition module, a deployment module and a management module, wherein the acquisition module is used for responding to a deployment request including a target node identifier of a software system and acquiring the current deployment resource of a target node corresponding to the target node identifier;
the processing module is used for processing the deployment resource to acquire a checksum of the deployment resource, wherein the checksum of the deployment resource comprises a checksum of file contents and a checksum corresponding to a full-path file name;
the query module is used for querying whether a preset checksum database has a checksum of the last resource deployment of the target node, storing the checksum corresponding to the deployment resource of each node after each historical deployment in the preset checksum database, wherein the checksum corresponding to the deployment resource of each node after each historical deployment comprises a checksum of the file content of the last resource deployment of each node and a checksum corresponding to the full-path file name;
the judging module is used for judging whether the checksum of the resource deployed at this time is consistent with the checksum of the resource deployed at the last time when the checksum of the resource deployed at the last time of the target node exists in the preset checksum database;
and the deployment module is used for deploying the target node according to the deployment resource when the checksum of the deployment resource is consistent with the checksum of the last deployment resource.
10. The apparatus according to claim 9, wherein the deployment module is further configured to deploy the target node according to the current deployment resource if the last deployment resource of the target node is not queried in the preset checksum database.
11. The apparatus according to claim 9, wherein the deployment module is further configured to refuse to deploy the target node according to the current deployment resource if the checksum of the current deployment resource is consistent with the checksum of the last deployment resource.
12. The apparatus according to any one of claims 10 to 11, wherein the current deployment resource includes a current deployment file and/or a current execution instruction;
the processing module is specifically configured to:
when the deployment resource comprises the deployment file, calculating a checksum of the deployment file;
and when the deployment resource comprises the execution instruction, calculating the checksum of the execution instruction.
13. The apparatus according to claim 12, wherein when the current deployment resource includes the current deployment file, the processing module is specifically configured to:
when the update type of the deployment file is an addition type or a modification type, calculating a checksum of the file content of the deployment file;
and when the update type of the deployment file is the deletion type, calculating the checksum of the full-path file name of the deployment file.
14. The apparatus according to claim 12, wherein when the current deployment resource includes the current deployment file, the processing module is specifically configured to:
and when the update type of the deployment file is an addition type or a modification type, calculating the checksum of the full-path file name of the deployment file.
15. The apparatus according to claim 12, wherein when the current deployment resource includes the current execution instruction, the processing module is specifically configured to:
acquiring a script file recording the execution instruction, and calculating a checksum of file contents of the script file;
and acquiring the environment information corresponding to the current execution instruction, and calculating the checksum of the environment information.
16. The apparatus of claim 9, wherein the processing module is further configured to:
and storing the checksum of the deployment resource to the preset checksum database.
17. A computer device, comprising:
memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, implements the method of deploying a software system according to any of claims 1-8.
18. A storage medium on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out a method of deploying a software system according to any one of claims 1 to 8.
CN201910354394.3A 2019-04-29 2019-04-29 Deployment method and device of software system, computer equipment and storage medium Active CN110096285B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910354394.3A CN110096285B (en) 2019-04-29 2019-04-29 Deployment method and device of software system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910354394.3A CN110096285B (en) 2019-04-29 2019-04-29 Deployment method and device of software system, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110096285A CN110096285A (en) 2019-08-06
CN110096285B true CN110096285B (en) 2020-11-27

Family

ID=67446328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910354394.3A Active CN110096285B (en) 2019-04-29 2019-04-29 Deployment method and device of software system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110096285B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312086B (en) * 2021-06-10 2022-08-12 重庆小易智联智能技术有限公司 Software robot system based on instruction set and robot operation method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IN2015DN02307A (en) * 2012-10-01 2015-08-28 Ericsson Telefon Ab L M
CN104679611B (en) * 2015-03-05 2018-03-09 浙江宇视科技有限公司 Data resource clone method and device
CN108696595A (en) * 2018-05-28 2018-10-23 郑州云海信息技术有限公司 Distributed type assemblies method of data synchronization, master node, slave node, system and medium
CN109522029A (en) * 2018-11-22 2019-03-26 山东浪潮云信息技术有限公司 A kind of method and device for disposing cloud platform technology component

Also Published As

Publication number Publication date
CN110096285A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
US8196136B2 (en) Configuration and change management system with restore points
CN107844343B (en) Upgrading system and method for complex server application system
CN111651178A (en) Container configuration updating method and device, computer equipment and storage medium
US20060259594A1 (en) Progressive deployment and maintenance of applications on a set of peer nodes
US10795688B2 (en) System and method for performing an image-based update
CN110166299B (en) SDN controller configuration recovery method and device
CN108810055B (en) Large file transmission method and device
CN106789308B (en) GIS service device with micro-service architecture capable of automatically stretching and retracting and control method thereof
CN111163173A (en) Cluster configuration method and device, server and readable storage medium
CN107391303B (en) Data processing method, device, system, server and computer storage medium
CN110096285B (en) Deployment method and device of software system, computer equipment and storage medium
CN110457114B (en) Application cluster deployment method and device
US20050108704A1 (en) Software distribution application supporting verification of external installation programs
CN110069365B (en) Method for managing database and corresponding device, computer readable storage medium
WO2017198156A1 (en) Service deployment method, apparatus and system
WO2014059156A9 (en) Efficient virtual machine deployment methodology
CN109634638B (en) Cluster software upgrading method, device, equipment and medium
CN110737670A (en) cluster data consistency guarantee method, device and system
CN111258681A (en) BeeGFS service starting method and device
CN111240700A (en) Cross-network-segment server OS deployment system and method
CN110688130A (en) Physical machine deployment method, physical machine deployment device, readable storage medium and electronic equipment
CN115543429A (en) Project environment building method, electronic equipment and computer readable storage medium
CN115686368A (en) Method, system, apparatus and medium for storage capacity expansion of nodes of block chain network
CN111400243B (en) Development management system based on pipeline service and file storage method and device
CN115048238A (en) Node automatic recovery method, device, equipment and medium

Legal Events

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