CN115291892A - Method and system for deploying micro service based on Ansible - Google Patents

Method and system for deploying micro service based on Ansible Download PDF

Info

Publication number
CN115291892A
CN115291892A CN202210876645.6A CN202210876645A CN115291892A CN 115291892 A CN115291892 A CN 115291892A CN 202210876645 A CN202210876645 A CN 202210876645A CN 115291892 A CN115291892 A CN 115291892A
Authority
CN
China
Prior art keywords
deployment
service
module
micro
infrastructure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210876645.6A
Other languages
Chinese (zh)
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.)
Hangzhou Arcvideo Technology Co ltd
Original Assignee
Hangzhou Arcvideo Technology 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 Hangzhou Arcvideo Technology Co ltd filed Critical Hangzhou Arcvideo Technology Co ltd
Priority to CN202210876645.6A priority Critical patent/CN115291892A/en
Publication of CN115291892A publication Critical patent/CN115291892A/en
Pending legal-status Critical Current

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to an automatic operation and maintenance technology, and discloses a deployment method and a system of micro-services based on Ansible, which are applied to a micro-service architecture project, wherein a target machine module is used for recording service nodes in a deployment structure project; the global configuration module is used for configuring deployment parameters; the warehouse package management module is used for maintaining an installation package in the micro-service structure project; the deployment plan is used for specifying the micro-service architecture project, and the deployment plan is transmitted to an infrastructure script; the Ansible script is used for executing a task list of the micro-service architecture project; the deployment service module is used for reading the configuration parameters and the deployment plan of the micro-service architecture project in real time and feeding back the configuration parameters and the deployment plan to the interface operation module for operation. The invention uses the infrastructure to span different nodes, and the infrastructure is automatically connected. The deployment planning module autonomously defines the contents to be deployed on the interface, so that the function upgrade and iteration are convenient.

Description

Method and system for deploying micro service based on Ansible
Technical Field
The invention relates to an automatic operation and maintenance technology, in particular to a method and a system for deploying micro services based on an infrastructure.
Background
ANSIBLE is an automated operation and maintenance tool. It accepts a user-defined host list (inventoryy) and a script (playlist) and executes TASKS on the target host according to a script-defined task list (TASKS). The method is very convenient in the field of automatic operation and maintenance, and can sort the fixed operation and maintenance work with various steps into different scripts. To accomplish a variety of automated tasks.
The project of the micro-service architecture has the characteristics of multiple services, dispersed functions, strong interdependency, various operation modes, various service configuration items and the like. Because the project of the micro-service architecture can be split in service granularity, the product iteration is convenient, the expandability is strong, and the micro-service architecture is currently the optimal choice for a plurality of large projects.
A complete set of microservice architecture-like projects often also need to cover various aspects of service governance, and need to contain a series of frames to form an ordered set, as follows: and the basic dependency module is a runtime language environment such as database middleware, cache database middleware, JDK or NODE. Basic service modules such as service discovery, configuration center, message bus, load balancing, capacity interruption and current limitation, data monitoring and the like. And the service modules of the project such as an application gateway, a management background, an operation center, a user center and authority management.
In the prior art, the method comprises the following steps: cn202110984018.X; the micro-service deployment can not span different nodes, and the micro-service deployment can not well perform function upgrade and iteration.
Disclosure of Invention
The invention provides a deployment method and a deployment system based on an infrastructure micro-service, aiming at the problems that the deployment of the micro-service cannot span different nodes and the deployment of the micro-service cannot well perform function upgrading and iteration in the prior art.
In order to solve the technical problem, the invention is solved by the following technical scheme:
the deployment system is applied to a micro-service architecture project and comprises a target machine module, a global configuration module, a warehouse packet management module, a deployment plan module, an anchor script, a deployment service management module and an interface operation module;
the target machine module is used for recording service nodes in the deployment structure project;
the global configuration module is used for configuring deployment parameters and transmitting the configured deployment parameters to the infrastructure script;
the warehouse package management module is used for maintaining an installation package in the micro-service structure project; the installation package comprises a service package or a dependency package;
the deployment plan module is used for appointing a deployment plan of the micro-service architecture project and transmitting the deployment plan to an infrastructure script;
the infrastructure script is used for executing a task list of the micro service architecture project according to the received deployment plan;
the deployment service module is used for reading the configuration parameters and the deployment plan of the micro service architecture project in real time and feeding the configuration parameters and the deployment plan back to the interface operation module for operation.
Preferably, the infrastructure script includes a base dependency deployment, a base service deployment, and a business service deployment.
Preferably, the task list of the basic dependency deployment comprises database deployment, cache data deployment and JDK deployment; the task list of basic service deployment comprises service discovery deployment, configuration center deployment and load balancer deployment; the task list of the business service deployment comprises application gateway deployment, user management deployment and authority center deployment.
Preferably, both the base dependent deployment and the base service deployment take precedence over the business service deployment.
In order to solve the technical problem, the invention also provides a method based on the infrastructure microservice deployment, which is applied to microservice architecture projects and comprises a system based on the infrastructure microservice deployment, wherein the method comprises the following steps:
step 1, recording target machine information in an architecture project, and setting an available port range in the architecture project;
step 2, setting the service configuration item, and transmitting the service configuration item to an infrastructure script; the service configuration item comprises global configuration information, database information and storage information;
step 3, uploading information to a warehouse management module, wherein the uploaded information comprises a basic dependence installation package, a basic service installation package or a business service installation package;
step 4, editing the deployment schedule, and recording the edited deployment schedule to a deployment schedule module;
step 5, executing the Ansine script through a deployment instruction issued by a deployment plan module; and deployment is finished according to a task list of the infrastructure script;
and 6, checking the service state, calling back the deployment state of the micro-service to a deployment plan module according to the call back of the infrastructure script, and recording the state of the micro-service by the deployment plan module, so that the service state in the micro-service architecture project is checked through an interface operation module.
Preferably, the editing deployment schedule comprises a complete project deployment schedule or a partial function iteration deployment schedule; the complete project deployment schedule is generated by one key of the warehouse package management module; and part of the function iteration deployment schedule is selected and generated from the warehouse package management module.
In order to solve the above technical problem, the present invention further provides a storage medium, which includes a storage medium for implementing an infrastructure-based microservice deployment system.
In order to solve the technical problem, the invention further provides an electronic device, which comprises the electronic device based on the infrastructure microservice deployment system.
Due to the adoption of the technical scheme, the invention has the remarkable technical effects that:
the invention supports the deployment of a plurality of servers and a plurality of nodes. The ansable automatically connects a plurality of servers; the deployment planning module autonomously defines the content to be deployed on the interface, and the content can be the whole business service or several selective business services. Thereby facilitating functional upgrade and iteration of the microservice deployment architecture.
The invention has the advantages of more visual interface operation for operation and maintenance personnel, high efficiency and convenient use through an online operation mode, and does not need to learn ansable related knowledge and command line knowledge.
The invention supports the deployment of a plurality of nodes of a plurality of servers, and the service to be deployed is planned to different nodes through the target machine module; therefore, the micro-service architecture project is more stable and conforms to the characteristic that the micro-service architecture is distributed and deployed to a plurality of nodes.
The invention does not need to know the specific service of the micro service, the micro service can be registered into system software in the script, whether the micro service is successfully deployed or not is judged, and the method only needs to check the software state through a system command.
Drawings
FIG. 1 is a schematic of the system of the present invention;
FIG. 2 is a schematic diagram of an Cable script deployment of the present invention;
fig. 3 is a flow chart of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Example 1
The deployment system is applied to a micro-service architecture project and comprises a target machine module, a global configuration module, a warehouse packet management module, a deployment plan module, an anchor script, a deployment service management module and an interface operation module;
the target machine module is used for recording service nodes in the deployment structure project;
a set of complete microservice architecture project needs a plurality of machine nodes to be deployed, and a target machine module is used for inputting SSH information of a plurality of target hosts. Before executing the infrastructure, a target machine host list is generated according to the recorded information. The microservice to be deployed is installed to the specified machine using the nature of the ansable remote execution command.
The global configuration module is used for configuring deployment parameters and transmitting the configured deployment parameters to the infrastructure script;
the global configuration variables before installation are recorded. Such as the access address of the database. If the microservice item is used for unified network storage, the network storage address also needs to be recorded. But also according to microservice information. Customizing entry of item access, etc. The global configuration items of similar projects are managed uniformly through the module;
the warehouse package management module is used for maintaining an installation package in the micro-service structure project; the installation package comprises a service package or a dependency package;
the warehouse package management module is responsible for providing various installation packages of the micro-service items. And uploading the deployment package to be installed by the user through the page. During the deployment process, each task list preferably downloads the installation package from the warehouse to the target machine. Meanwhile, the module can also maintain versions of different services. And on the premise of retrieving different versions, the problem of dependence between the micro-services is solved.
The deployment plan module is used for appointing a deployment plan of the micro-service architecture project and transmitting the deployment plan to an infrastructure script;
based on the micro service package existing in the warehouse, the deployment content of the package is generated, and the deployment content comprises a target machine to be deployed, the version of the deployment package, a port of a specified service, a configuration item used by the specified service and the like. The deployment plan is used to trigger the deployed scripts. Deployment may be triggered manually or may be triggered at specified times to achieve the effect of periodic updates.
The infrastructure script is used for executing a task list of the micro service architecture project according to the received deployment plan;
after receiving the deployment instruction, the infrastructure tool loads a host list and global configuration parameters, and then executes tasks one by one from the infrastructure script according to roles and a task list. The Ansine tool defaults to adopt a plurality of threads, and executes tasks on the host after being remotely connected to the host. The tasks comprise warehouse packet decompression of the microservice, execution of service starting commands, detection of service running states, cleaning of temporary files in the installation process and the like. Each step of the process prints the log into a specific file. After the task is completed, the state can be returned to the deployed service module;
the deployment service module is used for reading the configuration parameters and the deployment plan of the micro-service architecture project in real time and feeding back the configuration parameters and the deployment plan to the interface operation module for operation.
The deployment service module is used for viewing the deployment log in real time and analyzing the problems existing in the deployment process from the log. And after the task list is completely operated, determining the final service operation state. There is a good feedback on project deployment.
The infrastructure script comprises basic dependency deployment, basic service deployment and business service deployment.
The task list of basic dependency deployment comprises database deployment, cache data deployment and JDK deployment; the task list of basic service deployment comprises service discovery deployment, configuration center deployment and load balancer deployment; the task list of business service deployment comprises application gateway deployment, user management deployment and authority center deployment.
And both the basic dependent deployment and the basic service deployment are prior to the business service deployment.
Example 2
On the basis of embodiment 1, this embodiment is a method for deploying based on an infrastructure micro service, and is applied to a micro service architecture project, where the method includes:
step 1, recording target machine information in an architecture project, and setting an available port range in the architecture project;
step 2, setting the service configuration item, and transmitting the service configuration item to an infrastructure script; the service configuration item comprises global configuration information, database information and storage information;
step 3, uploading information to a warehouse management module, wherein the uploaded information comprises a basic dependence installation package, a basic service installation package or a business service installation package;
step 4, editing the deployment schedule, and recording the edited deployment schedule to a deployment schedule module;
step 5, executing the Ansible script through a deployment instruction issued by a deployment plan module; and deployment is finished according to a task list of the infrastructure script;
and 6, checking the service state, calling back the deployment state of the micro-service to a deployment plan module according to the call-back of the infrastructure script, and recording the state of the micro-service by the deployment plan module, so that the service state in the micro-service architecture project is checked through an interface operation module.
Preferably, the editing deployment schedule comprises a complete project deployment schedule or a partial function iteration deployment schedule; the complete project deployment schedule is generated by one key of the warehouse package management module; and the part of function iteration deployment schedule is selected and generated in the warehouse package management module.
Example 3
On the basis of the above embodiment, the embodiment includes a set of interactive script and 5 interfacing operation modules. The interactive script is shown in fig. 1, and includes a host list (Inventory) and script files (Playbooks). The host list is used for recording SSH connection information of different server nodes. The anchor performs related tasks remotely to the server node through the SSH protocol. In the script file, a basic dependency module, a basic service module and a business service module are separated according to different roles (Role), and task lists of corresponding modules are under the roles, such as a task list required by database module deployment, a task list required by Redis deployment and the like. Different modules have different task lists, when a project is deployed, the task lists of the basic dependency module and the basic service module are preferentially deployed, and under the condition that the configuration parameters are prepared, the task lists can be operated one by one according to the sequence of the dependency.
The embodiment also provides an online system, which interfaces parameters required by the execution of the infrastructure through the online page and also operates the work of global configuration through the interface. And packaging the command executed by the firmware into an instruction issued by the background program.
The threshold of using the infrastructure tool is lowered, and meanwhile, the running log and the running state of each microservice can be visually seen. Meanwhile, the online system also provides the function of publishing the plan. The content to be updated and iterated is customized through the release plan, so that not only can the global deployment be carried out when the project is deployed for the first time, but also the service module can be selectively updated when the project function is iterated.
Example 4
On the basis of embodiment 1, this embodiment is a storage medium.
Example 5
On the basis of embodiment 1, this embodiment is an electronic device.

Claims (8)

1. The deployment system is applied to a micro-service architecture project and is characterized by comprising a target machine module, a global configuration module, a warehouse packet management module, a deployment plan module, an infrastructure script, a deployment service management module and an interface operation module;
the target machine module is used for recording service nodes in the deployment structure project;
the global configuration module is used for configuring deployment parameters and transmitting the configured deployment parameters to the infrastructure script;
the warehouse package management module is used for maintaining an installation package in the micro-service structure type project; the installation package comprises a service package or a dependency package;
the deployment plan module is used for appointing a deployment plan of the micro service architecture project and transmitting the deployment plan to an infrastructure script;
the infrastructure script is used for executing a task list of the micro service architecture project according to the received deployment plan;
the deployment service module is used for reading the configuration parameters and the deployment plan of the micro service architecture project in real time and feeding the configuration parameters and the deployment plan back to the interface operation module for operation.
2. The anchor-based microservice deployment system of claim 1, wherein an anchor script comprises a base dependency deployment, a base service deployment, and a business service deployment.
3. The infrastructure-based microservice deployment system of claim 2, wherein the task list of basic dependency deployment comprises database deployment, cache data deployment, JDK deployment; the task list of basic service deployment comprises service discovery deployment, configuration center deployment and load balancer deployment; the task list of business service deployment comprises application gateway deployment, user management deployment and authority center deployment.
4. The infrastructure-based microservice deployment system of claim 3, wherein both the base dependent deployment and the base service deployment take precedence over the business service deployment.
5. The method based on the infrastructure micro-service deployment is applied to the micro-service architecture project and comprises the following steps: the system for deployment based on an infrastructure microservice of any of claims 1-4, the method comprising:
step 1, recording target machine information in an architecture project, and setting an available port range in the architecture project;
step 2, setting the service configuration item, and transmitting the service configuration item to an infrastructure script; the service configuration item comprises global configuration information, database information and storage information;
step 3, uploading information to a warehouse management module, wherein the uploaded information comprises a basic dependence installation package, a basic service installation package or a business service installation package;
step 4, editing the deployment schedule, and recording the edited deployment schedule to a deployment schedule module;
step 5, executing the Ansine script through a deployment instruction issued by a deployment plan module; and deployment is finished according to a task list of the infrastructure script;
and 6, checking the service state, calling back the deployment state of the micro-service to a deployment plan module according to the call-back of the infrastructure script, and recording the state of the micro-service by the deployment plan module, so that the service state in the micro-service architecture project is checked through an interface operation module.
6. The method for infrastructure-based microservice deployment as recited in claim 5, wherein the editing the deployment schedule comprises a full project deployment schedule or a partial function iteration deployment schedule; the complete project deployment schedule is generated by one key of the warehouse package management module; and part of the function iteration deployment schedule is selected and generated from the warehouse package management module.
7. A storage medium comprising a storage medium implementing the infrastructure-based microservice deployment system of claims 1-4.
8. An electronic device comprising an electronic device implementing the infrastructure-based microservice deployment system of claims 1-4.
CN202210876645.6A 2022-07-25 2022-07-25 Method and system for deploying micro service based on Ansible Pending CN115291892A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210876645.6A CN115291892A (en) 2022-07-25 2022-07-25 Method and system for deploying micro service based on Ansible

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210876645.6A CN115291892A (en) 2022-07-25 2022-07-25 Method and system for deploying micro service based on Ansible

Publications (1)

Publication Number Publication Date
CN115291892A true CN115291892A (en) 2022-11-04

Family

ID=83825096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210876645.6A Pending CN115291892A (en) 2022-07-25 2022-07-25 Method and system for deploying micro service based on Ansible

Country Status (1)

Country Link
CN (1) CN115291892A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453266A (en) * 2023-10-31 2024-01-26 北京城建智控科技股份有限公司 Operation and maintenance method, system, electronic equipment and medium based on Ansible

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453266A (en) * 2023-10-31 2024-01-26 北京城建智控科技股份有限公司 Operation and maintenance method, system, electronic equipment and medium based on Ansible

Similar Documents

Publication Publication Date Title
CN110851145B (en) Container arrangement-based edge cloud installation and maintenance method and system
CN107291565B (en) Operation and maintenance visual automatic operation platform and implementation method
US5860012A (en) Installation of application software through a network from a source computer system on to a target computer system
CN109298868B (en) Intelligent dynamic deployment and uninstallation method for mapping image data processing software
CN112269640B (en) Method for realizing life cycle management of container cloud component
US20120005325A1 (en) Systems and methods for automated processing of devices
CN104021078B (en) Software supervision device and method
CN114064213B (en) Quick arranging service method and system based on Kubernets container environment
CN112084008B (en) Method for rapidly deploying cloud pipe system based on container technology
CN112099919B (en) Application service visualization rapid deployment method based on cloud computing API
CN111142881A (en) Kubernets-based charts automation deployment system and method
CN111651352B (en) Warehouse code merging method and device
CN115357198B (en) Mounting method and device of storage volume, storage medium and electronic equipment
CN115098156A (en) Network mode management system and management method
CN115291892A (en) Method and system for deploying micro service based on Ansible
CN102752770A (en) Method and device for polling service system
CN114968272A (en) Algorithm operation method, device, equipment and storage medium
CN111324365A (en) Method and equipment for upgrading super-converged system
CN113849399A (en) Automatic testing system and method for multi-machine cooperative software under multi-localization platform
CN113448947A (en) Method and device for distributed deployment, operation and maintenance of mongo database
CN115129574A (en) Code testing method and device
CN110018846B (en) Automatic operation and maintenance system and operation method thereof
CN111897565A (en) Data processing method, device and equipment based on Internet of things
CN111722853A (en) Method and equipment for deploying installation script
CN116088921A (en) Automatic operation and maintenance management system and method oriented to domestic operation system

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