Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, embodiment 1 of the present invention provides a method for managing remote deployment of software, hereinafter referred to as the present method, comprising the following steps:
s1, acquiring a configuration file of software to be installed, and acquiring parameters to be configured and an installation script of the software to be installed according to the configuration file;
s2, generating a parameter configuration interface according to the parameters to be configured, and acquiring configuration parameters input by a user through the parameter configuration interface;
s3, the configuration parameters are transmitted into the installation script, and the installation script is remotely executed on a host to be deployed to realize software deployment;
s4, in the process of executing the installation script, acquiring an installation log of the host to be deployed, and transmitting the installation log into an installation page for display.
The configuration files contain the installation script, and the embodiment of the invention obtains the installation script by obtaining the configuration files, so that the software deployment can be completed by directly executing the installation script remotely without executing the operating system script, and the automatic deployment of different software can be realized by only obtaining the configuration files of different software. The installation script may be a script such as shell, powershell, ansible. Meanwhile, a parameter configuration interface is generated after the configuration file is acquired, configuration parameters input by a user are acquired through the parameter configuration interface, and then the configuration parameters are transmitted into the installation script, so that automatic parameter configuration of the installation script is realized, the configuration file is not required to be manually modified, and meanwhile, a configurable parameter and a setting function are provided for each deployment project, so that various deployment projects can conveniently define own deployment parameters, and the method is suitable for deployment of different general software. Preferably, a customized parameter configuration interface is provided for each piece of software, so that user experience is improved. Meanwhile, the installation log is obtained in the remote installation process, and is displayed, so that deployment personnel can know the installation progress in real time, follow up the installation process, and the deployment personnel can analyze and process the possible deployment problems in time.
The invention adopts Devops concept and tool to realize rapid software delivery on the remote host to be deployed, so that the deployment and delivery process of various software products can be carried out strict pipeline test deployment by the method and then completely consistent production deployment is carried out on the site of a customer. Meanwhile, a WEB configuration interface obtained by the user is provided, and the complex delivery process is simplified into operations such as deployment configuration, deployment execution and the like, so that a common technician can also rapidly complete software delivery work of a complex system. The method supports dynamic adjustment of configuration parameters before deployment, and various personalized deployment works are completed based on the parameters in the deployment process.
Specifically, the configuration file is a YML configuration file.
The YML profile is a specific format profile describing basic information of software to be installed, installation and deletion scripts, parameters to be configured, and the like.
Preferably, the configuration file of the software to be installed is obtained, specifically:
and establishing a software warehouse, and acquiring a configuration file of the software to be installed from the software warehouse.
The software warehouse is established, and the configuration file is obtained from the software warehouse, so that remote software deployment does not need to be connected to the internet, software deployment work can be finished offline in a private cloud environment, and the method is suitable for various delivery scenes. And acquiring configuration files of all the software in the software warehouse, and acquiring basic information of the software from the configuration files, so as to generate an installable software list, thereby facilitating the selection and installation of a user.
Preferably, a parameter configuration interface is generated according to the parameter to be configured, and the configuration parameters input by the user are obtained through the parameter configuration interface, and the method further comprises:
generating a host configuration interface, and acquiring a host to be deployed input by a user through the host configuration interface, wherein software deployment is realized on the host to be deployed, and at least one host to be deployed is provided.
The method supports the deployment and delivery of various single machine software or cluster software, and supports the deployment of the single machine software on a single host, such as an API gateway and a resource directory system; and cluster software, such as a container cloud platform, a big data processing platform, a cloud database system, a distributed storage platform and the like, is rapidly deployed on a plurality of hosts, so that the difficulty of delivering and maintaining complex cluster software is greatly reduced. Specifically, the parameters to be configured comprise hosts to be deployed, a host configuration interface is generated, a plurality of hosts to be deployed which need to be deployed are obtained, and then installation scripts are remotely executed on the hosts to be deployed respectively, so that batch deployment of cluster software is realized. Of course, when configuring the host to be deployed, various hosts to be deployed need to be registered and registered, various modes such as manual registration, batch file registration, API registration, remote registration and the like can be adopted, and IAAS interface plug-ins can be integrated, so that automatic issuing and registration of the host under the IAAS platform can be realized, and when configuring the host to be deployed, the registration ID of the host to be deployed can be input.
Preferably, the configuration parameters are transmitted into an installation script, specifically:
and transmitting the configuration parameters into the installation script in a temporary environment variable mode.
The temporary environment variable mode has the advantages of simplicity and convenience, so that automatic introduction of configuration parameters is realized more conveniently.
Preferably, the remote execution of the installation script on the host to be deployed realizes software deployment, specifically:
when the host to be deployed is a window environment, remotely executing the installation script by using a WINRM port to realize software deployment;
when the host to be deployed is a linux environment, the SSH end is used for remotely executing the installation script to realize software deployment.
The method supports various mainstream server operating systems, such as Centos 7.X, ubuntu 16.X, windows 2008, windows 2012, windows 2016, etc. When the host to be deployed is a window operating system, remote installation can be realized by utilizing a WINRM port built in the window system. When the host to be deployed is a linux operating system, remote installation can be realized by using an SSH port built in the linux operating system.
Preferably, the remote execution of the installation script on the host to be deployed realizes software deployment, and further includes:
acquiring a nested relation table of the software to be installed through the configuration file, and acquiring a configuration file of dependent software associated with the software to be installed according to the nested relation table;
and remotely executing the installation script of each dependent software and the installation script of the software to be installed in sequence according to the order of the nested relation table to realize nested installation.
The configuration file contains a nested relation table describing the nested relation between the software to be installed and other software, and the configuration file contains the nested relation table which indicates that the software to be installed needs to be installed in a nested way, namely, the software to be installed needs to be established on the premise of being installed depending on the software. According to the nested relation table, the installation order of the software to be installed and the dependent software related to the software to be installed can be obtained, and configuration files of all the dependent software are obtained, so that installation scripts of all the dependent software are obtained, all the dependent software and the software to be installed are installed in sequence according to the nested order, and nested installation is realized. The remote deployment of each dependent software and the remote deployment of the software to be installed are realized by adopting the same method.
Preferably, in the process of executing the installation script, an installation log of the host to be deployed is obtained, and the installation log is transmitted into an installation page to be displayed, specifically:
in the process of executing the installation script, obtaining an installation log of a host to be deployed in a streaming mode, and transmitting the installation log into an installation page for display by adopting a comet technology.
The installation log is obtained in a streaming mode, and remote display is carried out by adopting a comet technology, so that real-time monitoring of installation dynamics is realized, and deployment personnel can analyze and process deployment problems possibly occurring.
Preferably, the method further comprises storing the installation information of the software to be installed after the installation script is executed.
And the installation information of the installed software is stored, so that the inquiry is convenient. Meanwhile, after the installation script is executed and the remote installation of the software is completed, whether the installation is successful or not is verified, and installation confirmation information is returned to display so as to ensure the smooth installation, thereby realizing the monitoring of the installation result.
Preferably, the method further comprises:
acquiring a deleting script of the software to be deleted according to the configuration file, and remotely executing the deleting script on the host computer to be deployed to realize software deletion;
in the process of executing the deleting script, acquiring a deleting log in a streaming mode, and transmitting the deleting log into a deleting page for display by adopting a comet technology;
and deleting the installation information of the software to be deleted after the deleting script is executed.
When the installed software is deleted remotely, the configuration file is obtained first, the deleting script is obtained through the configuration file, and the deleting script is directly executed remotely to delete the software. Meanwhile, in the deleting process, a deleting log is obtained, so that deleting dynamics are mastered in real time. After the deletion, deleting the corresponding installation information to realize the update of the installation information.
Example 2
Embodiment 2 of the present invention provides a visualized software remote deployment management machine, which includes a processor and a memory, where the memory stores a computer program, and when the computer program is executed by the processor, the visualized software remote deployment method provided in the above embodiment is implemented.
The visualized software remote deployment management machine provided by the embodiment of the invention is used for realizing the visualized software remote deployment management method, so that the visualized software remote deployment management machine has the technical effects of the visualized software remote deployment management method, and the visualized software remote deployment management machine is also provided and is not repeated herein.
The above-described embodiments of the present invention do not limit the scope of the present invention. Any other corresponding changes and modifications made in accordance with the technical idea of the present invention shall be included in the scope of the claims of the present invention.