CN110677308A - Code automatic deployment method - Google Patents
Code automatic deployment method Download PDFInfo
- Publication number
- CN110677308A CN110677308A CN201911073588.2A CN201911073588A CN110677308A CN 110677308 A CN110677308 A CN 110677308A CN 201911073588 A CN201911073588 A CN 201911073588A CN 110677308 A CN110677308 A CN 110677308A
- Authority
- CN
- China
- Prior art keywords
- target machine
- code
- deployment
- server
- main server
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0806—Configuration setting for initial configuration or provisioning, e.g. plug-and-play
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0876—Aspects of the degree of configuration automation
- H04L41/0886—Fully automatic configuration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0889—Techniques to speed-up the configuration process
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a code automatic deployment method, which is characterized in that a main server is responsible for distributing codes, and a target machine is responsible for receiving the codes. The method has the most outstanding advantages that the code can be deployed to any number of target machines according to the requirements only by starting telnet and ftp protocols on the target machines; the method is not limited by an operating system, saves server resources, can improve software deployment efficiency, saves labor cost and greatly reduces error probability.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a code automatic deployment method.
Background
In the internet era, various software products need a convenient and quick version deployment method for occupying market resources, a plurality of software deployment tools exist in the market at present, an automatic deployment method based on a big data cluster becomes one, jenkins is a relatively common code deployment tool, and because the software deployment tool is a tool developed based on java, the preparation work in the early stage is very complicated, manual installation and configuration are needed, and the workload is large and time-consuming.
Therefore, many enterprises develop an automatic deployment system based on a big data platform based on hadoop, although the method can improve the installation speed to a high degree, the system is based on Ambari Blueprint and anchor, vue.js and flash form a front-end configuration interactive interface, Ambari and anchor form a back-end service automatic installation, Jenkins realizes task scheduling and log output, however, the method has a huge workload in the early stage, and includes the processes of cluster building, server configuration, intercommunication among servers, front-end page building and the like, which undoubtedly increases the project cost, and various problems are easily encountered in the installation process to cause the failure of large data cluster installation and deployment.
Disclosure of Invention
The invention aims to provide a code automatic deployment method for solving the problems, the information, the version number and the code to be deployed of a target machine are configured in a main server, and the main server finishes the code deployment work according to a configuration script.
The invention realizes the purpose through the following technical scheme:
a method for automated deployment of code, comprising:
acquiring configuration file information on a main server;
starting a main program on a main server and creating a thread pool;
and respectively creating sub-threads for the target machine according to the read target machine information, putting the sub-threads into a thread pool after the creation is successful, and starting the sub-threads at the same time.
The file information comprises a target machine ip, a port number, a login account number, a version number and a code module to be deployed by the target machine.
The further scheme is that the method further comprises the following steps: after the sub thread is successfully started, the environment of the target machine is checked, specifically:
checking whether the target machine network is normal;
checking whether a telnet protocol of the target machine is started;
and checking whether the ftp protocol of the target machine is started.
The further scheme is that the method further comprises the following steps: when the network, ftp and telnet protocols of the target machine are normal, code deployment is carried out on the target machine, and the method specifically comprises the following steps:
packaging a code module to be deployed by the target machine by using the account information of the target machine in the read configuration file, logging in the target machine, deploying the packaged code module by adopting an ftp (file transfer protocol), and verifying a deployment code by adopting a CRC (cyclic redundancy check) method in the deployment process;
and the deployment result information of the target machine is displayed by the web page.
The invention also provides a code automatic deployment device, which comprises a main server and a plurality of target machines, wherein the code deployment steps are as follows:
detecting whether versions need to be issued or not through the script, configuring a deployment script on the main server, and recording target machine information needing to be deployed;
based on server information in the configured deployment script, telnet is used for remotely logging in a target machine so as to establish TCP connection;
the FTP server is responsible for the transmission of the file under the condition that the TCP connection is established;
a user packs a code to be deployed on a main server, reads server information in a configuration file and a code module to be deployed by the server, is connected to a remote host through telnet, and completes successful deployment of the code on a target machine through an FTP protocol;
and after the code deployment is completed, the target machine sends a mark to the main server, and then the main server closes the connection protocol in corresponding time.
The invention has the beneficial effects that:
the invention relates to a code automatic deployment method, which is characterized in that a main server is responsible for distributing codes (which have ip, ports, version numbers and files to be distributed of all slave servers), and a target machine is responsible for receiving the codes. The code can be deployed to any number of target machines according to the requirements only by starting telnet and ftp protocols on the target machines; the method is not limited by an operating system, saves server resources, can improve software deployment efficiency, saves labor cost and greatly reduces error probability.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the embodiments or the drawings needed to be practical in the prior art description, and obviously, the drawings in the following description are only some embodiments of the embodiments, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a diagram of the device architecture of the present invention.
FIG. 2 is a flowchart of an embodiment of a method for automatically deploying code.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
FIG. 1 is a diagram of the device architecture of the present invention. The system main server is responsible for operating each target machine.
The target machine may be composed of any number of machines.
As shown in FIG. 2, the present invention provides a code automation deployment method, which comprises the following steps:
the main server reads the configuration file config.format.sh, obtains the target machine ip, the port, the login account number, the version number and the code module A, B, C, which needs to send the version, and starts the main program.
A thread pool is started by a main program, a sub-thread 1 is created for a target machine 1.
As shown in FIG. 2, a child thread 1 is created for a target machine 1.
And (4) operating the sub-thread 1, checking whether the network of the target machine 1 can ping, if so, carrying out the next step, and if not, exiting.
The sub-thread 1 checks whether the ftp connection is established on the target machine 1, if so, proceeds to the next step, and if overtime, exits.
And the sub-thread 1 executes the script operation to establish connection by using telnet, detects whether the target machine 1 can be logged in, if so, performs the next step, and if overtime, quits.
And the sub-thread 1 runs a script, uses tcp for reliable transmission, compresses the code according to the code module A distributed by the target machine 1 in the configuration file, and uses CRC to check the code module A so that the code is successfully distributed to the target machine 1 from the code deployment server.
The code deployment result is presented by a web page.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims. It should be noted that the various technical features described in the above embodiments can be combined in any suitable manner without contradiction, and the invention is not described in any way for the possible combinations in order to avoid unnecessary repetition. In addition, any combination of the various embodiments of the present invention is also possible, and the same should be considered as the disclosure of the present invention as long as it does not depart from the spirit of the present invention.
Claims (5)
1. A code automation deployment method is characterized by comprising the following steps:
acquiring configuration file information on a main server;
starting a main program on a main server and creating a thread pool;
and respectively creating sub-threads for the target machine according to the read target machine information, putting the sub-threads into a thread pool after the creation is successful, and starting the sub-threads at the same time.
2. The method for automatically deploying code according to claim 1, wherein the file information comprises a target machine ip, a port number, a login account number, a version number and a code module to be deployed by the target machine.
3. The code automation deployment method of claim 1 further comprising: after the sub thread is successfully started, the environment of the target machine is checked, specifically:
checking whether the target machine network is normal;
checking whether a telnet protocol of the target machine is started;
and checking whether the ftp protocol of the target machine is started.
4. The code automation deployment method of claim 3 further comprising: when the network, ftp and telnet protocols of the target machine are normal, code deployment is carried out on the target machine, and the method specifically comprises the following steps:
packaging a code module to be deployed by the target machine by using the account information of the target machine in the read configuration file, logging in the target machine, deploying the packaged code module by adopting an ftp (file transfer protocol), and verifying a deployment code by adopting a CRC (cyclic redundancy check) method in the deployment process;
and the deployment result information of the target machine is displayed by the web page.
5. A code automatic deployment device is characterized by comprising a main server and a plurality of target machines, wherein the code deployment steps are as follows:
detecting whether versions need to be issued or not through the script, configuring a deployment script on the main server, and recording target machine information needing to be deployed;
based on server information in the configured deployment script, telnet is used for remotely logging in a target machine so as to establish TCP connection;
the FTP server is responsible for the transmission of the file under the condition that the TCP connection is established;
a user packs a code to be deployed on a main server, reads server information in a configuration file and a code module to be deployed by the server, is connected to a remote host through telnet, and completes successful deployment of the code on a target machine through an FTP protocol;
and after the code deployment is completed, the target machine sends a mark to the main server, and then the main server closes the connection protocol in corresponding time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911073588.2A CN110677308A (en) | 2019-11-05 | 2019-11-05 | Code automatic deployment method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911073588.2A CN110677308A (en) | 2019-11-05 | 2019-11-05 | Code automatic deployment method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110677308A true CN110677308A (en) | 2020-01-10 |
Family
ID=69086060
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911073588.2A Pending CN110677308A (en) | 2019-11-05 | 2019-11-05 | Code automatic deployment method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110677308A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111343015A (en) * | 2020-02-18 | 2020-06-26 | 中国银联股份有限公司 | Operation and maintenance method and device for network equipment |
WO2021139261A1 (en) * | 2020-07-27 | 2021-07-15 | 平安科技(深圳)有限公司 | Application deployment method and device, and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1455549A (en) * | 2002-04-30 | 2003-11-12 | 华为技术有限公司 | Method of configuration and upgrade of network apparatus in communication system |
CN105516256A (en) * | 2015-11-27 | 2016-04-20 | 北京锐安科技有限公司 | Batch command operation method and device of Linux host |
CN106385333A (en) * | 2016-09-19 | 2017-02-08 | 努比亚技术有限公司 | Automatic deploying method and system for application program |
CN109542474A (en) * | 2018-10-15 | 2019-03-29 | 广东宝莱特医用科技股份有限公司 | A kind of batch upgrading method of patient monitor firmware |
-
2019
- 2019-11-05 CN CN201911073588.2A patent/CN110677308A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1455549A (en) * | 2002-04-30 | 2003-11-12 | 华为技术有限公司 | Method of configuration and upgrade of network apparatus in communication system |
CN105516256A (en) * | 2015-11-27 | 2016-04-20 | 北京锐安科技有限公司 | Batch command operation method and device of Linux host |
CN106385333A (en) * | 2016-09-19 | 2017-02-08 | 努比亚技术有限公司 | Automatic deploying method and system for application program |
CN109542474A (en) * | 2018-10-15 | 2019-03-29 | 广东宝莱特医用科技股份有限公司 | A kind of batch upgrading method of patient monitor firmware |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111343015A (en) * | 2020-02-18 | 2020-06-26 | 中国银联股份有限公司 | Operation and maintenance method and device for network equipment |
WO2021139261A1 (en) * | 2020-07-27 | 2021-07-15 | 平安科技(深圳)有限公司 | Application deployment method and device, and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8910129B1 (en) | Scalable control system for test execution and monitoring utilizing multiple processors | |
US9720753B2 (en) | CloudSeer: using logs to detect errors in the cloud infrastructure | |
CN102064964B (en) | Method for rapidly switching gigabit network cards in gigabit switching environment | |
US6804773B1 (en) | System and method for transferring information over a network | |
CN106528143A (en) | Configuration management method and device | |
US11461206B2 (en) | Cloud simulation and validation system | |
CN111324412A (en) | Service deployment method, device and storage medium | |
CN110677308A (en) | Code automatic deployment method | |
CN111104139A (en) | Firmware upgrading method, device, equipment and storage medium | |
CN110795105A (en) | Automatic compiling and deploying method and system for power distribution automation master station system | |
CN113127009A (en) | Automatic deployment method and device for big data management platform | |
US8972543B1 (en) | Managing clients utilizing reverse transactions | |
CN112954717A (en) | Household appliance network distribution method and device based on H5 page | |
CN110753363A (en) | Intelligent device wireless debugging system and method | |
CN112328267A (en) | Multi-server installation method and device, terminal and storage medium | |
CN111290766A (en) | Knowledge base-based software batch deployment method and device | |
CN115357258B (en) | Application deployment method and device, storage medium and electronic device | |
CN110213127B (en) | Automated testing system and method fusing virtualization multitasks | |
TWI795312B (en) | Automatic configuration setting system for detection system and method thereof | |
EP4213468A1 (en) | Automated deployment of control nodes at remote locations | |
CN115857955A (en) | Method, device and equipment for offline deployment of K8S cluster and storage medium | |
CN115757185A (en) | Automatic test construction method, device, equipment and storage medium | |
CN117389853A (en) | Chip performance test method and system | |
CN117519734A (en) | Server deployment method and device, storage medium and electronic device | |
CN117591490A (en) | Audit log data processing method, audit log data processing device, audit log data processing equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200110 |
|
RJ01 | Rejection of invention patent application after publication |