CN111708571A - Micro-service deployment method, device, electronic equipment and storage medium - Google Patents

Micro-service deployment method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111708571A
CN111708571A CN202010552305.9A CN202010552305A CN111708571A CN 111708571 A CN111708571 A CN 111708571A CN 202010552305 A CN202010552305 A CN 202010552305A CN 111708571 A CN111708571 A CN 111708571A
Authority
CN
China
Prior art keywords
micro
service
file
deployment
batch
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
CN202010552305.9A
Other languages
Chinese (zh)
Other versions
CN111708571B (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.)
Zhuhai Hongqiao High Tech Co ltd
Original Assignee
Zhuhai Hongqiao High Tech 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 Zhuhai Hongqiao High Tech Co ltd filed Critical Zhuhai Hongqiao High Tech Co ltd
Priority to CN202010552305.9A priority Critical patent/CN111708571B/en
Publication of CN111708571A publication Critical patent/CN111708571A/en
Application granted granted Critical
Publication of CN111708571B publication Critical patent/CN111708571B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a micro-service deployment method, a device, electronic equipment and a storage medium, and relates to the technical field of micro-services. The method comprises the following steps: determining a starting environment configuration of micro-service deployment; deploying at least one micro service through a batch file, wherein the batch file corresponding to each micro service in the at least one micro service is generated based on a JAR file packaged by a Java program of each micro service. According to the method, the JAR file packed by the Java program of the micro-service is subjected to script execution through the batch processing file, so that batch automatic deployment of the micro-service is realized, and the deployment efficiency of the micro-service is improved.

Description

Micro-service deployment method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of micro-service technologies, and in particular, to a method and an apparatus for deploying a micro-service, an electronic device, and a storage medium.
Background
The micro-service is a functional unit which can be independently designed, developed, tested, deployed, operated and maintained, and has the characteristics of light-weight mechanism communication, loose coupling, small size and the like. At present, the application of a micro service architecture in a service application system is gradually expanded, and generally, a complete application system can be formed by tens, hundreds, or even thousands of micro services (depending on the scale of a specific application system) which independently run, and in the process of deployment, operation and maintenance of application system products, operation and maintenance personnel need to operate a large amount of micro service configuration information, so that the problem of low micro service deployment efficiency exists.
Disclosure of Invention
In view of the above, an object of the embodiments of the present application is to provide a method, an apparatus, an electronic device and a storage medium for deploying a micro service, so as to solve the problem of low deployment efficiency of the micro service in the prior art.
The embodiment of the application provides a micro-service deployment method, which comprises the following steps: determining a starting environment configuration of micro-service deployment; deploying at least one micro service through a batch file, wherein the batch file corresponding to each micro service in the at least one micro service is generated based on a JAR file packaged by a Java program of each micro service.
In the implementation mode, the starting environment configuration of the micro-service deployment is determined firstly, so that the environment and the file basis of the micro-service deployment in batch are completed, and the JAR file packed by the Java program of the micro-service is executed with a script through the batch processing file, so that the automatic deployment in batch of the micro-service is realized, and the micro-service deployment efficiency is improved.
Optionally, the determining the start-up environment configuration of the microservice deployment includes: determining the current server hardware environment configuration which meets the operation requirement of micro-service deployment; and determining the database connection configuration which meets the operation requirement of the micro-service deployment.
In the implementation mode, the server hardware environment configuration and the database connection configuration are used as the micro-service deployment requirement, so that the success rate of micro-service deployment can be ensured, and the micro-service deployment efficiency is improved.
Optionally, the determining the current server hardware environment configuration that meets the operating requirements of the microservice deployment includes: detecting and displaying the current server hardware environment configuration through a hardware information base, wherein the hardware information base comprises OSHI; and when the current server hardware environment configuration is different from the preset server hardware environment configuration which meets the operation requirement of micro-service deployment, modifying the current server hardware environment configuration into the preset server hardware environment configuration by adopting a batch environment variable maintenance configuration file based on extensible markup language (XML).
In the implementation mode, the hardware information base is used for detecting the hardware environment configuration of the server, any additional local base is not required to be installed, the step of detecting the hardware environment configuration is simplified, meanwhile, the batch environment variable maintenance configuration file of the extensible markup language XML is used for carrying out batch modification on the environment variables, and the efficiency of modifying the environment variables can be improved.
Optionally, the determining a database connection configuration that meets the operation requirement of the microservice deployment includes: adapting a database connection driver of a specified database type based on a user instruction; and connecting with a specified database based on the database connection driver, wherein the specified database comprises the XML file of the at least one microservice, and the specified database is used for storing and executing the full-volume script and the incremental script.
In the implementation mode, the database connection drive is adapted based on the type of the designated database, so that the automation efficiency of database connection is improved, the designated database provides the adding and executing functions of the incremental script, and a user can add new micro services.
Optionally, before the deploying at least one microservice by batch file, the method further comprises: reading and displaying micro-services configured in a server.xml file; selecting at least one micro service to be deployed from the micro services configured in the server.
In the implementation mode, the micro-services can be operated or displayed in batch based on the server.
Optionally, when the at least one microservice is a background service, the deploying the at least one microservice through the batch file includes: service attribute configuration is carried out on server.xml files in the specified database; reading the JAR file of each micro service in the specified database; adding a starting batch processing file and a stopping batch processing file under a JAR file directory of each micro-service, wherein the batch processing file name, the service name and the log file name of the starting batch processing file are the same as the configuration of the same micro-service in the server.xml file, and the batch processing file name and the port number of the stopping batch processing file are the same as the configuration of the same micro-service in the server.xml file; wherein the start batch file and the stop batch file are used to start or stop the at least one microservice upon execution.
In the implementation mode, the generation of the batch processing file is realized based on the server.
Optionally, the method comprises: and monitoring and online visualizing the at least one microservice based on a monitoring tool, wherein the monitoring tool comprises a Spring Boot Admin.
In the implementation mode, the monitoring tool is adopted to monitor and visualize the micro-service on line, and the management simplicity and intuition of the micro-service are improved.
The embodiment of the application provides a micro-service deployment device, which comprises: the environment configuration module is used for determining the starting environment configuration of the micro-service deployment; the database configuration module is used for determining the database configuration of the micro service deployment; the deployment module is used for deploying at least one micro service through batch files, and the batch files corresponding to each micro service in the at least one micro service are generated based on JAR files packed by Java programs of each micro service.
In the implementation mode, the starting environment configuration of the micro-service deployment is determined firstly, so that the environment and the file basis of the micro-service deployment in batch are completed, and the JAR file packed by the Java program of the micro-service is executed with a script through the batch processing file, so that the automatic deployment in batch of the micro-service is realized, and the micro-service deployment efficiency is improved.
Optionally, the environment configuration module is specifically configured to: determining the current server hardware environment configuration which meets the operation requirement of micro-service deployment; and determining the database connection configuration which meets the operation requirement of the micro-service deployment.
In the implementation mode, the server hardware environment configuration and the database connection configuration are used as the micro-service deployment requirement, so that the success rate of micro-service deployment can be ensured, and the micro-service deployment efficiency is improved.
Optionally, the environment configuration module is specifically configured to: detecting and displaying the current server hardware environment configuration through a hardware information base, wherein the hardware information base comprises OSHI; and when the current server hardware environment configuration is different from the preset server hardware environment configuration which meets the operation requirement of micro-service deployment, modifying the current server hardware environment configuration into the preset server hardware environment configuration by adopting a batch environment variable maintenance configuration file based on extensible markup language (XML).
In the implementation mode, the hardware information base is used for detecting the hardware environment configuration of the server, any additional local base is not required to be installed, the step of detecting the hardware environment configuration is simplified, meanwhile, the batch environment variable maintenance configuration file of the extensible markup language XML is used for carrying out batch modification on the environment variables, and the efficiency of modifying the environment variables can be improved.
Optionally, the environment configuration module is specifically configured to: adapting a database connection driver of a specified database type based on a user instruction; and connecting with a specified database based on the database connection driver, wherein the specified database comprises the XML file of the at least one microservice, and the specified database is used for storing and executing the full-volume script and the incremental script.
In the implementation mode, the database connection drive is adapted based on the type of the designated database, so that the automation efficiency of database connection is improved, the designated database provides the adding and executing functions of the incremental script, and a user can add new micro services.
Optionally, the deployment module is specifically configured to: reading and displaying micro-services configured in a server.xml file; selecting at least one micro service to be deployed from the micro services configured in the server.
In the implementation mode, the micro-services can be operated or displayed in batch based on the server.
Optionally, the deployment module is specifically configured to: service attribute configuration is carried out on server.xml files in the specified database; reading the JAR file of each micro service in the specified database; adding a starting batch processing file and a stopping batch processing file under a JAR file directory of each micro-service, wherein the batch processing file name, the service name and the log file name of the starting batch processing file are the same as the configuration of the same micro-service in the server.xml file, and the batch processing file name and the port number of the stopping batch processing file are the same as the configuration of the same micro-service in the server.xml file; wherein the start batch file and the stop batch file are used to start or stop the at least one microservice upon execution.
In the implementation mode, the generation of the batch processing file is realized based on the server.
Optionally, the microservice deployment apparatus further comprises: and the monitoring module is used for monitoring and online visualizing the at least one microservice based on a monitoring tool, and the monitoring tool comprises Spring Boot Admin.
In the implementation mode, the monitoring tool is adopted to monitor and visualize the micro-service on line, and the management simplicity and intuition of the micro-service are improved.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes steps in any one of the above implementation manners when reading and executing the program instructions.
The embodiment of the present application further provides a readable storage medium, in which computer program instructions are stored, and the computer program instructions are read by a processor and executed to perform the steps in any of the above implementation manners.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a method for deploying a micro service according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a current server hardware environment configuration determining step according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating a database connection configuration determining step according to an embodiment of the present application.
Fig. 4 is a schematic flowchart of a micro-service deployment step based on batch files according to an embodiment of the present application.
Fig. 5 is a schematic block diagram of a microservice deployment apparatus according to an embodiment of the present disclosure.
Icon: 20-micro service deployment device; 21-environment configuration module; 22-deployment module.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The research of the applicant shows that the current implementation modes aiming at micro-service deployment mainly comprise: based on a Windows system, a BAT script is compiled by pure hands; based on a Linux system, a SHELL script is compiled by pure manual operation; deployment is carried out based on a Docker technology; deployment is carried out based on an original JAVA to jar mode. The disadvantages of the above approach include: because a plurality of services in the microservice need to modify the configuration files manually, when the version of the affiliated service is updated, the configuration information related to the whole service needs to be modified again one by one, and the working efficiency is low; the configuration of the environment variables of the related micro-services needs to be modified by a user, so that human errors are easily caused; the micro-service cluster deployment requires personnel to manually ensure the deployment sequence of the services one by one according to specific requirements, and the accuracy is difficult to guarantee; the operation and maintenance personnel cannot know the health condition of the operation of the cluster service in real time and cannot find the service operation question in time; based on Docker deployment, under the environment that small cluster deployment and server resources are weak or performance requirements are not strong, the problems of resource waste and high operation and maintenance cost exist in deployment.
In order to solve the above problem, an embodiment of the present application provides a method for deploying a micro service, please refer to fig. 1, where fig. 1 is a schematic flow chart of the method for deploying a micro service provided in the embodiment of the present application, and the specific steps of the method may be as follows:
step S12: a boot environment configuration for the microservice deployment is determined.
As an optional implementation manner, the micro-service deployment method in this embodiment may be implemented by the electronic device executing micro-service deployment software. The invention provides a device for visual deployment of micro-services by means of batch files and Python scripts respectively for a Windows server and a Linux server, and software provides XXX.exe and XXX.tar.gz format installation and deployment packages respectively for the Windows server and the Linux server, so that a user can conveniently install and deploy in a very friendly form.
Batch processing is to perform batch processing on an object, and is generally considered as a simplified scripting language, which is applied to DOS and Windows systems. The extension of the batch file is bat.
JAR file is an archive file, constructed in ZIP format, and named file extension JAR, a software package file format, commonly used to aggregate large numbers of Java class files, associated metadata and resource (text, pictures, etc.) files into one file in order to develop Java platform applications or libraries.
The micro-service deployment software automatically diagnoses possible abnormity in the installation and deployment process so that system implementation personnel can quickly locate and repair problems. When the tool is installed on Windows or Linux, if an error occurs to cause the installation operation to be blocked, the self-service repair script attached to the tool can be automatically executed to try self-service repair, and if the repair cannot be successfully completed, the abnormal information collection script is started and the abnormal information is pushed to the tool installation log file, so that an implementer can accurately position the specific reason of the installation failure. The self-service repair script can be used for autonomously installing third-party service software in init _ server.xml configurations such as a Java Development Kit (a software Development Kit for Java developers), a Nginx (hypertext transfer protocol and reverse proxy web Server), a Remote Dictionary Server (Remote Dictionary service) and the like of corresponding versions according to the number of bits of the operating system; autonomously modifying font encoding according to an operating system; autonomously checking whether a server port is consistent with a micro-service deployment software default port or not and autonomously changing a tool default port; under the scene that the networking and remote diagnosis switch is opened, remote assistance processing can be carried out by autonomously accessing the company abnormity detection service (a request is sent to a company abnormity detection server, and the server pushes a preset repair script to a micro-service deployment software end after being matched with abnormity and carries out installation and execution).
Optionally, the start-up environment configuration may include a current server hardware environment configuration and a database connection configuration, and step S12 may specifically include: determining the current server hardware environment configuration which meets the operation requirement of micro-service deployment; and determining the database connection configuration which meets the operation requirement of the micro-service deployment.
Specifically, please refer to fig. 2, fig. 2 is a flowchart illustrating a current server hardware environment configuration determining step according to an embodiment of the present disclosure. The specific steps of the current server hardware environment configuration determining step may be as follows:
step S121: and detecting and displaying the current server hardware environment configuration through a hardware information base.
The hardware information base in this embodiment may be an ActiveX base, OSHI, or the like. OSHI is a free Native os based on jna (Java Native access) and a Java hardware library. It does not require any additional local libraries to be installed, and aims to provide a cross-platform implementation to retrieve system information, such as operating system versions, processes, memory and CPU usage, disks and partitions, devices, sensors, etc. Taking OSHI as an example, the current server hardware environment configuration is detected and displayed in a list form through OSHI, including the situations of a CPU (Central Processing Unit) model, an operating system, JDK, Redis, Nginx, and the like.
Step S122: and when the current server hardware environment configuration is different from the preset server hardware environment configuration which meets the operation requirement of micro-service deployment, modifying the current server hardware environment configuration into the preset server hardware environment configuration by adopting a batch environment variable maintenance configuration file based on extensible markup language (XML).
Among them, Extensible Markup Language (XML) is a Markup Language for marking electronic documents to have a structure, and in an electronic computer, a mark refers to an information symbol that can be understood by the computer, and by this mark, the computer can process information including various kinds, such as articles, etc. It can be used to mark data, define data types, and is a source language that allows a user to define his or her own markup language. It is well suited for world wide web transport, providing a unified approach to describing and exchanging structured data that is independent of the application or vendor. Is a cross-platform, content-dependent technology in the Internet environment and is also an effective tool today for processing distributed structural information.
The current server hardware environment configuration may include a third party application software configuration and an environment variable configuration corresponding to the third party application software configuration.
Optionally, in this embodiment, the microservice deployment software is attached with an installation package such as JDK, Redis, Nginx, and the like, and when the installation state of JDK, Redis, or Nginx does not meet the preset third-party application software configuration of the microservice deployment, the third-party application software may be conveniently extended by modifying the init _ server.xml configuration and adding a corresponding installation package, automatically decompress the corresponding installation package, and configure the environment variable of the installation software through the batch processing file, so that the third-party application software meets the preset third-party application software configuration.
Specifically, the batch environment variable maintenance configuration file based on the XML is envvariable.xml, which provides a one-key initialization capability of the environment variable, and the configuration file can be visualized into list information by reading envvariable.xml, and the environment variable can be modified by envvariable.xml, so that the environment variable in the current server hardware environment configuration is modified to conform to the preset server hardware environment configuration by using envvariable.xml in the embodiment.
Xml of the present embodiment may include the following information for each microservice: serviceName, serviceType, order, serviceStatus, logPath, and port. Wherein, the serviceName is a service identifier; the serviceType is a service type and is divided into foreground service and background service, wherein the foreground is represented by front and the background is represented by back; order is starting weight, and starting is prioritized if the value is larger; the serviceStatus is in a service state, 0 is not started, 1 is started, and the default is 0; logPath is a log path; a port is a service port, i.e., a port occupied by service startup.
Furthermore, the modification of the environment variables by using envvariable.xml may be implemented by batch processing files generated based on JAR files packed by JAVA programs of the environment variables configured in the preset server hardware environment in envvariable.xml. The principle of generation and execution of the batch file is explained below in this embodiment.
Specifically, please refer to fig. 3, where fig. 3 is a schematic flowchart illustrating a database connection configuration determining step according to an embodiment of the present application. The specific steps of the database connection configuration determining step may be as follows:
step S123: a database connection driver specifying a database type is adapted based on a user instruction.
The specified database type in this embodiment may be an SQL (Structured Query Language) database, an XML database, an Oracle database, or the like, and thus the database connection driver should correspond to the various specified database types.
The database driver, which is also referred to as a database driver, is a Dynamic Link Library (DLL) for connecting a data source of a specific open database connection with another application program (a client, in this embodiment, microservice deployment software).
Step S124: and connecting the designated database based on the database connection driver, wherein the designated database comprises at least one XML file of the microservice, and the designated database is used for storing and executing the full-volume script and the incremental script.
The full script is all script data in the database, and the incremental script is a new data script after the last export.
The micro-service deployment software needs to perform first handshake identification according to the incremental script name uploaded by a user and the selected incremental script tag, after the identification is passed, the micro-service deployment software reads version information in an identification library system C _ onfig in a remote database to perform secondary handshake identification, and after the identification is passed, the micro-service deployment software starts to execute the incremental script.
It should be understood that, before the micro service is deployed, the embodiment further needs to determine the micro service that needs to be deployed, and the specific steps may include: reading and displaying micro-services configured in a server.xml file; selecting at least one micro service to be deployed from micro services configured in a server.
The micro service list displayed by the micro service deployment software can read the service list configured in the server.
Step S14: and deploying at least one micro service through a batch file, wherein the batch file corresponding to each micro service in the at least one micro service is generated based on a JAR file packaged by a Java program of each micro service.
Specifically, referring to fig. 4, fig. 4 is a schematic flowchart of a procedure of deploying a micro service based on a batch file according to an embodiment of the present application, where the procedure of deploying the micro service based on the batch file may specifically include:
step S141: xml file is configured with service attributes in a specified database.
The service attributes in the xml file may be a batch environment variable maintenance configuration file corresponding to each microservice.
Step S142: the JAR file for each microservice in the specified database is read.
It should be understood that the JAR file of each micro service is a JAR packet obtained by packaging data corresponding to the micro service to be added in the server.
Specifically, the packaging in this embodiment can be implemented based on the Inno Setup, which is a free installation and production software (open source) that has both a script guide suitable for novices and a good script editing environment.
Step S143: and adding a start batch processing file and a stop batch processing file under the JAR file directory of each micro service.
Optionally, an example batch file may be stored in the JAR file directory of each microservice, and the corresponding function of starting or stopping the batch file may be implemented by modifying the attribute parameters of the example batch file.
The batch processing file name, the service name and the log file name of the starting batch processing file are the same as the configuration of the same micro-service in the server.
The user can start the corresponding micro-service by executing the start batch file, and can also stop the corresponding micro-service by executing the stop batch file.
Alternatively, the micro-service deployment software and the related micro-service may be packaged together, and after the micro-service deployment software is installed, the JAR package of the related micro-service is decompressed to a specified position (JAR file directory of the corresponding micro-service) under the installation directory, so as to obtain the start batch file and the stop batch file.
As an optional implementation manner, in this embodiment, foreground micro-service addition may also be performed, where first, service attributes are configured in services.xml under an installation directory corresponding to the foreground micro-service, a front-end code is added under a web page directory corresponding to Nginx of the foreground micro-service, and a corresponding Nginx configuration is added under a conf directory corresponding to Nginx, so that deployment of the foreground micro-service may be completed.
Optionally, the present embodiment may further perform monitoring and online visualization on at least one microservice based on a monitoring tool, where the monitoring tool includes a Spring Boot Admin, and may view the health status of the microservice. The monitoring tool provides the capability of online visual reading of the service logs in operation, reduces the operation and maintenance cost and the operation and maintenance difficulty of operation and maintenance personnel, can automatically collect micro-service cluster operation information and server hardware resource use information, analyzes and collects sensitive abnormal information of the micro-service cluster operation information and the server hardware resource use information, and generates the service operation and maintenance radar map regularly.
Further, when the monitoring tool finds out that the micro-service monitoring is abnormal or the micro-service monitoring is abnormally checked and repaired, an early warning notice is sent out, and the monitoring tool regularly compresses the log file at a specific time end and then automatically uploads the compressed log file to the specified log service for subsequent checking. Optionally, the monitoring tool may further provide an open API (application programming Interface) to Interface with a third-party communication tool to complete real-time pushing of the warning information.
In the embodiment, the natural interface operation advantage of the windows system is utilized, a complex micro-service deployment environment process is replaced by simple interface operation, visualization step operation is realized, zero-order line operation of service deployment is realized, and a one-stop device for micro-service deployment is constructed, and comprises environment detection, service configuration, service management, service monitoring, database configuration and abnormity early warning monitoring of micro-service deployment.
In order to better match the micro-service deployment method provided in the present embodiment, the present embodiment further provides a micro-service deployment apparatus 20.
Referring to fig. 5, fig. 5 is a block diagram illustrating a microservice deployment apparatus according to an embodiment of the present disclosure.
The microservice deployment apparatus 20 includes:
an environment configuration module 21, configured to determine a start environment configuration of the microservice deployment;
the deployment module 22 is configured to deploy at least one microservice through a batch file, where the batch file corresponding to each microservice in the at least one microservice is generated based on a JAR file packed by a Java program of each microservice.
Optionally, the environment configuration module 21 is specifically configured to: determining the current server hardware environment configuration which meets the operation requirement of micro-service deployment; and determining the database connection configuration which meets the operation requirement of the micro-service deployment.
Optionally, the environment configuration module 21 is specifically configured to: detecting and displaying the current server hardware environment configuration through a hardware information base, wherein the hardware information base comprises OSHI; and when the current server hardware environment configuration is different from the preset server hardware environment configuration which meets the operation requirement of micro-service deployment, modifying the current server hardware environment configuration into the preset server hardware environment configuration by adopting a batch environment variable maintenance configuration file based on extensible markup language (XML).
Optionally, the environment configuration module 21 is specifically configured to: adapting a database connection driver of a specified database type based on a user instruction; and connecting the designated database based on the database connection driver, wherein the designated database comprises at least one XML file of the microservice, and the designated database is used for storing and executing the full-volume script and the incremental script.
Optionally, the deployment module 22 is specifically configured to: reading and displaying micro-services configured in a server.xml file; selecting at least one micro service to be deployed from micro services configured in a server.
Optionally, the deployment module 22 is specifically configured to: performing service attribute configuration on a server.xml file in a specified database; reading a JAR file of each micro service in a specified database; adding a starting batch processing file and a stopping batch processing file under a JAR file directory of each micro-service, wherein the batch processing file name, the service name and the log file name of the starting batch processing file are the same as the configuration of the same micro-service in a server.xml file, and the batch processing file name and the port number of the stopping batch processing file are the same as the configuration of the same micro-service in the server.xml file; wherein the start batch file and the stop batch file are used to start or stop at least one microservice when executed.
Optionally, the microservice deployment apparatus 20 further comprises: and the monitoring module is used for monitoring and online visualizing at least one micro service based on a monitoring tool, and the monitoring tool comprises Spring Boot Admin.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores program instructions, and the processor, when reading and executing the program instructions, executes the steps in any one of the methods for deploying the micro service provided in this embodiment.
It should be understood that the electronic device may be a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), or other electronic device having a logical computing function.
The embodiment of the present application further provides a readable storage medium, in which computer program instructions are stored, and the computer program instructions are read and executed by a processor to execute the steps in the micro-service deployment method.
In summary, an embodiment of the present application provides a method for deploying a micro service, where the method includes: determining a starting environment configuration of micro-service deployment; deploying at least one micro service through a batch file, wherein the batch file corresponding to each micro service in the at least one micro service is generated based on a JAR file packaged by a Java program of each micro service.
In the implementation mode, the starting environment configuration of the micro-service deployment is determined firstly, so that the environment and the file basis of the micro-service deployment in batch are completed, and the JAR file packed by the Java program of the micro-service is executed with a script through the batch processing file, so that the automatic deployment in batch of the micro-service is realized, and the micro-service deployment efficiency is improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the 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 combinations of blocks in the block diagrams, 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 addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Therefore, the present embodiment further provides a readable storage medium, in which computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the steps of any of the block data storage methods. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned 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 RanDom Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application 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 application, and shall be covered by the scope of the present application.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method of micro-service deployment, the method comprising:
determining a starting environment configuration of micro-service deployment;
deploying at least one micro service through a batch file, wherein the batch file corresponding to each micro service in the at least one micro service is generated based on a JAR file packaged by a Java program of each micro service.
2. The method of claim 1, wherein the boot environment configuration comprises a current server hardware environment configuration and a database connection configuration, and wherein determining the boot environment configuration for the microservice deployment comprises:
determining the current server hardware environment configuration which meets the operation requirement of micro-service deployment;
and determining the database connection configuration which meets the operation requirement of the micro-service deployment.
3. The method of claim 2, wherein determining the current server hardware environment configuration that meets operational requirements of the microservice deployment comprises:
detecting and displaying the current server hardware environment configuration through a hardware information base, wherein the hardware information base comprises OSHI;
and when the current server hardware environment configuration is different from the preset server hardware environment configuration which meets the operation requirement of micro-service deployment, modifying the current server hardware environment configuration into the preset server hardware environment configuration by adopting a batch environment variable maintenance configuration file based on extensible markup language (XML).
4. The method of claim 3, wherein determining the database connection configuration that meets the operational requirements of the microservice deployment comprises:
adapting a database connection driver of a specified database type based on a user instruction;
and connecting with a specified database based on the database connection driver, wherein the specified database comprises the XML file of the at least one microservice, and the specified database is used for storing and executing the full-volume script and the incremental script.
5. The method of claim 1, wherein prior to said deploying at least one microservice via a batch file, the method further comprises:
reading and displaying micro-services configured in a server.xml file;
selecting at least one micro service to be deployed from the micro services configured in the server.
6. The method of claim 4, wherein when the at least one microservice is a background service, the deploying the at least one microservice through the batch file comprises:
service attribute configuration is carried out on server.xml files in the specified database;
reading the JAR file of each micro service in the specified database;
adding a starting batch processing file and a stopping batch processing file under a JAR file directory of each micro-service, wherein the batch processing file name, the service name and the log file name of the starting batch processing file are the same as the configuration of the same micro-service in the server.xml file, and the batch processing file name and the port number of the stopping batch processing file are the same as the configuration of the same micro-service in the server.xml file;
wherein the start batch file and the stop batch file are used to start or stop the at least one microservice upon execution.
7. The method according to claim 1, characterized in that it comprises:
and monitoring and online visualizing the at least one microservice based on a monitoring tool, wherein the monitoring tool comprises a Spring Boot Admin.
8. A microservice deployment apparatus, the apparatus comprising:
the environment configuration module is used for determining the starting environment configuration of the micro-service deployment;
the deployment module is used for deploying at least one micro service through batch files, and the batch files corresponding to each micro service in the at least one micro service are generated based on JAR files packed by Java programs of each micro service.
9. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.
10. A storage medium having stored thereon computer program instructions for executing the steps of the method according to any one of claims 1 to 7 when executed by a processor.
CN202010552305.9A 2020-06-17 2020-06-17 Micro-service deployment method and device, electronic equipment and storage medium Active CN111708571B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010552305.9A CN111708571B (en) 2020-06-17 2020-06-17 Micro-service deployment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010552305.9A CN111708571B (en) 2020-06-17 2020-06-17 Micro-service deployment method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111708571A true CN111708571A (en) 2020-09-25
CN111708571B CN111708571B (en) 2023-06-30

Family

ID=72540596

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010552305.9A Active CN111708571B (en) 2020-06-17 2020-06-17 Micro-service deployment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111708571B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112068852A (en) * 2020-09-27 2020-12-11 山东云海国创云计算装备产业创新中心有限公司 Method, system, equipment and medium for installing open source software based on domestic server
CN112612541A (en) * 2020-12-18 2021-04-06 北京中电普华信息技术有限公司 Method and device for managing configuration files
CN112883312A (en) * 2021-02-05 2021-06-01 浙江卡易智慧医疗科技有限公司 Cross-platform supporting Nginx visual configuration system and method
CN113010378A (en) * 2021-03-04 2021-06-22 万翼科技有限公司 Log processing method and device of microservice module, storage medium and electronic device
CN113741909A (en) * 2021-08-31 2021-12-03 平安国际智慧城市科技股份有限公司 Micro-service deployment method, device, electronic equipment and storage medium
CN113760311A (en) * 2021-08-25 2021-12-07 山东浪潮通软信息科技有限公司 Micro-service deployment method, device and medium
CN113760301A (en) * 2020-12-30 2021-12-07 京东数科海益信息科技有限公司 Micro-service application deployment method, device, equipment and storage medium
CN113934446A (en) * 2021-12-16 2022-01-14 中电云数智科技有限公司 Micro-service configuration system and method based on container cloud platform
CN114296832A (en) * 2021-12-31 2022-04-08 北京易华录信息技术股份有限公司 Method and device for deploying production environment of micro service
CN114546535A (en) * 2022-02-28 2022-05-27 中国建设银行股份有限公司 Service configuration method and device of operating system, storage medium and electronic equipment
CN115202711A (en) * 2022-06-29 2022-10-18 易保网络技术(上海)有限公司 Data publishing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107102847A (en) * 2016-02-23 2017-08-29 中国水电工程顾问集团有限公司 Software development methodology, apparatus and system based on micro services
US20180349121A1 (en) * 2017-05-30 2018-12-06 International Business Machines Corporation Dynamic deployment of an application based on micro-services
CN110058864A (en) * 2019-04-18 2019-07-26 成都四方伟业软件股份有限公司 The dispositions method and device of micro services
CN110858144A (en) * 2018-08-24 2020-03-03 中国电信股份有限公司 Automatic server deployment method, device and system and computer readable storage medium
CN111198695A (en) * 2019-12-25 2020-05-26 航天信息股份有限公司 Automatic deployment method of micro-service administration management platform and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107102847A (en) * 2016-02-23 2017-08-29 中国水电工程顾问集团有限公司 Software development methodology, apparatus and system based on micro services
US20180349121A1 (en) * 2017-05-30 2018-12-06 International Business Machines Corporation Dynamic deployment of an application based on micro-services
CN110858144A (en) * 2018-08-24 2020-03-03 中国电信股份有限公司 Automatic server deployment method, device and system and computer readable storage medium
CN110058864A (en) * 2019-04-18 2019-07-26 成都四方伟业软件股份有限公司 The dispositions method and device of micro services
CN111198695A (en) * 2019-12-25 2020-05-26 航天信息股份有限公司 Automatic deployment method of micro-service administration management platform and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄强文;曾丹;: "基于Spring Cloud和Docker的分布式微服务架构设计" *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112068852A (en) * 2020-09-27 2020-12-11 山东云海国创云计算装备产业创新中心有限公司 Method, system, equipment and medium for installing open source software based on domestic server
CN112068852B (en) * 2020-09-27 2022-06-17 山东云海国创云计算装备产业创新中心有限公司 Method, system, equipment and medium for installing open-source software based on domestic server
CN112612541A (en) * 2020-12-18 2021-04-06 北京中电普华信息技术有限公司 Method and device for managing configuration files
CN113760301A (en) * 2020-12-30 2021-12-07 京东数科海益信息科技有限公司 Micro-service application deployment method, device, equipment and storage medium
CN113760301B (en) * 2020-12-30 2024-05-17 京东科技信息技术有限公司 Micro-service application deployment method, device, equipment and storage medium
CN112883312A (en) * 2021-02-05 2021-06-01 浙江卡易智慧医疗科技有限公司 Cross-platform supporting Nginx visual configuration system and method
CN113010378A (en) * 2021-03-04 2021-06-22 万翼科技有限公司 Log processing method and device of microservice module, storage medium and electronic device
CN113760311A (en) * 2021-08-25 2021-12-07 山东浪潮通软信息科技有限公司 Micro-service deployment method, device and medium
CN113741909B (en) * 2021-08-31 2024-04-12 平安国际智慧城市科技股份有限公司 Micro-service deployment method and device, electronic equipment and storage medium
CN113741909A (en) * 2021-08-31 2021-12-03 平安国际智慧城市科技股份有限公司 Micro-service deployment method, device, electronic equipment and storage medium
CN113934446A (en) * 2021-12-16 2022-01-14 中电云数智科技有限公司 Micro-service configuration system and method based on container cloud platform
CN114296832A (en) * 2021-12-31 2022-04-08 北京易华录信息技术股份有限公司 Method and device for deploying production environment of micro service
CN114546535A (en) * 2022-02-28 2022-05-27 中国建设银行股份有限公司 Service configuration method and device of operating system, storage medium and electronic equipment
CN115202711B (en) * 2022-06-29 2023-11-14 易保网络技术(上海)有限公司 Data release method and system
WO2024001679A1 (en) * 2022-06-29 2024-01-04 易保网络技术(上海)有限公司 Data publishing method and system
CN115202711A (en) * 2022-06-29 2022-10-18 易保网络技术(上海)有限公司 Data publishing method and system

Also Published As

Publication number Publication date
CN111708571B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111708571B (en) Micro-service deployment method and device, electronic equipment and storage medium
US10419546B2 (en) Migration assessment for cloud computing platforms
US8140905B2 (en) Incremental problem determination and resolution in cloud environments
US10540266B2 (en) Method and system for testing software based system
US11392461B2 (en) Method and apparatus for processing information
US7664986B2 (en) System and method for determining fault isolation in an enterprise computing system
JP3946057B2 (en) Consistency inspection support method and consistency inspection support system
US7810087B2 (en) Method and apparatus for inserting code fixes into applications at runtime
US20120159449A1 (en) Call Stack Inspection For A Thread Of Execution
US8285662B2 (en) Framework for delta analysis during automated builds
CN111694592A (en) Management method and system for project version release
US9298571B2 (en) Method and apparatus for correlating input and output messages of system under test
CN111382048B (en) Management method and device for mobile equipment on true machine test platform
WO2020251839A1 (en) Generating data structures representing relationships among entities of a high-scale network infrastructure
US20130111018A1 (en) Passive monitoring of virtual systems using agent-less, offline indexing
EP2577458B1 (en) Distillation and reconstruction of provisioning components
CN111258802A (en) Method for capturing application program crash information and related equipment
CN111382079B (en) Method, device and equipment for restoring application program on site and storage medium
US11416376B2 (en) Investigative platform for software application development and production
WO2019125491A1 (en) Application behavior identification
Andrzejak et al. Confguru-A system for fully automated debugging of configuration errors
CN117453237A (en) Model conversion method and related device
CN116882386A (en) Method and device for displaying project product dependency relationship
CN115080431A (en) Code testing method, device, storage medium and equipment
CN114595110A (en) Point burying method, device, medium and electronic equipment for event to be monitored

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 Rooms 806, 901 and 902, No. 29, Lanwan Lane, Tangjiawan Town, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant after: Hongqiao Hi Tech Group Co.,Ltd.

Address before: 519000 1st floor, area D, South Software Park, No.1, Tangjiawan Software Park Road, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI HONGQIAO HIGH-TECH Co.,Ltd.

GR01 Patent grant
GR01 Patent grant