CN111367534B - Service arrangement method and system based on application environment - Google Patents

Service arrangement method and system based on application environment Download PDF

Info

Publication number
CN111367534B
CN111367534B CN202010195229.0A CN202010195229A CN111367534B CN 111367534 B CN111367534 B CN 111367534B CN 202010195229 A CN202010195229 A CN 202010195229A CN 111367534 B CN111367534 B CN 111367534B
Authority
CN
China
Prior art keywords
service
application
deployment
micro
machine
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.)
Active
Application number
CN202010195229.0A
Other languages
Chinese (zh)
Other versions
CN111367534A (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.)
Yuanguang Software Co Ltd
Original Assignee
Yuanguang Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yuanguang Software Co Ltd filed Critical Yuanguang Software Co Ltd
Priority to CN202010195229.0A priority Critical patent/CN111367534B/en
Publication of CN111367534A publication Critical patent/CN111367534A/en
Application granted granted Critical
Publication of CN111367534B publication Critical patent/CN111367534B/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/60Software deployment
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • 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 invention relates to a service arrangement method and a system based on an application environment, belongs to the technical field of micro-service application operation and maintenance, and solves the problems that the existing deployment micro-service application needs to repeatedly set basic parameters, cannot realize compatible switching of multiple deployment modes and the like. The method comprises the following steps: initializing one or more application environments and basic services of a deployment system, and acquiring an environment code and a service code; machine information of machines capable of running micro-service applications to be deployed under each application environment is newly added in a deployment system; newly adding a micro-service application to be deployed in a deployment system, and acquiring an application code of the micro-service application; obtaining a service arrangement file based on the service code and the application code; analyzing the service arrangement file by using a service arrangement analysis engine, determining a deployed application environment and a target deployment machine, and acquiring a service deployment engine; using a service deployment engine to deploy the service; and after the service deployment is successful, generating a micro-service application instance, and running on the target deployment machine.

Description

Service arrangement method and system based on application environment
Technical Field
The invention relates to the technical field of micro-service application operation and maintenance, in particular to a service arrangement method and system based on an application environment.
Background
With the development of information technology, microservices have become one of the most popular hotwords in the field of software architecture. The micro-services are technical architecture generated for adapting to the rapid development of the current Internet, the rapid iteration and rapid deployment of Internet application, the micro-services emphasize isolation on the basis of sharing hardware resources, each micro-service in the system can be deployed independently, and each micro-service is loosely coupled.
The number of deployed micro-service applications is large, the monitoring processes are large, the managed machines are large, the application configuration is large, the deployed environment is large, and the like, so that the operation and maintenance complexity is increased steeply. If the basic service of each set of application environment needs to be deployed by a developer, setting repeated basic parameters for deploying each micro-service application; meanwhile, aiming at the physical machine, the deployment of the virtual machine or the container cannot be well compatible and switched, so that the development efficiency is greatly reduced and the deployment error is easy to cause.
Disclosure of Invention
In view of the above, the present invention is directed to a service orchestration method and system based on application environment, which solve at least one of the above-mentioned drawbacks of the prior art.
The aim of the invention is mainly realized by the following technical scheme:
in one aspect, a service orchestration method based on an application environment is provided for deploying a micro-service application in a deployment system; the method comprises the following steps:
initializing one or more application environments and basic services of the deployment system, and acquiring an environment code of the application environment and a service code of the basic service;
one or more pieces of machine information of machines capable of running micro-service applications to be deployed under each application environment are newly added in a deployment system;
newly adding the micro-service application to be deployed in a deployment system, and acquiring an application code of the micro-service application;
obtaining a service arrangement file based on the service code and the application code;
analyzing the service orchestration file by using a service orchestration analysis engine, determining a deployed application environment and a target deployment machine, and acquiring a service deployment engine; and performing service deployment by using the service deployment engine; if the deployed environment and the target deployment machine cannot be determined by analyzing the service orchestration file, determining the deployed application environment and the target deployment machine by selecting an environment code;
and after the service deployment is successful, generating a micro-service application instance, and running on the target deployment machine.
On the basis of the scheme, the following improvement is also carried out:
further, the initializing an application environment includes:
executing a database initialization application environment script of a background of a deployment system, wherein the database initialization application environment script at least comprises an environment name and an environment code; or, acquiring the input environment name and environment code of the application environment, and directly and newly adding the application environment on an interface of a deployment system.
Further, the initializing basic services of the deployment system includes:
initializing a basic service script by executing a database of a background of the deployment system, so as to realize the basic service of the initial deployment system; the database initialization basic service script at least comprises the following information: service name, service code, service type, service version, service path, default run configuration, service file signature.
Further, the machine is a physical machine, a virtual machine, or a container hosting machine; the machine information includes at least: machine name, account number, password, IP, connection port.
Further, the service orchestration file includes the following:
service orchestration name, service orchestration version, number of instances, mirror name, mirror, memory constraint, dependent service, configuration of operating parameters, operating ports, metadata information;
wherein,,
the mirror image is used for pointing to the application code;
the dependent service refers to a basic service on which the current micro-service application depends or other micro-service applications on the current service arrangement file; the basic service dependency filling mode is as follows: -t+ service coding; other microservice application dependent population approaches are: -d+ application code of other micro-service applications on the current service orchestration file;
the operating parameter configuration includes a deployment to a particular machine, specifying a service deployment engine.
Further, the service orchestration parsing engine parses the service orchestration file by performing the following operations:
if the operation parameter configuration information is configured to be deployed to a specific machine, the specific machine is taken as a target deployment machine, and an application environment matched with the target deployment machine is taken as a deployed application environment;
if the dependent service indicates the basic service on which the current micro-service application depends, acquiring the basic service on which the micro-service application on the service arrangement file depends, and introducing the information of the basic service instance to the current micro-service application; if the dependent service indicates other micro-service applications on the current service arrangement file, information of other micro-service application instances is referenced to the current micro-service application;
a service deployment engine is obtained.
Further, the service deployment engine is obtained by:
if the operation parameter configuration information configures a designated service deployment engine, acquiring the service deployment engine based on the operation parameter configuration information; otherwise, the following operations are performed:
the service orchestration engine detects whether the target deployment machine accords with a container deployment condition, if so, the application code pointed by the mirror image in the service orchestration file is converted into a dockerfile file, the dockerfile file is constructed into a container mirror image, and the container deployment engine is adopted for deployment; otherwise, adopting a native deployment engine to deploy.
Further, the native deployment engine enables service deployment by performing the following operations:
detecting the running environment of a target deployment machine, and determining whether the deployment micro-service application is met; if not, installing the running environment;
detecting whether an operation port of the micro-service application on the service orchestration file is available on the target deployment machine; if the operation port is occupied, applying in a port increment mode until an available port is obtained;
detecting whether a current micro-service application deployment catalog exists in a target deployment machine, and if the current micro-service application deployment catalog does not exist, creating;
updating configuration of micro-service applications to be deployed;
copying the updated micro-service application to a target deployment machine;
generating operation parameters according to information on the operation parameter configuration nodes on the service arrangement file;
and starting the micro-service application and running in the background based on the running parameters.
In another aspect, a service orchestration system based on an application environment is provided for deploying a micro-service application in a deployment system; the system comprises:
the application environment module is used for initializing one or more application environments of the deployment system and acquiring environment codes of the application environments;
the basic service module is used for initializing basic service of the deployment system and acquiring service codes of the basic service;
the machine information storage module is used for adding one or more pieces of machine information of machines capable of running micro-service applications to be deployed in each application environment in the deployment system;
the micro-service application module is used for newly adding the micro-service application to be deployed in the deployment system and acquiring an application code of the micro-service application;
the service arrangement file generation module is used for obtaining a service arrangement file based on the service code and the application code;
the service analysis and deployment module is used for analyzing the service arrangement file by utilizing a service arrangement analysis engine, determining the deployed application environment and the target deployment machine, and acquiring a service deployment engine; and performing service deployment by using the service deployment engine; if the deployed environment and the target deployment machine cannot be determined by analyzing the service orchestration file, determining the deployed application environment and the target deployment machine by selecting an environment code;
and the micro service application instance generating module is used for generating a micro service application instance after the service deployment is successful and operating on the target deployment machine.
On the basis of the scheme, the following improvement is also carried out:
the service arrangement file obtained by the service arrangement file generation module comprises the following contents:
service orchestration name, service orchestration version, number of instances, mirror name, mirror, memory constraint, dependent service, configuration of operating parameters, operating ports, metadata information;
wherein,,
the mirror image is used for pointing to the application code;
the dependent service refers to a basic service on which the current micro-service application depends or other micro-service applications on the current service arrangement file; the basic service dependency filling mode is as follows: -t+ service coding; other microservice application dependent population approaches are: -d+ application code of other micro-service applications on the current service orchestration file;
the operation parameter configuration comprises deployment to a specific machine and a designated service deployment engine;
in the service orchestration parsing and deployment module, a service orchestration parsing engine parses the service orchestration file by performing the following operations:
if the operation parameter configuration information is configured to be deployed to a specific machine, the specific machine is taken as a target deployment machine, and an application environment matched with the target deployment machine is taken as a deployed application environment;
if the dependent service indicates the basic service on which the current micro-service application depends, acquiring the basic service on which the micro-service application on the service arrangement file depends, and introducing the information of the basic service instance to the current micro-service application; if the dependent service indicates other micro-service applications on the current service arrangement file, information of other micro-service application instances is referenced to the current micro-service application;
a service deployment engine is obtained.
The beneficial effects of the invention are as follows:
the service arrangement method based on the application environment can deploy any micro-service application to any application environment, and the arrangement and deployment of the micro-service application in a physical machine, a virtual machine or a container can be flexibly switched only through one set of service arrangement files, so that the defect that the existing service arrangement files can only realize container arrangement is overcome; meanwhile, the method provides a concept of basic service, and the basic service is independent, so that automatic deployment of the basic service is realized; the basic application service does not need to be repeatedly created and deployed, and the micro-service application does not need to care about the creation of the basic service; in addition, the method effectively solves the problem of scattered micro-service examples, provides perfect statistics, monitoring and operation and maintenance functions, reduces operation and maintenance cost and misoperation, improves the utilization rate of the machine, provides flexible scalability and provides convenient API access.
The service arrangement system based on the application environment, which is provided by the invention, is realized based on the same principle as the method, and has the same technical effect.
In the invention, the technical schemes can be mutually combined to realize more preferable combination schemes. Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, like reference numerals being used to refer to like parts throughout the several views.
FIG. 1 is a flowchart of a service orchestration method based on an application environment according to embodiment 1 of the present invention;
fig. 2 is a schematic structural diagram of a service orchestration system based on application environments in embodiment 2 of the present invention.
Detailed Description
Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form a part hereof, and together with the description serve to explain the principles of the invention, and are not intended to limit the scope of the invention.
First, the related terms used in the present embodiment are described as follows:
basic services refer to applications or middleware that can be reused and run stably, such as a configuration center, a user center, a registry, a cache, a database, a message queue, and the like.
The micro service application refers to an application developed based on a micro service framework such as spigcoud or Dubbo.
Physical machines refer to the designation of physical computers with respect to virtual machines. The physical machines provide the virtual machines with a hardware environment, sometimes referred to as a "host" or "host.
Virtual machine (virtual machine), which refers to a complete computer system, such as vmware, running in a completely isolated environment with complete hardware system functionality, emulated by software.
A container, which refers to effectively partitioning the resources of a single operating system into isolated groups to better balance conflicting resource usage requirements, such as docker, among the isolated groups.
Examples refer to the state of a base service or micro-service application after it runs on a physical machine, virtual machine or container, and in colloquial terms, a process of the micro-service application is an example.
Example 1
In one embodiment of the invention, a service orchestration method based on an application environment is disclosed for deploying micro-service applications in a deployment system; the flow chart is shown in fig. 1, and comprises the following steps:
step S1: initializing one or more application environments and basic services of the deployment system, and acquiring an environment code of the application environment and a service code of the basic service; wherein,,
step S11: initializing an application environment;
preferably, initializing the application environment may be achieved by: executing a database initialization application environment script of a background of a deployment system, wherein the database initialization application environment script at least comprises the following information: environment names, environment codes; or, the application environment is directly added on the interface of the deployment system, and at this time, information such as the environment name, the environment code and the like of the newly added application environment needs to be input. The environment code is a unique identification of the application environment, and the environment name is used for interface display throughout the whole deployment system.
It should be noted that, the application environment herein specifically refers to environment variable information that needs to be executed by the micro service application, and may include one or more of the following: development environment, test environment, pre-release environment, production environment, etc.
The deployment system refers to a platform capable of providing micro-service application cloud management and deployment. On a deployment system, the method can realize automatic deployment of various micro services, solve the problem of scattered micro service examples, provide perfect statistics, monitoring and operation and maintenance functions, reduce operation and maintenance cost and misoperation, improve the utilization rate of a machine, provide flexible scalability and provide convenient API access.
Step S12: initializing basic services of a deployment system;
considering that in the prior art, basic services are repeatedly deployed in various environments, if manual repeated operations are required each time, service arrangement efficiency is low, and repeated workload is increased. Therefore, in this implementation, the application or middleware that can be reused and can be stably run is defined as the basic service, and the initialization of the basic service is implemented in advance, so that when the basic service needs to be deployed on the application environment, the deployment system automatically deploys according to the description of the service arrangement file in step 5, without manual pre-operation of deployment. Preferably, according to the above definition, the basic service may include: configuration center, service coding: CONFIG; user center, service coding: USERCENTER; registry, service coding: REGISTER; caching, service coding: CACHE; database, service code: datase; message queue, service coding: MESSAGE, etc.
Specifically, a database initialization basic service script of a background of the deployment system is executed to realize the basic service of the initialization deployment system; the database initialization basic service script at least comprises the following information: service name, service code, service type, service version, service path, default running configuration, service file signature; optionally, the method may further include: a service description; it should be noted that, the basic service initialized in this step may be supported by the service orchestration analysis engine. Meanwhile, after the basic service is analyzed by the service orchestration analysis engine, the basic service can be referenced by deployed micro-service applications. The service code is the unique identifier of the basic service in the deployment system, and the service code penetrates through the whole deployment system.
Step S2: machine information of machines capable of running micro-service applications to be deployed under each application environment is newly added in a deployment system; thereby establishing the association relation between the application environment and the machine information, wherein the association relation can be realized through the environment code of the application environment;
preferably, the machine information includes at least: machine name, account number, password, IP, connection port; may further include: computer room, host CPU core number, memory, hard disk size, operating system version, etc. In the above machine information, the information to be connected to the machine is an essential item (i.e., machine name, account number, password, IP, connection port), and other items can be acquired by executing the command after being connected.
Preferably, when the micro-service application is deployed on the physical machine or the virtual machine, the machine information is the machine information of the physical machine or the virtual machine; when the micro-service application is deployed on the container, the machine information is information of a container host machine, where the host may be a virtual machine or a physical machine.
Step S3: newly adding the micro-service application to be deployed in a deployment system, and acquiring an application code of the micro-service application;
preferably, the micro service application to be deployed can be stored in the deployment system by means of url address downloading or micro service application uploading.
For example, when the micro-service application is stored by a url address downloading manner, the micro-service application is downloaded to a file storage system of a deployment system by the url address, the application address refers to an absolute path of the micro-service application on the file storage system, and the application source is described as downloading by the url; when the micro-service application is stored in a micro-service application uploading mode, the micro-service application is directly uploaded to a file storage system of a deployment system, an application address also refers to an absolute path of the micro-service application corresponding to the file storage system, and an application source is described as being uploaded through a file.
The uploaded micro service application at least comprises the following information: application name, application code, application type, application version, application address, application source, default running configuration, application file signature; optionally, the method may further include: application description. It should be noted that if the uploaded micro service application is built by a standard automatic building tool, the application is as follows: maven, gradle, etc., the deployment system can automatically read information from the micro-service application, including at least: application name, application code, application version, etc. The application code is a unique identifier of the micro-service application in the deployment system, and penetrates through the whole deployment system.
Step S4: obtaining a service orchestration file based on the service code (determined by step S1) and the application code (determined by step S3);
the service orchestration file in this embodiment can be deployed to both a physical machine or a virtual machine and a container. Because most deployment systems in the industry write a service orchestration file on each set of application environments, the service orchestration file written in this way has no versatility in different application environments. In the deployment system, the relationship between the micro-service application and the basic service described by the service arrangement file is used, and the current basic service instance is acquired through the application environment, so that flexible deployment of the micro-service application on each application environment is realized. In this embodiment, one or more micro-service applications may be arranged on one service arrangement file.
Preferably, the written service orchestration file comprises the following:
service orchestration name, service orchestration version, number of instances, mirror name, mirror, memory constraint, dependent service, configuration of operating parameters, operating ports, metadata information; optionally, device mapping, file system mounting, network mode, etc. may also be included;
it should be noted that, in the process of editing a document by a writing service, several key elements need to be noted:
(1) A service orchestration name, a unique identification of the service orchestration file;
(2) A service orchestration version, the service orchestration file version number;
(3) The number of the instances refers to the number of the instances of the micro service application to be deployed, and the parameter greatly improves the flexibility of the deployment of the micro service application;
(4) The mirror name is a unique identifier on the service arrangement file of the current mirror in the embodiment;
(5) Mirror image, pointing to the application code of the newly added micro service application in the step S3;
(6) Memory limitation, filling in the maximum memory that the micro-service application can apply for;
(7) Dependent services refer to the underlying services on which the current microservice application depends or other microservice applications on the current service orchestration file. The basic service dependency filling mode is as follows; t plus the service code of step S1, if the micro-service application relies on a CACHE base service (service code denoted CACHE), then the TCACHE can be described as such. The micro-service application dependency fill-in mode is: d plus application code for other micro-service applications on the current service orchestration file. If on one service orchestration file, two micro-service applications are described, the application of the first micro-service application being encoded as IMG1, the application of the second micro-service application being encoded as IMG2, and the second mirror relying on the first mirror, the second micro-service application may be described as-DIMG 1. It should be noted that other micro-service applications on the current service orchestration file belong to the overall orchestration. For example, a second micro-service application deployed on a current service orchestration file is dependent on the first micro-service application.
(8) And (3) configuring operation parameters, and filling in personalized parameters of the operation of the micro-service application. Wherein the personalization parameters of the micro-service operation include: deployment to a particular machine, opening a GC log, opening remote debugging, specifying a service deployment engine, etc.
(9) The operation port is as follows: after the micro service application is operated, a port for providing service to the outside is provided.
In the practical application process, the yml file editor can be adopted for writing. After writing, a yml format service orchestration file is generated.
Step S5: analyzing the service orchestration file by using a service orchestration analysis engine, determining a deployed application environment and a target deployment machine, and acquiring a service deployment engine; and performing service deployment by using the service deployment engine; if the deployed environment and the target deployment machine cannot be determined by analyzing the service orchestration file, determining the deployed application environment and the target deployment machine by selecting an environment code;
the specific process of the service arrangement analysis engine for analyzing the service arrangement file is as follows:
step S51: the service orchestration analysis engine detects the operation parameter configuration information of the service orchestration file, determines whether a user configures and deploys to a specific machine, if yes, does not select the machine, directly takes the specific machine configured by the user as a target deployment machine, and takes an application environment matched with the target deployment machine as a deployed application environment; otherwise, the service orchestration analysis engine determines the deployed application environment by selecting the environment code, acquires all the deployable machines in the deployed application environment, and selects an optimal machine as a target deployment machine to deploy according to the matching relation between the information such as the memory, CPU, hard disk, network, operating system version and the like of each machine and the minimum condition required by the micro-service application of the current application environment.
Step S52: if the dependent service indicates the basic service on which the current micro-service application depends, acquiring the basic service on which the micro-service application on the service arrangement file depends, and introducing the information of the basic service instance to the current micro-service application;
specifically, whether the basic service instance exists is detected according to the currently deployed application environment. If the basic service instance exists, the information of the basic service instance is led to the current micro-service application, otherwise, the basic service is automatically deployed, the deployed basic service instance is stored in a deployment system, and the information of the basic service instance is led to the current micro-service application;
if the dependent service indicates other micro-service applications on the current service arrangement file, information of other micro-service application instances is referenced to the current micro-service application;
the information of the basic service instance and the information of other micro service application instances at least comprise ip and ports, and also comprise user names, passwords and the like.
Step S53: a service deployment engine is obtained. Specifically, acquiring operation parameter configuration information in the service arrangement file, if the operation parameter configuration information in the service arrangement file configures a designated service deployment engine, indicating that a user configures the service deployment engine, and at the moment, based on the operation parameter configuration information, taking out the service deployment engine required by the user from the operation parameter configuration information; otherwise, the user is indicated to not configure the service deployment engine, and the following operations are executed at this time:
the service orchestration engine detects whether the target deployment machine accords with container deployment conditions (such as whether a linux kernel version is supported or not), if so, the application code pointed by the mirror image in the service orchestration file is converted into a dockerfile file, a container mirror image is constructed, and the container deployment engine is adopted for deployment; otherwise, adopting a native deployment engine to deploy.
The container deployment engine refers to a corresponding deployment mode when deployed on a container; the core principle of the container deployment engine is that kubernetes are developed secondarily. Since this part is prior art, it is not described in detail here.
The native deployment engine refers to a corresponding deployment mode when the native deployment engine is deployed to a physical machine or a virtual machine; the core principle of the original deployment engine is that a plug-in template type framework is adopted, shell command arrangement is carried out on each service to be deployed, and finally ssh is adopted to remotely execute the command arrangement process.
The following describes a procedure for deployment of a micro-service application using a native deployment engine, comprising in particular the steps of:
step S54: and detecting the running environment (referred to as the running environment of the micro service application) of the target deployment machine to determine whether the deployment micro service application is met. Such as detecting whether a JDK is installed or not, and whether the version of JDK is compliant. If not, the installation of the environment is performed. Otherwise, step S55 is performed;
step S55: detecting whether an operation port on a service orchestration file, on which the micro-service application needs to be operated, is available on a target deployment machine; if the port is occupied, applying in a port increment mode until the available port is acquired; otherwise, step S56 is performed;
step S56: detecting whether a current micro-service application deployment catalog exists in the target deployment machine or not, and if not, creating; otherwise, step S57 is performed;
step S57: and updating the configuration of the micro-service application to be deployed. If the current micro service application refers to other micro service application examples of the current arrangement file, the output path of the micro service application log is updated according to the deployment catalog obtained in the last step, and other micro service application example information is backfilled to the configuration of the current micro service application in the current step.
Step S58: and copying the micro-service application updated through the steps to the target deployment machine.
Step S59: and configuring information on the nodes according to the operation parameters on the service arrangement file, and generating the operation parameters. Such as opening GC logs, opening remote debugging, etc.
Step S510: and starting the micro-service application and running in the background based on the running parameters.
Preferably, the service orchestration analysis engine also provides an external service call API interface, facilitating integration of other external systems into the deployment system.
Step S6: and after the service deployment is successful, generating a micro-service application instance, and running on the target deployment machine. It should be noted that when the machine is a container-hosting machine, the micro-service application instance may be specifically described as running on the container.
After the arrangement and deployment are completed, the deployment system can generate daemon process, can monitor whether the process of the micro service application exists or not, and whether the port provides service or not so as to judge whether the deployment is successful or not. After the micro service application is successfully deployed, a process is generated, and the process is a micro service application instance in popular terms.
The method may further comprise the steps of:
step S7: a monitoring interface is provided by the deployment system to monitor the operation of the micro-service application.
For example, abnormal alarm information, running logs, current running states and service health conditions of the application instance can be checked through a monitoring interface.
Example 2
The embodiment provides a service arrangement system based on an application environment, which is used for deploying micro service applications in a deployment system; a schematic structural diagram is shown in fig. 2, and the system includes:
the application environment module is used for initializing one or more application environments of the deployment system and acquiring environment codes of the application environments; the method can also be used for managing data in an application environment and executing operations such as adding, deleting, modifying and the like;
the basic service module is used for initializing basic service of the deployment system and acquiring service codes of the basic service; and can also be used for storing service arrangement, generated instance information data and the like;
the machine information storage module is used for adding one or more pieces of machine information of machines capable of running micro-service applications to be deployed in each application environment in the deployment system;
the micro-service application module is used for newly adding the micro-service application to be deployed in the deployment system and acquiring an application code of the micro-service application;
the service arrangement file generation module is used for obtaining a service arrangement file based on the service code and the application code;
the service analysis and deployment module is used for analyzing the service arrangement file by utilizing a service arrangement analysis engine, determining the deployed application environment and the target deployment machine, and acquiring a service deployment engine; and performing service deployment by using the service deployment engine; if the deployed environment and the target deployment machine cannot be determined by analyzing the service orchestration file, determining the deployed application environment and the target deployment machine by selecting an environment code;
and the micro service application instance generating module is used for generating a micro service application instance after the service deployment is successful and operating on the target deployment machine.
Preferably, the system further comprises a micro service application instance monitoring module for providing a monitoring interface to monitor the running condition of the micro service application;
preferably, the service orchestration file obtained by the service orchestration file generation module comprises the following contents:
service orchestration name, service orchestration version, number of instances, mirror name, mirror, memory constraint, dependent service, configuration of operating parameters, operating ports, metadata information;
wherein,,
the mirror image is used for pointing to the application code;
the dependent service refers to a basic service on which the current micro-service application depends or other micro-service applications on the current service arrangement file; the basic service dependency filling mode is as follows: -t+ service coding; other microservice application dependent population approaches are: -d+ application code of other micro-service applications on the current service orchestration file;
the operating parameter configuration includes a deployment to a particular machine, specifying a service deployment engine.
Preferably, in the service parsing and deploying module, a service orchestration parsing engine parses the service orchestration file by performing the following operations:
if the operation parameter configuration information is configured to be deployed to a specific machine, the specific machine is taken as a target deployment machine, and an application environment matched with the target deployment machine is taken as a deployed application environment;
if the dependent service indicates the basic service on which the current micro-service application depends, acquiring the basic service on which the micro-service application on the service arrangement file depends, and introducing the information of the basic service instance to the current micro-service application; if the dependent service indicates other micro-service applications on the current service arrangement file, information of other micro-service application instances is referenced to the current micro-service application;
a service deployment engine is obtained.
The specific implementation process of the system embodiment of the present invention may be referred to the above method embodiment, and this embodiment is not repeated herein. Since the principle of the embodiment is the same as that of the embodiment of the method, the system also has the corresponding technical effects of the embodiment of the method.
Those skilled in the art will appreciate that all or part of the flow of the methods of the embodiments described above may be accomplished by way of a computer program to instruct associated hardware, where the program may be stored on a computer readable storage medium. Wherein the computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention.

Claims (10)

1. An application environment-based service orchestration method is used for deploying micro-service applications in a deployment system; characterized in that the method comprises the steps of:
initializing one or more application environments and basic services of the deployment system, and acquiring an environment code of the application environment and a service code of the basic service;
one or more pieces of machine information of machines capable of running micro-service applications to be deployed under each application environment are newly added in a deployment system;
newly adding the micro-service application to be deployed in a deployment system, and acquiring an application code of the micro-service application;
obtaining a service arrangement file based on the service code and the application code;
analyzing the service orchestration file by using a service orchestration analysis engine, determining a deployed application environment and a target deployment machine, and acquiring a service deployment engine; and performing service deployment by using the service deployment engine; if the deployed environment and the target deployment machine cannot be determined by analyzing the service orchestration file, determining the deployed application environment and the target deployment machine by selecting an environment code;
and after the service deployment is successful, generating a micro-service application instance, and running on the target deployment machine.
2. The application environment-based service orchestration method according to claim 1, wherein initializing the application environment comprises:
executing a database initialization application environment script of a background of a deployment system, wherein the database initialization application environment script at least comprises an environment name and an environment code; or, acquiring the input environment name and environment code of the application environment, and directly and newly adding the application environment on an interface of a deployment system.
3. The application environment-based service orchestration method according to claim 1, wherein initializing basic services of a deployment system comprises:
initializing a basic service script by executing a database of a background of the deployment system, so as to realize the basic service of the initial deployment system; the database initialization basic service script at least comprises the following information: service name, service code, service type, service version, service path, default run configuration, service file signature.
4. The application environment based service orchestration method according to claim 1, wherein the machine is a physical machine, a virtual machine, or a container hosting machine; the machine information includes at least: machine name, account number, password, IP, connection port.
5. The service orchestration method based on application environments according to any one of claims 1-4, wherein the service orchestration file comprises:
service orchestration name, service orchestration version, number of instances, mirror name, mirror, memory constraint, dependent service, configuration of operating parameters, operating ports, metadata information;
wherein,,
the mirror image is used for pointing to the application code;
the dependent service refers to a basic service on which the current micro-service application depends or other micro-service applications on the current service arrangement file; the basic service dependency filling mode is as follows: -t+ service coding; other microservice application dependent population approaches are: -d+ application code of other micro-service applications on the current service orchestration file;
the operating parameter configuration includes a deployment to a particular machine, specifying a service deployment engine.
6. The application environment-based service orchestration method according to claim 5, wherein the service orchestration analysis engine parses the service orchestration file by:
if the operation parameter configuration information is configured to be deployed to a specific machine, the specific machine is taken as a target deployment machine, and an application environment matched with the target deployment machine is taken as a deployed application environment;
if the dependent service indicates the basic service on which the current micro-service application depends, acquiring the basic service on which the micro-service application on the service arrangement file depends, and introducing the information of the basic service instance to the current micro-service application; if the dependent service indicates other micro-service applications on the current service arrangement file, information of other micro-service application instances is referenced to the current micro-service application;
a service deployment engine is obtained.
7. The application environment based service orchestration method according to claim 6, wherein the service deployment engine is obtained by:
if the operation parameter configuration information configures a designated service deployment engine, acquiring the service deployment engine based on the operation parameter configuration information; otherwise, the following operations are performed:
the service orchestration engine detects whether the target deployment machine accords with a container deployment condition, if so, the application code pointed by the mirror image in the service orchestration file is converted into a dockerfile file, the dockerfile file is constructed into a container mirror image, and the container deployment engine is adopted for deployment; otherwise, adopting a native deployment engine to deploy.
8. The application environment-based service orchestration method according to claim 7, wherein the native deployment engine implements service deployment by performing the following operations:
detecting the running environment of a target deployment machine, and determining whether the deployment micro-service application is met; if not, installing the running environment;
detecting whether an operation port of the micro-service application on the service orchestration file is available on the target deployment machine; if the operation port is occupied, applying in a port increment mode until an available port is obtained;
detecting whether a current micro-service application deployment catalog exists in a target deployment machine, and if the current micro-service application deployment catalog does not exist, creating;
updating configuration of micro-service applications to be deployed;
copying the updated micro-service application to a target deployment machine;
generating operation parameters according to information on the operation parameter configuration nodes on the service arrangement file;
and starting the micro-service application and running in the background based on the running parameters.
9. An application environment-based service orchestration system for deploying micro-service applications in a deployment system; characterized in that the system comprises:
the application environment module is used for initializing one or more application environments of the deployment system and acquiring environment codes of the application environments;
the basic service initialization module is used for initializing basic service of the deployment system and acquiring service codes of the basic service;
the machine information storage module is used for adding one or more pieces of machine information of machines capable of running micro-service applications to be deployed in each application environment in the deployment system;
the micro-service application module is used for newly adding the micro-service application to be deployed in the deployment system and acquiring an application code of the micro-service application;
the service arrangement file generation module is used for obtaining a service arrangement file based on the service code and the application code;
the service analysis and deployment module is used for analyzing the service arrangement file by utilizing a service arrangement analysis engine, determining the deployed application environment and the target deployment machine, and acquiring a service deployment engine; and performing service deployment by using the service deployment engine; if the deployed environment and the target deployment machine cannot be determined by analyzing the service orchestration file, determining the deployed application environment and the target deployment machine by selecting an environment code;
and the micro service application instance generating module is used for generating a micro service application instance after the service deployment is successful and operating on the target deployment machine.
10. The application environment based service orchestration system according to claim 9, wherein,
the service arrangement file obtained by the service arrangement file generation module comprises the following contents:
service orchestration name, service orchestration version, number of instances, mirror name, mirror, memory constraint, dependent service, configuration of operating parameters, operating ports, metadata information;
wherein,,
the mirror image is used for pointing to the application code;
the dependent service refers to a basic service on which the current micro-service application depends or other micro-service applications on the current service arrangement file; the basic service dependency filling mode is as follows: -t+ service coding; other microservice application dependent population approaches are: -d+ application code of other micro-service applications on the current service orchestration file;
the operation parameter configuration comprises deployment to a specific machine and a designated service deployment engine;
in the service orchestration parsing and deployment module, a service orchestration parsing engine parses the service orchestration file by performing the following operations:
if the operation parameter configuration information is configured to be deployed to a specific machine, the specific machine is taken as a target deployment machine, and an application environment matched with the target deployment machine is taken as a deployed application environment;
if the dependent service indicates the basic service on which the current micro-service application depends, acquiring the basic service on which the micro-service application on the service arrangement file depends, and introducing the information of the basic service instance to the current micro-service application; if the dependent service indicates other micro-service applications on the current service arrangement file, information of other micro-service application instances is referenced to the current micro-service application;
a service deployment engine is obtained.
CN202010195229.0A 2020-03-19 2020-03-19 Service arrangement method and system based on application environment Active CN111367534B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010195229.0A CN111367534B (en) 2020-03-19 2020-03-19 Service arrangement method and system based on application environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010195229.0A CN111367534B (en) 2020-03-19 2020-03-19 Service arrangement method and system based on application environment

Publications (2)

Publication Number Publication Date
CN111367534A CN111367534A (en) 2020-07-03
CN111367534B true CN111367534B (en) 2023-05-09

Family

ID=71209043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010195229.0A Active CN111367534B (en) 2020-03-19 2020-03-19 Service arrangement method and system based on application environment

Country Status (1)

Country Link
CN (1) CN111367534B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083912B (en) * 2020-08-17 2024-03-12 山东中创软件商用中间件股份有限公司 Service orchestration intermediate result processing method, device, equipment and storage medium
CN112181439A (en) * 2020-09-24 2021-01-05 中国建设银行股份有限公司 Micro-service deployment method and device, electronic equipment and readable storage medium
CN112491607A (en) * 2020-11-21 2021-03-12 广州西麦科技股份有限公司 Method and system for managing application deployment
CN114721764A (en) * 2020-12-18 2022-07-08 中兴通讯股份有限公司 Service arrangement and deployment method, system, network equipment and storage medium
CN113342464A (en) * 2021-06-19 2021-09-03 南威软件股份有限公司 Application construction deployment method based on container service
CN114816357A (en) * 2022-04-11 2022-07-29 湖南三湘银行股份有限公司 Service arrangement system for serving process bank
WO2024065191A1 (en) * 2022-09-27 2024-04-04 Siemens Aktiengesellschaft Method, apparatus, electronic device, and readable storage medium for orchestrating microservices

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105487870A (en) * 2015-11-30 2016-04-13 中电科华云信息技术有限公司 Cross-infrastructure application environment arrangement method and system
US20180088935A1 (en) * 2016-09-27 2018-03-29 Ca, Inc. Microservices application configuration based on runtime environment
CN110780914B (en) * 2018-07-31 2022-12-27 中国移动通信集团浙江有限公司 Service publishing method and device
CN110286884B (en) * 2019-06-21 2023-10-13 北京百度网讯科技有限公司 Micro-service arrangement method, device, equipment and computer readable storage medium
CN110532020B (en) * 2019-09-04 2023-12-05 中国工商银行股份有限公司 Data processing method, device and system for micro-service arrangement

Also Published As

Publication number Publication date
CN111367534A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN111367534B (en) Service arrangement method and system based on application environment
US8589522B2 (en) Incrementally updatable system software infrastructure for sensor networks
CN107577475B (en) Software package management method and system of data center cluster system
US20210141625A1 (en) Container image building using shared resources
US8892700B2 (en) Collecting and altering firmware configurations of target machines in a software provisioning environment
US9411570B2 (en) Integrating software provisioning and configuration management
US8782204B2 (en) Monitoring hardware resources in a software provisioning environment
US8775578B2 (en) Providing hardware updates in a software environment
US8402123B2 (en) Systems and methods for inventorying un-provisioned systems in a software provisioning environment
US9250672B2 (en) Cloning target machines in a software provisioning environment
US8417926B2 (en) Systems and methods for providing configuration management services from a provisioning server
CN112416524A (en) Implementation method and device of cross-platform CI/CD (compact disc/compact disc) based on docker and kubernets offline
US20100058330A1 (en) Methods and systems for importing software distributions in a software provisioning environment
US20060265469A1 (en) XML based scripting framework, and methods of providing automated interactions with remote systems
JP6464162B2 (en) Method and apparatus for firmware virtualization
CN111459539B (en) Continuous integration pipeline operation method and device based on mirror layering
WO2010113160A1 (en) A method and system for emulating desktop software applications in a mobile communication network
CN111984269A (en) Method for providing application construction service and application construction platform
US11144292B2 (en) Packaging support system and packaging support method
CN112685035A (en) Project development method and device, computer-readable storage medium and electronic device
CN111984270A (en) Application deployment method and system
CN110928554A (en) Deployment method, device, equipment and storage medium
CN116860266A (en) Application containerized deployment method and device, electronic equipment and storage medium
CN117112122A (en) Cluster deployment method and device
CN116244186A (en) Operating system test management method and device and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant