CN113282423A - Deployment method, system and computer readable storage medium - Google Patents

Deployment method, system and computer readable storage medium Download PDF

Info

Publication number
CN113282423A
CN113282423A CN202110792385.XA CN202110792385A CN113282423A CN 113282423 A CN113282423 A CN 113282423A CN 202110792385 A CN202110792385 A CN 202110792385A CN 113282423 A CN113282423 A CN 113282423A
Authority
CN
China
Prior art keywords
deployment
target
machine
subfiles
file
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.)
Granted
Application number
CN202110792385.XA
Other languages
Chinese (zh)
Other versions
CN113282423B (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.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software 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 Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202110792385.XA priority Critical patent/CN113282423B/en
Publication of CN113282423A publication Critical patent/CN113282423A/en
Application granted granted Critical
Publication of CN113282423B publication Critical patent/CN113282423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a deployment method, a deployment system and a computer readable storage medium, relating to the technical field of computers, wherein the deployment method is applied to the deployment system, the deployment system comprises an original machine and at least one layer of deployment machine, and each layer of deployment machine comprises a plurality of target machines; under large-scale cluster deployment, an original machine splits a plurality of deployment files according to the number of target machines in a first-layer deployment machine to obtain a plurality of groups of subfiles; each target machine of the first-layer deployment machine only needs to acquire at least one sub-file of the multiple sub-files from the original machine, then performs file synchronization with other target machines on the same layer respectively, finally obtains all the multiple deployment files, and performs deployment operation. Compared with the prior art that the target machine needs to acquire all the deployment files from the original machine at one time, the deployment method, the deployment system and the computer readable storage medium provided by the invention save a large amount of file transmission time and improve the deployment efficiency.

Description

Deployment method, system and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and system for deploying a computer, and a computer-readable storage medium.
Background
As is known, a full deployment mode is selected by a current deployment system or tool, the deployment time of the full deployment mode is long, and particularly, under large-scale cluster deployment, a large amount of time is wasted in the full deployment, which results in low deployment efficiency.
Disclosure of Invention
The invention aims to provide a deployment method, a deployment system and a computer-readable storage medium, so as to improve the deployment efficiency.
In a first aspect, an embodiment of the present invention provides a deployment method, which is applied to a deployment system, where the deployment system includes an original machine and at least one layer of deployment machines, and each layer of deployment machine includes multiple target machines; the deployment method comprises the following steps:
the original machine divides a plurality of deployment files into a plurality of groups of subfiles and respectively sends the subfiles to a plurality of target machines in the first layer of deployment machines; wherein the number of the plurality of groups of subfiles is the same as the number of target machines of the first-layer deployment machine;
after each target machine in the first-layer deployment machine receives at least one group of subfiles, performing file synchronization with other target machines in the first-layer deployment machine respectively to obtain other groups of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the deployment files, performing deployment operation based on the obtained multiple groups of subfiles.
Further, each of the plurality of sets of subfiles includes at least one secondary subfile, respectively; when it is determined that the obtained multiple groups of subfiles are consistent with the multiple deployment files, performing deployment operation based on the obtained multiple groups of subfiles includes:
when the deployment information of each secondary subfile in the at least one secondary subfile is consistent with the deployment information of the corresponding deployment file, determining that the multiple groups of the obtained subfiles are consistent with the deployment files; and performing deployment operation based on the obtained at least one secondary subfile.
Further, the performing a deployment operation based on the obtained at least one secondary subfile includes:
and determining at least one target file to be deployed and the deployment mode of each target file from the obtained at least one secondary subfile according to the obtained deployment information of the at least one secondary subfile, and performing deployment operation of each target file according to the deployment mode.
Further, the deployment information includes basic information and creation time of deployment files, and the determining, from the obtained at least one secondary subfile, at least one target file to be deployed and a deployment mode of each target file include:
for each secondary subfile in the at least one secondary subfile, traversing a current deployment position file list, and when a file with basic information consistent with the basic information of the secondary subfile does not exist, taking the secondary subfile as a target file, wherein the deployment mode of the target file is newly added deployment; alternatively, the first and second electrodes may be,
and when the file with the basic information consistent with the basic information of the secondary subfile and the creation time inconsistent with the creation time of the secondary subfile exists, taking the secondary subfile as a target file, wherein the deployment mode of the target file is replacement deployment.
Further, after the deployment operation of each target file is performed according to the deployment mode, the method further includes:
for each target file, searching a file to be compared at the appointed deployment position of the target file, wherein the basic information of the file to be compared is consistent with the basic information of the target file;
and when the file to be compared is found and the creation time of the target file is consistent with that of the file to be compared, determining that the target file successfully completes the deployment operation.
Further, the method further comprises:
when the target file does not successfully finish the deployment operation, adding one to the deployment frequency of the target file;
when the deployment frequency of the target file is smaller than a preset value, the deployment operation of the target file is carried out again;
and when the deployment frequency of the target file is greater than or equal to the preset value, sending an alarm prompt to a preset control end.
Further, the method further comprises:
and when each target file successfully completes the deployment operation, sending a state modification request to a preset control end, so that the control end modifies the deployment state of the first-layer deployment machine into a successful deployment state according to the state modification request.
In a second aspect, an embodiment of the present invention further provides a deployment system, including an original machine and at least one layer of deployment machines, where each layer of deployment machine includes multiple target machines;
the original machine is used for dividing the deployment files into a plurality of groups of subfiles and respectively sending the subfiles to a plurality of target machines in the first layer of deployment machines; wherein the number of the plurality of groups of subfiles is the same as the number of target machines of the first-layer deployment machine;
each target machine in the first-layer deployment machine is used for respectively carrying out file synchronization with other target machines in the first-layer deployment machine to obtain other groups of subfiles after receiving at least one group of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the deployment files, performing deployment operation based on the obtained multiple groups of subfiles.
Further, each target machine in the first-layer deployment machine is further configured to distribute, as an original machine, the obtained multiple groups of subfiles to the second-layer deployment machine corresponding to the target machine after the deployment operation of the obtained multiple groups of subfiles is completed.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the deployment method in the first aspect is executed.
In the deployment method, the deployment system and the computer-readable storage medium provided by the embodiment of the invention, the deployment method is applied to the deployment system, the deployment system comprises an original machine and at least one layer of deployment machines, and each layer of deployment machine comprises a plurality of target machines; the deployment method comprises the following steps: the original machine divides the deployment files into a plurality of groups of subfiles and respectively sends the subfiles to a plurality of target machines in the first layer of deployment machines; the number of the multiple groups of subfiles is the same as that of the target machines of the first-layer deployment machine; after each target machine in the first layer deployment machine receives at least one group of subfiles, performing file synchronization with other target machines in the first layer deployment machine respectively to obtain other groups of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the multiple deployment files, performing deployment operation based on the obtained multiple groups of subfiles. In this way, under large-scale cluster deployment, the original machine splits the deployment files according to the number of the target machines in the first-layer deployment machine to obtain multiple groups of subfiles. Each target machine of the first-layer deployment machine only needs to acquire at least one sub-file of the multiple sub-files from the original machine, then performs file synchronization with other target machines on the same layer respectively, finally obtains all the multiple deployment files, and performs deployment operation. Compared with the prior art that the target machine needs to acquire all the deployment files from the original machine at one time, the deployment method, the deployment system and the computer-readable storage medium provided by the embodiment of the invention save a large amount of file transmission time and improve the deployment efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic flow chart of a method for deploying a portable electronic device according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating distribution of deployment files in a deployment system according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of another method for deploying a wireless device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a deployment system according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, deployment modes include incremental deployment and full deployment, where incremental deployment refers to only performing deployment operations on files that need to be modified; full deployment refers to deployment operations that are performed on all files, regardless of whether the files are modified. However, whether the deployment system or the tool performs incremental deployment or full deployment, after determining the replacement files that need to be uploaded, all the replacement files are uploaded, and then corresponding deployment operations are completed according to the uploaded replacement files.
For example, when there are A, B, C, D, E, F five files, when the target machine M determines that three files A, B, C need to be incrementally deployed, all three files need to be uploaded to the target machine, and when the target machine receives the three files, the corresponding deployment operation is performed. For another example, when the target machine M determines that the total deployment of A, B, C, D, E, F is needed, all the five files need to be uploaded to the target machine, and when the target machine receives the five files, the corresponding deployment operation is performed.
It can be seen that, in both incremental deployment operations and full deployment operations, all files to be operated need to be uploaded to the target machine, and the deployment time is long because all files need to be uploaded. Particularly, in a large-scale and multi-level cluster deployment system, after the original machine at the previous layer completes deployment operation, all deployment files are sent to each target machine in the deployment machine at the current layer; for example, the incremental deployment described above, then three files are sent A, B, C; or, for example, the above full deployment is performed, A, B, C, D, E, F five files are sent, and then each target machine in the current-layer deployment machine performs corresponding deployment operations; and (4) until all target machines in the deployment system complete deployment operation. When the number of the target machines in each layer is larger as the number of the layers in the cluster deployment system is larger, the time required for transmitting the file in the manner is multiplied, a large amount of time is wasted, and the deployment efficiency is low. Based on this, the deployment method, the deployment system and the computer-readable storage medium provided by the embodiment of the invention can improve the deployment efficiency by saving the file transmission time.
For the purpose of facilitating an understanding of the present embodiments, a method of deploying the disclosed embodiments of the present invention will be described in detail.
The deployment method is applied to a deployment system, as shown in fig. 2, where the deployment system includes an original machine 410 and at least one layer of deployment machines (e.g., a first layer of deployment machines 420 and a second layer of deployment machines 430), and each layer of deployment machines includes a plurality of target machines (e.g., the first layer of deployment machines 420 includes three target machines 421, and the second layer of deployment machines 430 includes two target machines 431). The deployment method can be applied to the financial industry but is not limited to the financial industry, and is particularly suitable for application deployment under large-scale clustering. Referring to the flow chart of a deployment method shown in fig. 1, the deployment method mainly includes the following steps S102 to S104:
and S102, dividing the deployment files into a plurality of groups of subfiles by the original machine, and respectively sending the subfiles to a plurality of target machines in the first-layer deployment machine.
In this embodiment, after completing the deployment operation of the multiple deployment files, the original machine does not issue all the multiple deployment files to each target machine in the first-tier deployment machine, but divides the multiple deployment files into multiple groups of subfiles and sends at least one group of the subfiles to each target machine, where the number of the multiple groups of subfiles may be the same as the number of the target machines of the first-tier deployment machine. For example, as shown in fig. 2, the first-tier deployer 420 includes a target machine a, a target machine B, and a target machine C, and the primal machine divides the plurality of deployed files into 3 groups of subfiles, which are an a-group subfile, a B-group subfile, and a C-group subfile, respectively, and distributes the a-group subfile to the target machine a, the B-group subfile to the target machine B, and the C-group subfile to the target machine C; it should be noted that the correspondence between 3 groups of subfiles and 3 target machines may be changed according to actual requirements, in other embodiments, the a group of subfiles may also be sent to a target machine B or a target machine C, or multiple groups of subfiles may also be sent to the same target machine, for example, the a group of subfiles and the B group of subfiles are sent to the target machine a, the B group of subfiles are sent to the target machine B, and the C group of subfiles are sent to the target machine C, where the sending principle is that each target machine only obtains a required part of the group of subfiles.
The operation mode of dividing the deployment files into a plurality of groups of subfiles comprises the following steps: when the number of the plurality of deployment files is an integral multiple of the number of the target machines, the quotient obtained by dividing the number of the plurality of deployment files by the number of the target machines is the number of the plurality of groups of subfiles. For example, the number of the deployment files is 18, and the number of the target machines is 6, the deployment files are divided into 6 groups of subfiles, and each group comprises 3 subfiles.
The deployment system adopts a hierarchical structure, wherein the hierarchical structure comprises a plurality of layers of deployment machines, and specifically determines which layer of deployment machine is taken as a first layer of deployment machine, and the method comprises the following steps:
in one possible implementation, the most recent layer of deployment machines connected to the original machine may be regarded as the first layer of deployment machines in the hierarchical order. Alternatively, the first and second electrodes may be,
in another possible implementation manner, a target tier may be selected from all tiers as a first tier of deployment machines according to actual needs, and for example, the first tier of deployment machines may be determined according to received user operations. Alternatively, the first and second electrodes may be,
in another possible implementation manner, a hierarchy formed by a plurality of target machines matched with the plurality of deployment files is used as a first-level deployment machine, that is, the plurality of target machines may be from the same hierarchy or different hierarchies. The target machines matched with the deployment files are target machines which need to use all files or part of files in the deployment files for deployment operation, for example, the deployment files are: the target machine m, the target machine n and the target machine p are located in different levels, wherein the target machine m needs deployment operation on all 6 files, the target machine n needs deployment operation on the files 1, 2 and 3, the target machine p needs deployment operation on the files 3, 4 and 5, and the target machine m, the target machine n and the target machine p are first-level deployment machines. It can be seen that the target machines can be selected from the same level or different levels.
Therefore, the plurality of target machines in the first-tier deployer may be all target machines in the same hierarchy or may be part of target machines in different hierarchies. The selection of the partial target machine comprises the following modes:
(1) and determining a required part of the target machines from the plurality of target machines in the first-layer deployment machine according to the matching condition of the plurality of deployment files and the target machines.
(2) And presetting default number, and randomly selecting the default number of target machines from the first-layer deployment machines.
(3) Selecting a target machine with a lower load rate or in an idle state according to the load condition of the target machine; and determining the target machine with lower load rate according to the preset load threshold. For example, the first-tier deployment machine includes 10 target machines, and if the load capacity of 4 target machines of the 10 target machines is lower than a preset threshold or in an idle state, the 4 target machines are selected, and the deployment files are divided into 4 groups of subfiles.
(4) And determining a required part of target machines according to the received selection information.
The method for grouping the deployment files in the original machine comprises the following modes:
in some possible embodiments, the number of the plurality of groups of subfiles is the same as the number of the target machines of the first-layer deployer, if a dependency relationship exists between some of the deployment files, the deployment files with the dependency relationship may be grouped into the same group of subfiles, and the remaining deployment files are grouped according to the corresponding number of the target machines. For example, the number of target machines of the first-layer deployment machine is 3, the deployment files include a secondary subfile 1, a secondary subfile 2, a secondary subfile 3, a secondary subfile 10, wherein the secondary subfile 1, the secondary subfile 2 and the secondary subfile 3 have a dependency relationship, if the number of target machines of the first-layer deployment machine is 3, the secondary subfiles 1 to 3 can be divided into a group of subfiles, the secondary subfiles 4 to 7 can be divided into a group of subfiles, and the secondary subfiles 8 to 10 can be divided into a group of subfiles; if the number of the target machines of the first-layer deployment machine is 2, dividing the secondary subfiles 1 to 5 into a group of subfiles, and dividing the secondary subfiles 6 to 10 into a group of subfiles; or dividing the secondary subfiles 1 to 3 into a group of subfiles, dividing the secondary subfiles 5 to 10 into a group of subfiles, dividing subfiles with dependency relationships into the same group according to a grouping principle, and grouping the subfiles without dependency relationships according to the number of target machines.
In other possible embodiments, the number of the plurality of groups of subfiles is the same as the number of the target machines of the first-tier deployer, the number of the plurality of deployment files is greater than or equal to the number of the target machines of the first-tier deployer, and the plurality of deployment files may be divided into the plurality of groups of subfiles in an evenly-divided manner.
In still other possible embodiments, the number of the plurality of sets of subfiles is different from the number of target machines of the first-tier deployer, and if the number of the plurality of deployment files is smaller than the number of target machines of the first-tier deployer, the plurality of deployment files may not be grouped, that is, each deployment file in the plurality of deployment files is directly regarded as one set of subfiles.
Step S104, after each target machine in the first layer deployment machine receives at least one group of subfiles, performing file synchronization with other target machines in the first layer deployment machine respectively to obtain other groups of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the deployment files, performing deployment operation based on the obtained multiple groups of subfiles.
At least one set of subfiles received by each target machine in the first-layer deployment machine are partial files in the deployment files, so that other sets of subfiles need to be acquired from other target machines. Each target machine can determine other target machines to be subjected to file synchronization based on the stored or received target machine identifications of the other target machines, and perform file synchronization with the other target machines to obtain other groups of subfiles. Each target machine in the first-layer deployment machine can acquire other groups of subfiles from all other target machines, or can acquire other groups of subfiles from partial target machines in other target machines.
For example, if the deployment files include secondary subfiles 1 to 10 and the first-tier deployment machine includes 5 target machines, the deployment files are divided into 5 groups, each group including 2 secondary subfiles. The set of subfiles received by the target machine 1 comprises a secondary subfile 1 and a secondary subfile 2, the set of subfiles received by the target machine 2 comprises a secondary subfile 3 and a secondary subfile 4, the set of subfiles received by the target machine 3 comprises a secondary subfile 5 and a secondary subfile 6, the set of subfiles received by the target machine 4 comprises a secondary subfile 7 and a secondary subfile 8, and the set of subfiles received by the target machine 5 comprises a secondary subfile 9 and a secondary subfile 10. When the target machine 1 determines that other groups of subfiles are to be acquired from the target machine 2 to the target machine 5 respectively, the target machine 2 to the target machine 5 are searched from the hierarchical structure according to the identification of the target machine 2 to the target machine 5, and then the corresponding other groups of subfiles are acquired.
As another example, the plurality of deployment files include secondary subfiles 1 to 10, the first-tier deployment machine includes 5 target machines, a set of subfiles received by the target machine 1 includes secondary subfiles 1 to 4, a set of subfiles received by the target machine 2 includes secondary subfiles 3 to 6, a set of subfiles received by the target machine 3 includes secondary subfiles 5 to 8, a set of subfiles received by the target machine 4 includes secondary subfiles 7 to 10, and a set of subfiles received by the target machine 5 includes secondary subfiles 10, 1 to 3, so that the target machine 1 can obtain other sets of subfiles from the target machine 3 and the target machine 4 and also can obtain other sets of subfiles from the target machine 2 and the target machine 4; the target machine 2 can acquire other group subfiles from the target machine 1 and the target machine 4, and also can acquire other group subfiles from the target machine 4 and the target machine 5; the target machine 3 can acquire other group subfiles from the target machine 1 and the target machine 4, and also can acquire other group subfiles from the target machine 2, the target machine 4 and the target machine 5; the target machine 4 can acquire other group subfiles from the target machine 1 and the target machine 2, can also acquire other group subfiles from the target machine 1 and the target machine 3, and can also acquire other group subfiles from the target machine 2 and the target machine 5; the target machine 5 may acquire other group subfiles from the target machine 2 and the target machine 4, and may also acquire other group subfiles from the target machine 1, the target machine 3, and the target machine 4.
To facilitate understanding of the deployment method, the embodiment of the present invention provides a specific example. Referring to a distribution diagram of deployment files in a deployment system shown in fig. 2, in one possible implementation, the deployment system includes an original machine 410 and a first-tier deployment machine 420; the first-tier deployment machine 420 includes 3 target machines 421 (i.e., a target machine a, a target machine B, and a target machine C), the origin machine 410 divides the deployment files into 3 groups of subfiles (i.e., an a group subfile, a B group subfile, and a C group subfile), and respectively sends the 3 groups of subfiles to the 3 target machines 421 of the first-tier deployment machine 420 (i.e., an a group subfile is distributed to the target machine a, a B group subfile is distributed to the target machine B, and a C group subfile is distributed to the target machine C), and the 3 target machines 421 perform file synchronization between each other, so that each target machine 421 has all the deployment files, and can perform deployment operations and the like.
Further, as shown in fig. 2, the deployment system further includes a second-tier deployer 430 corresponding to the target machine a, where the second-tier deployer 430 includes 2 target machines 431 (i.e., a target machine D and a target machine E), the target machine a, after completing the deployment operation, serves as an original machine, divides the deployment files into 2 groups of subfiles (i.e., a D group subfile and an E group subfile), and sends the 2 groups of deployment files to the 2 target machines 431 of the second-tier deployer 430 (i.e., distributes the D group subfile to the target machine D and distributes the E group subfile to the target machine E), and the 2 target machines 431 perform file synchronization, so that each target machine 431 has all the deployment files, and can perform the deployment operation and the like.
Therefore, the original machine only needs to send at least one group of sub files to each target machine, and each target machine can obtain all the plurality of deployment files in a file synchronization mode. For convenience of understanding, taking as an example that each set of subfiles does not contain the same secondary subfile, the total number of files transmitted by the original machine = the number of files of multiple deployment files; in the prior art, when the target machine acquires all deployment files from the origin machine at one time, the total number of files transmitted by the origin machine = (the number of files of a plurality of deployment files × the number of target machines). For example, the number of the deployed files is 10, the deployed files are divided into 5 groups of subfiles, each group of subfiles includes 2 secondary subfiles, and the original machine sends 5 groups of subfiles to 5 target machines respectively, so that the total number of files transmitted by the original machine in this embodiment is 10, and correspondingly, the total number of files transmitted by the original machine in the prior art is 50. Compared with the prior art, the deployment method greatly reduces the number of file transmission, thereby greatly shortening the file transmission time and improving the deployment efficiency.
According to the deployment method provided by the embodiment of the invention, under large-scale cluster deployment, the original machine splits a plurality of deployment files according to the number of target machines in the first-layer deployment machine to obtain a plurality of groups of subfiles. Each target machine of the first-layer deployment machine only needs to acquire at least one sub-file of the multiple sub-files from the original machine, then performs file synchronization with other target machines on the same layer respectively, finally obtains all the multiple deployment files, and performs deployment operation. Compared with the prior art that the target machine needs to acquire all the deployment files from the original machine at one time, the deployment method saves a large amount of file transmission time and improves deployment efficiency.
Each of the multiple groups of subfiles includes at least one secondary subfile, and each target machine in the first-layer deployment machine may acquire all secondary subfiles in the multiple groups of subfiles or may acquire only a part of secondary subfiles in the multiple groups of subfiles. The same secondary subfiles and different secondary subfiles can be contained in part of different groups of subfiles, so that each target machine in the first-layer deployment machine can only obtain part of the secondary subfiles in the multiple groups of subfiles, and the storage space of the target machine can be greatly saved.
In order to ensure that correct multiple groups of subfiles are obtained, in this embodiment, when each target machine obtains respective multiple groups of subfiles, it is necessary to determine whether the obtained multiple groups of subfiles are accurate, and the specific determination method includes:
and when the obtained deployment information of each secondary subfile in the at least one secondary subfile is consistent with the deployment information of the corresponding deployment file, determining that the obtained multiple groups of subfiles are consistent with the deployment files. For example, if the deployment files include the secondary subfiles 1 to 20, and the 2 groups of subfiles obtained by the target machine m include the secondary subfiles 1 to 10, it is necessary to determine whether the deployment information of each of the secondary subfiles 1 to 10 in the target machine m is consistent with the deployment information of the secondary subfiles 1 to 10 in the original machine, and if so, it is determined that the secondary subfiles 1 to 10 in the target machine m are correct.
The deployment information may include basic information and creation time of the deployment file, the basic information may include a file name, a file size, and a specified deployment location, and the obtained deployment information of the at least one secondary subfile may be stored in a local list of files to be deployed. After a plurality of groups of subfiles (namely at least one secondary subfile) are obtained, the obtained plurality of groups of subfiles can be ensured to be correct by comparing the deployment information with a plurality of deployment files in the original machine.
In some possible embodiments, each target machine in the first-tier deployer may perform the step of performing the deployment operation based on the obtained at least one secondary subfile by: and determining at least one target file to be deployed and the deployment mode of each target file from the obtained at least one secondary subfile according to the obtained deployment information of the at least one secondary subfile, and performing deployment operation of each target file according to the deployment mode.
Further, in a possible implementation manner, when determining the target file and the deployment manner thereof, the deployment information of each secondary subfile in the at least one secondary subfile may be determined by traversing a local file list to be deployed, where the deployment information includes basic information and creation time; then, for each secondary subfile in at least one secondary subfile, traversing a current deployment position file list, and when a file with basic information consistent with the basic information of the secondary subfile does not exist, taking the secondary subfile as a target file, wherein the deployment mode of the target file is newly added deployment; and when the file with the basic information consistent with the basic information of the secondary subfile and the creation time inconsistent with the creation time of the secondary subfile exists, taking the secondary subfile as a target file, wherein the deployment mode of the target file is replacement deployment. For example, for the secondary subfile 1, when a file which is consistent with the file name, the file size and the specified deployment position of the secondary subfile 1 is not found in the current deployment position file list, the secondary subfile 1 is used as a target file, and the deployment mode is newly added deployment; for another example, for the secondary subfile 2, when a file whose file name, file size, and specified deployment location are all consistent with those of the secondary subfile 2 and whose creation time is inconsistent with that of the secondary subfile 2 is found in the current deployment location file list, the secondary subfile 2 is taken as a target file, and its deployment mode is replacement deployment.
It should be noted that, when there is a file whose basic information is consistent with the basic information of the secondary subfile and whose creation time is also consistent with the creation time of the secondary subfile, it indicates that the current target machine has completed the deployment of the secondary subfile, and the deployment of the secondary subfile is not performed at this time, so that the deployment efficiency can be improved.
Further, in one possible implementation, the deployment operation is performed on the target file by the following process:
when the deployment mode of the target file is newly added deployment, the target file can be uploaded to the appointed deployment position of the target file, and the newly added deployment operation is completed;
when the deployment mode of the target file is replacement deployment, the target file can be uploaded to the specified deployment position of the target file, and the old file stored in the specified deployment position is replaced, so that the replacement deployment operation is completed. The old file is a file whose basic information is consistent with that of the secondary subfile and whose creation time is inconsistent with that of the secondary subfile.
According to the deployment method provided by the embodiment of the invention, under large-scale cluster deployment, each target machine of the first-layer deployment machine only needs to acquire at least one group of subfiles from the original machine, namely, all the deployment files can be acquired by carrying out file synchronization with other target machines in the first-layer deployment machine, and deployment operation is carried out.
Further, after each target file is deployed, in order to ensure that the deployment is correct, whether each target file is deployed successfully (i.e., whether each target file completes the deployment operation successfully) may be checked according to the file creation time, in a specific manner as follows:
for each target file, searching a file to be compared at the appointed deployment position of the target file, wherein the basic information of the file to be compared is consistent with the basic information of the target file; when the file to be compared is found and the creation time of the target file is consistent with that of the file to be compared, determining that the target file successfully completes deployment operation; and when the file to be compared is not found or the creation time of the target file is inconsistent with the creation time of the file to be compared, determining that the target file does not successfully complete the deployment operation. Specifically, when the target file is correctly deployed, a file with basic information and creation time consistent with those of the target file exists at the specified deployment position of the target file, and the file is a file to be compared under correct deployment; for the newly added deployment, when the target file is not deployed correctly, at the specified deployment position of the target file, a file with the basic information consistent with that of the target file does not exist, namely, a file to be compared does not exist at the moment; for the replacement deployment, when the target file is not deployed correctly, at the specified deployment position of the target file, a file exists in which the basic information is consistent with the basic information of the target file, and the creation time is inconsistent with the creation time of the target file, the file is a to-be-compared file which is not deployed correctly, and the to-be-compared file can be a deployment file which is deployed at the specified deployment position last time.
Further, the method further comprises: for each target file, when the target file does not successfully finish the deployment operation, adding one to the deployment times of the target file; when the deployment frequency of the target file is smaller than a preset value, the deployment operation of the target file is carried out again; and when the deployment frequency of the target file is greater than or equal to a preset value, sending an alarm prompt to a preset control end. The preset value may be set according to actual requirements, and is not limited herein. For example, if the preset value is 3, after a certain target file is deployed for 3 times, when it is checked that the target file has not yet successfully completed the deployment operation, an alarm prompt is sent to a preset management and control end, and the target file is manually processed. Therefore, the staff can find the deployment problem in time through the control end.
Further, in order to facilitate the staff to know the deployment state, the method further includes: and when each target file successfully completes the deployment operation, sending a state modification request to a preset control end, so that the control end modifies the deployment state of the first-layer deployment machine into a successful deployment state according to the state modification request. Therefore, the staff can know the deployment state of each layer of deployment machine through the control end.
For easy understanding, another deployment method is further provided in the embodiment of the present invention, as shown in fig. 3, the step of performing the deployment operation based on the obtained at least one secondary subfile may be subdivided into the following steps S302 to S318:
step S302, a local deployment file list needing to be deployed is checked. The deployment information of each of the at least one secondary subfile that needs to be deployed can be confirmed through step S302.
Step S304, determining the target file to be deployed and the deployment mode thereof. When the deployment mode is the newly added deployment, executing step S306; when the deployment mode is the replacement deployment, step S308 is executed.
And step S306, uploading the newly added file. After the addition is completed, the process goes to step S310.
And step S308, uploading the replacement file and replacing the file. After the replacement is completed, the process goes to step S310.
Step S310, whether the deployment is successful is checked according to the creation time. When the deployment is successful (i.e., the deployment operation is successfully completed), step S312 is performed; when the deployment is not successful (i.e., the deployment operation is not successfully completed), step S314 is performed.
In step S312, it is confirmed that the deployment procedure is completed.
Step S314, add one to the deployment times.
Step S316, determining whether the deployment frequency is less than a preset value. When the judgment result is yes, re-executing the step S302; when the determination result is no, step S318 is executed.
And step S318, sending alarm reminding to the control end.
Corresponding to the deployment method, an embodiment of the present invention further provides a deployment system, and referring to a schematic structural diagram of a deployment system shown in fig. 4, the deployment system includes an original machine 410 and at least one layer of deployment machines, each layer of deployment machines includes a plurality of target machines, where the original machine 410 is respectively connected to a plurality of target machines 421 in a first layer of deployment machines 420, and each target machine 421 is interconnected with each other;
the original machine 410 is configured to divide the deployment files into multiple groups of subfiles, and send the subfiles to multiple target machines 421 in the first-tier deployment machine 420;
after each target machine 421 in the first-tier deployment machine 420 receives at least one group of subfiles, performing file synchronization with other target machines 421 in the first-tier deployment machine 420 respectively to obtain other groups of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the multiple deployment files, performing deployment operation based on the obtained multiple groups of subfiles.
Alternatively, the number of the plurality of groups of subfiles may be the same as the number of target machines of the first-tier deployment machine 420.
Further, the deployment system is a hierarchical structure, and files can be rapidly deployed on a huge number of machines by adopting a multi-center distribution technology. Based on this, as shown in fig. 4, the target machine 421 in the first-tier deployer 420 is further connected to a plurality of target machines 431 of the second-tier deployer 430 corresponding to the target machine 421, and the target machine 421 is further configured to distribute, as an original machine, the obtained plurality of sets of sub-files to the second-tier deployer 430 corresponding to the target machine 421 after completing the deployment operation of the obtained plurality of sets of sub-files. The target machine 421 in the first-tier deployment machine 420 serving as an original machine means that the target machine 421 distributes a plurality of deployment files in a distribution manner of the original machine.
It should be noted that, the deployment system may have more than two layers of deployment machines, and each target machine in the previous layer of deployment machines may serve as an original machine to distribute the deployment file to the next layer of deployment machines corresponding to the original machine.
The deployment system provided by the embodiment of the invention can rapidly deploy the files on a huge number of machines by the multi-center distribution technology.
The implementation principle and the generated technical effect of the deployment system provided by this embodiment are the same as those of the deployment method embodiment described above, and for brief description, reference may be made to corresponding contents in the deployment method embodiment described above where no part of the deployment system embodiment is mentioned.
Corresponding to the deployment method, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the deployment method described in the foregoing method embodiment. The computer-readable storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RAM, a magnetic disk, or an optical disk.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not as a limitation, and thus other examples of example embodiments may have different values.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the several embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other ways.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The deployment method is applied to a deployment system, wherein the deployment system comprises an original machine and at least one layer of deployment machines, and each layer of deployment machines comprises a plurality of target machines; the deployment method comprises the following steps:
the original machine divides a plurality of deployment files into a plurality of groups of subfiles and respectively sends the subfiles to a plurality of target machines in the first layer of deployment machines; wherein the number of the plurality of groups of subfiles is the same as the number of target machines of the first-layer deployment machine;
after each target machine in the first-layer deployment machine receives at least one group of subfiles, performing file synchronization with other target machines in the first-layer deployment machine respectively to obtain other groups of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the deployment files, performing deployment operation based on the obtained multiple groups of subfiles.
2. The deployment method of claim 1, wherein each of the plurality of sets of subfiles comprises at least one secondary subfile; when it is determined that the obtained multiple groups of subfiles are consistent with the multiple deployment files, performing deployment operation based on the obtained multiple groups of subfiles includes:
when the deployment information of each secondary subfile in the at least one secondary subfile is consistent with the deployment information of the corresponding deployment file, determining that the multiple groups of the obtained subfiles are consistent with the deployment files; and performing deployment operation based on the obtained at least one secondary subfile.
3. The deployment method according to claim 2, wherein the performing deployment operations based on the obtained at least one secondary subfile comprises:
and determining at least one target file to be deployed and the deployment mode of each target file from the obtained at least one secondary subfile according to the obtained deployment information of the at least one secondary subfile, and performing deployment operation of each target file according to the deployment mode.
4. The deployment method according to claim 3, wherein the deployment information includes basic information and creation time of a deployment file, and the determining of at least one target file to be deployed from the obtained at least one secondary subfile and the deployment mode of each target file include:
for each secondary subfile in the at least one secondary subfile, traversing a current deployment position file list, and when a file with basic information consistent with the basic information of the secondary subfile does not exist, taking the secondary subfile as a target file, wherein the deployment mode of the target file is newly added deployment; alternatively, the first and second electrodes may be,
and when the file with the basic information consistent with the basic information of the secondary subfile and the creation time inconsistent with the creation time of the secondary subfile exists, taking the secondary subfile as a target file, wherein the deployment mode of the target file is replacement deployment.
5. The deployment method according to claim 4, wherein after the deployment operation of each of the target files is performed according to the deployment manner, the method further comprises:
for each target file, searching a file to be compared at the appointed deployment position of the target file, wherein the basic information of the file to be compared is consistent with the basic information of the target file;
and when the file to be compared is found and the creation time of the target file is consistent with that of the file to be compared, determining that the target file successfully completes the deployment operation.
6. The deployment method of claim 5, further comprising:
when the target file does not successfully finish the deployment operation, adding one to the deployment frequency of the target file;
when the deployment frequency of the target file is smaller than a preset value, the deployment operation of the target file is carried out again;
and when the deployment frequency of the target file is greater than or equal to the preset value, sending an alarm prompt to a preset control end.
7. The deployment method of claim 5, further comprising:
and when each target file successfully completes the deployment operation, sending a state modification request to a preset control end, so that the control end modifies the deployment state of the first-layer deployment machine into a successful deployment state according to the state modification request.
8. The deployment system is characterized by comprising an original machine and at least one layer of deployment machines, wherein each layer of deployment machine comprises a plurality of target machines;
the original machine is used for dividing the deployment files into a plurality of groups of subfiles and respectively sending the subfiles to a plurality of target machines in the first layer of deployment machines; wherein the number of the plurality of groups of subfiles is the same as the number of target machines of the first-layer deployment machine;
each target machine in the first-layer deployment machine is used for respectively carrying out file synchronization with other target machines in the first-layer deployment machine to obtain other groups of subfiles after receiving at least one group of subfiles; and when the obtained multiple groups of subfiles are determined to be consistent with the deployment files, performing deployment operation based on the obtained multiple groups of subfiles.
9. The deployment system of claim 8, wherein each target machine of the first-tier deployer is further configured to distribute, as an original machine, the obtained multiple sets of subfiles to the second-tier deployer corresponding to the target machine after completing the deployment operation of the obtained multiple sets of subfiles.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the deployment method of any one of claims 1-7.
CN202110792385.XA 2021-07-14 2021-07-14 Deployment method, system and computer readable storage medium Active CN113282423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110792385.XA CN113282423B (en) 2021-07-14 2021-07-14 Deployment method, system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110792385.XA CN113282423B (en) 2021-07-14 2021-07-14 Deployment method, system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113282423A true CN113282423A (en) 2021-08-20
CN113282423B CN113282423B (en) 2021-11-16

Family

ID=77286785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110792385.XA Active CN113282423B (en) 2021-07-14 2021-07-14 Deployment method, system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113282423B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937909A (en) * 2012-11-21 2013-02-20 上海爱数软件有限公司 Method for deploying and upgrading Linux system
CN103324538A (en) * 2013-05-23 2013-09-25 国家电网公司 Method for designing dislocated scattered cluster environment distributed concurrent processes
CN104615466A (en) * 2015-02-05 2015-05-13 广州亦云信息技术有限公司 Cloud platform deployment method and system
CN107908406A (en) * 2017-11-24 2018-04-13 四川文轩教育科技有限公司 The method that web project penetrability automatically updates deployment
CN109379448A (en) * 2018-12-27 2019-02-22 深圳市网心科技有限公司 A kind of file distribution dispositions method, device, electronic equipment and storage medium
CN111767331A (en) * 2020-06-17 2020-10-13 北京思特奇信息技术股份有限公司 Multitask visual activation method of million-magnitude data in relational database
CN112882748A (en) * 2021-03-04 2021-06-01 中国航空工业集团公司西安航空计算技术研究所 Image file management and batch deployment tool of embedded system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937909A (en) * 2012-11-21 2013-02-20 上海爱数软件有限公司 Method for deploying and upgrading Linux system
CN103324538A (en) * 2013-05-23 2013-09-25 国家电网公司 Method for designing dislocated scattered cluster environment distributed concurrent processes
CN104615466A (en) * 2015-02-05 2015-05-13 广州亦云信息技术有限公司 Cloud platform deployment method and system
CN107908406A (en) * 2017-11-24 2018-04-13 四川文轩教育科技有限公司 The method that web project penetrability automatically updates deployment
CN109379448A (en) * 2018-12-27 2019-02-22 深圳市网心科技有限公司 A kind of file distribution dispositions method, device, electronic equipment and storage medium
CN111767331A (en) * 2020-06-17 2020-10-13 北京思特奇信息技术股份有限公司 Multitask visual activation method of million-magnitude data in relational database
CN112882748A (en) * 2021-03-04 2021-06-01 中国航空工业集团公司西安航空计算技术研究所 Image file management and batch deployment tool of embedded system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄巨涛等: "基于Ansible的电力云平台自动部署***设计", 《电子设计工程》 *

Also Published As

Publication number Publication date
CN113282423B (en) 2021-11-16

Similar Documents

Publication Publication Date Title
US8666955B2 (en) Data management method and data management system
CN101855620B (en) Data processing apparatus and method of processing data
CN103324552B (en) Two benches list example duplicate removal data back up method
CN111818112B (en) Kafka system-based message sending method and device
CN102707990B (en) Container based processing method and device
US6675180B2 (en) Data updating apparatus that performs quick restoration processing
CN102156751A (en) Method and device for extracting video fingerprint
CN104714811A (en) Method and device for manufacturing difference upgrade package and system difference upgrade method and device
CN103858125B (en) Repeating data disposal route, device and memory controller and memory node
CN105550225A (en) Index construction method and query method and apparatus
CN103473076A (en) Issuing method and issuing system for code version
CN113626250B (en) Stripe merging method and system based on erasure codes
CN107016075A (en) Company-data synchronous method and device
CN113609090B (en) Data storage method and device, computer readable storage medium and electronic equipment
CN113282423B (en) Deployment method, system and computer readable storage medium
US20160203032A1 (en) Series data parallel analysis infrastructure and parallel distributed processing method therefor
WO2015116040A1 (en) Data migration
CN111414339B (en) File processing method, system, device, equipment and medium
CN114089924B (en) Block chain account book data storage system and method
CN112346771A (en) Upgrade file generation method and device
CN116089527A (en) Data verification method, storage medium and device
CN110908835B (en) Data redundancy method and system supporting private label in distributed system
CN114706526A (en) Automatic capacity expansion method, system and equipment for cloud native storage data volume
CN103678545A (en) Network resource clustering method and device
CN114138711A (en) File migration method and device, storage medium and electronic equipment

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