Disclosure of Invention
In view of this, embodiments of the present application provide an automated deployment method, an electronic device, and a medium for a micro-service administration management platform, so as to deploy the micro-service administration management platform efficiently.
In a first aspect, an embodiment of the present application provides an automated deployment method for a micro-service administration management platform, including: automatically checking an operating system version; automatically checking the server configuration; automatically setting system parameters; automatically building a local source; automatically installing the dependent software; automatically starting the micro-service treatment component; automatically initializing a micro-service administration component; and automatically initializing the micro-service administration management platform.
As a specific implementation manner of the embodiment of the present application, the configuration of the automatic check server includes: obtaining server configuration information, wherein the server configuration information comprises: basic network configuration information, network domain name resolution, network card configuration information, storage equipment mounting and partition information; verifying the acquired server configuration information; if the verification is not passed, prompt information is output to prompt the user.
As a specific implementation manner of the embodiment of the present application, the automatically setting system parameters includes: setting the following system parameters according to the requirements of the micro-service management platform: maximum number of opened files, firewall, system safety protection and system time related parameters.
As a specific implementation manner of the embodiment of the present application, the automatically building a local source includes: acquiring path information of an rpm file in an installation file package; configuring a repo source file using the path information; placing the configured repo source file under a source file path of the system; the cached local sources are read and initialized.
As a specific implementation manner of the embodiment of the present application, the automatically installing dependent software includes: installing a jQuery component; installing docker software; creating and compiling a docker configuration file; installing docker _ composition; and installing a local private mirror image warehouse to directly store the mirror image as a local mirror image file, and directly loading the local mirror image file as the mirror image in the private mirror image warehouse in the deployment process.
As a specific implementation manner of the embodiment of the present application, the starting micro-service administration component includes: generating a yaml file according to the current environment; pulling the mirror image according to the yaml file; and starting the component container and the database, automatically restarting the corresponding component container under the condition of unsuccessful starting, and prompting a user if the component container is not started successfully after the first preset condition is reached.
As a specific implementation manner of the embodiment of the present application, the initializing microservice management component includes: running the automatic configuration script of the component service in each container, and carrying out initialization configuration on each component service; after the initialization configuration, the butt joint condition of the component and the database is detected, the initialization configuration is automatically carried out on the corresponding component service again under the condition that the database does not have the corresponding library of the component, and if the second preset condition is met and the initialization is not successful, a user is prompted.
As a specific implementation manner of the embodiment of the present application, the automatic initialization micro-service administration management platform includes: creating a resource space and a storage bucket required by the micro-service cluster; creating a default micro-service cluster; and creating a user account of the micro-service administration management platform.
In a second aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes:
a memory storing executable instructions;
and the processor runs the executable instructions in the memory to realize the automatic deployment method of the micro-service administration management platform.
In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the automated deployment method of the micro-service administration management platform.
According to the application, the micro-service management platform can be automatically and efficiently deployed in one key, and manpower is greatly saved. Furthermore, the additional risk introduced by manual configuration is avoided.
Additional features and advantages of the present application will be described in detail in the detailed description which follows.
Detailed Description
Preferred embodiments of the present application will be described in more detail below. While the following describes preferred embodiments of the present application, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein.
The application provides an automatic deployment method of a micro-service administration management platform. The method comprises the following steps: automatically checking an operating system version; automatically checking the server configuration; automatically setting system parameters; building a local source; automatically installing the dependent software; automatically starting the micro-service treatment component; automatically initializing a micro-service administration component; and automatically initializing the micro-service administration management platform.
According to the method, when the deployment operation is triggered, the high-efficiency micro-service administration management platform deployment method can be automatically carried out on a single node, the configuration steps are greatly simplified, the labor is reduced, and the configuration time and the installation deployment time are reduced.
Fig. 1 shows a flowchart of an automated deployment method of a micro-service administration management platform according to an example embodiment of the present application. As shown, the method includes the following steps.
Step 11, automatically checking the operating system version.
Specifically, the operating system version information of the current environment may be obtained, and whether it is compatible with the version of the dependent software may be determined.
Step 12, the server configuration is automatically checked.
Specifically, the automatic check server configuration may include: obtaining server configuration information, wherein the server configuration information comprises: basic network configuration information, network domain name resolution, network card configuration information, storage equipment mounting and partition information and the like; verifying the acquired server configuration information; if the verification is not passed, prompt information is output to prompt the user.
And the wrong configuration is found as early as possible in the installation process, and the user is prompted to modify the configuration, so that the subsequent installation configuration is ensured to be carried out smoothly.
Andstep 13, automatically setting system parameters.
Specifically, automatically setting system parameters may include: setting the following system parameters according to the requirements of the micro-service management platform: maximum number of opened files, firewall, system safety protection, system time related parameters and the like.
Andstep 14, automatically building a local source.
And local sources are established, so that the local installation of the software is facilitated, and the offline installation of the software is realized.
Specifically, building a local source may include: acquiring path information of an rpm file in an installation file package; configuring a repo source file using the path information; placing the configured repo source file under a source file path of the system; the cached local sources are read and initialized. According to the method, the micro-service management platform does not need to be downloaded and installed by software in the installation and deployment process from an external network in the local installation process, the local installation of common software can be realized, the method is convenient and fast, and the influence of network reasons on the installation efficiency in the installation process is greatly reduced.
Andstep 15, automatically installing the dependent software.
Specifically, automatically installing the dependent software may include:
step 151, installing a jQuery component;
step 152, installing docker software;
step 153, creating and compiling a docker configuration file;
step 154, installing docker _ composition;
step 155, install the local private image repository to directly save the image as a local image file, and directly load the local image file as an image in the private image repository during the deployment process.
Software such as jQuery, docker and the like can be automatically installed according to the requirements of the micro-service management platform.
The jQuery is a quick and simple JavaScript frame, and can be pre-installed to meet the development requirements of users and the normal operation of components.
Because the functional components on the micro-service administration management platform are mainly started and operated in a container service mode, the docker software is important dependent software of the micro-service administration management platform, and configuration files of the software can be configured according to the requirements of the micro-service administration management platform, wherein the configuration files comprise parameters such as an access trust list, a data storage path and the like, so that the software can be normally started and used in the environment.
The parallel starting plug-in socket _ composition of the socket is installed, a plurality of socket containers can be started simultaneously by using the plug-in socket, the running time and the code scale for starting the micro-service administration component containers one by one can be shortened, and the containers can be started more conveniently.
The method comprises the steps of installing a local private mirror image warehouse, directly storing mirror images as local mirror image files, and directly loading the mirror image files into mirror images in the private mirror image warehouse in the deployment process, so that the starting process of mirror image service is simplified, local source code compiling is not needed, then the local source code compiling is uploaded to the mirror image warehouse, the related complex steps of source code compiling are omitted in the installation process, and the deployment of the micro-service administration management platform is more convenient and simpler. In addition, the mirror image service in the mirror image warehouse can be pulled to carry out localized operation at any time according to the requirement.
Andstep 16, automatically starting the micro-service treatment component.
Specifically, initiating the micro-service administration component may include:
step 161, generating a yaml file according to the current environment;
step 162, pulling the mirror image according to the yaml file;
and 163, starting the component container and the database, automatically restarting the corresponding component container under the condition of unsuccessful starting, and prompting a user if the component container is not started successfully after the first preset condition is met.
And generating a yaml file according to the current environment, wherein parameters such as an IP address, a service port and the like corresponding to the yaml file correspond to the current environment one by one, so that the subsequent starting of the administration component is facilitated. And pulling the mirror image according to the yaml file, starting the mirror image of the bottom database at first, ensuring the data storage condition of the functional component of the administration management platform, and then starting the functional component container. In one example, more than one functional component container may be launched 50.
If the individual component is not successfully started in the starting process, the component which is not successfully started for the first time is started again, and manual intervention can be reduced. If the starting of the functional component container is still failed by a plurality of attempts, the related component information and the component starting command are collected and the user is prompted to execute the component starting command, so that the starting of the functional component container is more convenient and intelligent.
And step 17, automatically initializing the micro-service administration component.
Specifically, initializing the micro-service administration component may include: running the automatic configuration script of the component service in each container, and carrying out initialization configuration on each component service; after the initialization configuration, the butt joint condition of the component and the database is detected, the initialization configuration is automatically carried out on the corresponding component service again under the condition that the database does not have the corresponding library of the component, and if the second preset condition is met and the initialization is not successful, a user is prompted.
Initializing the service, enabling the component containers to enter each container after being started, operating the component service automatic configuration scripts in each container, and performing initialization configuration on each component service according to the functions of different components, so that the component service can work normally, and normal use of various functions of the micro-service administration management platform is realized.
The method comprises the steps of automatically checking the butt joint condition of components and a database after initialization, and judging that the components are not initialized successfully when detecting that a database for storing data of a certain component does not exist because each component needs to create a corresponding library of the corresponding component in the database from the initialization execution to the last step, so that the components which are not initialized successfully for the first time can be started again, and manual intervention is reduced. If the initialization cannot be performed through a plurality of attempts, the related component information and the component initialization command are collected and the user is prompted to perform the initialization, so that the initialization of the functional component container is more convenient and intelligent.
And step 18, automatically initializing the micro-service administration management platform.
Specifically, automatically initializing the micro-service administration management platform may include: creating a resource space and a storage bucket required by the micro-service cluster; creating a default micro-service cluster; and creating a user account (such as a super user account of a Web UI interface) of the micro service administration management platform.
The method can initialize the whole platform when verifying that the basic functions of the micro-service management platform can be normally used, and prepares for the subsequent formal use of the service cluster.
An electronic device according to an embodiment of the application includes a memory and a processor.
The memory is to store non-transitory computer readable instructions. In particular, the memory may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc.
The processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of the present application, the processor is configured to execute the computer readable instructions stored in the memory.
Those skilled in the art should understand that, in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus, an interface, and the like, and these well-known structures should also be included in the protection scope of the present application.
For the detailed description of the present embodiment, reference may be made to the corresponding descriptions in the foregoing embodiments, which are not repeated herein.
An embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the above-mentioned automated deployment method for a micro-service administration management platform.
A computer-readable storage medium according to embodiments of the present application has non-transitory computer-readable instructions stored thereon. The non-transitory computer readable instructions, when executed by a processor, perform all or a portion of the steps of the methods of the embodiments of the present application as previously described.
The computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROMs and DVDs), magneto-optical storage media (e.g., MOs), magnetic storage media (e.g., magnetic tapes or removable disks), media with built-in rewritable non-volatile memory (e.g., memory cards), and media with built-in ROMs (e.g., ROM cartridges).
Having described embodiments of the present application, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments.