Micro-service deployment system and method, electronic equipment and storage medium
By introducing a microservice deployment system with multi-host, deployment file management, deployment center and Nacos module in the FDC microservice architecture, the problem of large workload and poor flexibility of manual deployment is solved, and automated deployment and multi-instance management are realized to ensure the stable operation of services.
Patent Information
- Application Number
- CN202411582352.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
When the FDC adopts a microservice architecture, manual deployment is laborious and error-prone, especially for services that require multiple instances to run, manual deployment cannot flexibly turn on and off services. In addition, prior art such as K8s has shortcomings in resource usage and integration difficulty.
Provides a microservice deployment system, including multiple hosts, deployment file management module, deployment center module, and Nacos module. The system pushes deployment packages to the host through Ansible, and uses Nacos to perform service registration and health checks to achieve automated deployment and management.
It enables services in both Linux and Windows environments to be deployed simultaneously, without connecting to a server or using deployment tools. It can be easily managed for service deployment centers that require multiple instances to be deployed to ensure the stable operation of each instance service.
Smart Images

Figure CN119512569A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a microservice deployment system, method, electronic device, and storage medium. Background Art
[0002] In the microservice architecture adopted by FDC, manual deployment is labor-intensive and error-prone. Some services require multiple instances to run, and manual deployment cannot flexibly start and close services. For example, when FDC deploys DC services, each machine needs to deploy a service. Manual deployment is too labor-intensive and inflexible. In the existing technology, service configuration can also be performed through K8s, but the microservice platform, excluding DC, also has about 20 services. Using K8s is a waste of resources, and it is difficult to integrate K8s into the business system, and it is not well suited for business use. Therefore, how to deploy microservices has become a technical issue that cannot be underestimated. Summary of the invention
[0003] In view of this, the purpose of this application is to provide a microservice deployment system, method, electronic device and storage medium, which enables services in both Linux and Windows environments to be deployed simultaneously without connecting to a server or using deployment tools. The service deployment center that needs to deploy multiple instances can be easily managed to ensure the stable operation of each instance service.
[0004] The embodiment of the present application provides a microservice deployment system, characterized in that the microservice deployment system includes multiple hosts, a deployment file management module, a deployment center module and a Nacos module, the Nacos module, the host and the deployment file management module are all communicatively connected to the deployment center module, and the Nacos module is communicatively connected to the host, wherein:
[0005] The deployment center module is used to send a request for obtaining a deployment package for each target instance service to the deployment file management module after receiving deployment requests for different target instance services sent by multiple clients, perform service deployment on each target instance service after receiving the deployment package of each target instance service, push the deployment package to the corresponding host based on Ansible, and send the received health feedback status of each deployment center module to the corresponding client;
[0006] The deployment file management module is used to send the deployment package of each target instance service to the deployment center module after receiving the deployment package acquisition request of each target instance service;
[0007] The host is used to perform service startup processing after receiving the deployment package of each corresponding target instance service, send a service registration request to the Nacos module after the service startup is completed, determine the health feedback status of the target instance service after receiving the service health check instruction, and send the health feedback status to the deployment center module;
[0008] The Nacos module is used to complete the registration of the target instance service based on the service registration request sent by the host, and send a service health check instruction to the host.
[0009] In a possible implementation manner, the microservice deployment system further includes a host management module, and the host management module is communicatively connected with the deployment center module; wherein,
[0010] The host management module is used to receive a request from the deployment center module to set the configuration information of the host corresponding to the client, set the IP address information, port information, user name information and password information of the host, and connect to the host based on Ansible to verify whether the configuration of the host is correct.
[0011] In a possible implementation manner, the deployment center module is further used for:
[0012] After receiving the request for batch deactivation of multiple target instance services sent by the client, batch deactivation processing is performed on the multiple target instance services after the locations of the target instance services are determined.
[0013] In a possible implementation manner, the deployment center module is further used for:
[0014] After receiving the request for changing the configuration information of the target instance service sent by the client, the configuration file of the target instance service in the Nacos module is changed.
[0015] In a possible implementation manner, the deployment center module is further used for:
[0016] Check whether the target instance service version is the latest version;
[0017] If yes, the version of the target instance service is not upgraded;
[0018] If not, the version of the target instance service is directly upgraded.
[0019] In a possible implementation manner, the deployment center module is further used for:
[0020] The memory usage information, CPU consumption information, service status information and version information of the target instance service are displayed.
[0021] The present application also provides a microservice deployment method, which includes:
[0022] After receiving deployment requests for different target instance services sent by multiple clients, the control deployment center module sends a deployment package acquisition request for each target instance service to the deployment file management module;
[0023] After the deployment package of each target instance service is received by the control deployment center module, service deployment is performed on each target instance service, and the deployment package is pushed to the corresponding host based on Ansible;
[0024] After receiving the deployment package of each corresponding target instance service, the control host performs service startup processing, and after the service startup is completed, sends a service registration request to each of the target instance services;
[0025] The control Nacos module completes the registration of the target instance service based on the service registration request sent by the host and sends a service health check instruction to the host. After receiving the service health check instruction, the control host determines the health feedback status of the target instance service and sends the health feedback status to the deployment center module.
[0026] In a possible implementation, after receiving deployment requests for different target instance services sent by multiple clients, before sending a request for obtaining a deployment package for each target instance service to the deployment file management module, the microservice deployment method further includes:
[0027] After the control host management module receives the request sent by the deployment center module to set the configuration information of the host corresponding to the client, it sets the IP address information, port information, user name information and password information of the host, and connects to the host based on Ansible to verify whether the configuration of the host is correct.
[0028] An embodiment of the present application also provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the microservice deployment method as described above are performed.
[0029] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the microservice deployment method as described above are executed.
[0030] The embodiments of the present application provide a microservice deployment system, method, electronic device and storage medium. The microservice deployment system includes multiple hosts, a deployment file management module, a deployment center module and a Nacos module. The Nacos module, the host and the deployment file management module are all in communication with the deployment center module. The Nacos module is in communication with the host. The deployment center module is used to receive deployment requests for different target instance services from multiple clients, send a deployment package acquisition request for each target instance service to the deployment file management module, perform service deployment on each target instance service after receiving the deployment package of each target instance service, and push the deployment package to the relative server based on Ansible. The corresponding host sends the received health feedback status of each deployment center module to the corresponding client; the deployment file management module is used to send the deployment package of each target instance service to the deployment center module after receiving the request to obtain the deployment package of each target instance service; the host is used to perform service startup processing after receiving the deployment package of each corresponding target instance service, send a service registration request to the Nacos module after the service startup is completed, determine the health feedback status of the target instance service after receiving the service health check instruction, and send the health feedback status to the deployment center module; the Nacos module is used to complete the registration of the target instance service based on the service registration request sent by the host, and send a service health check instruction to the host. It realizes that services in both Linux and Windows environments can be deployed simultaneously without connecting to the server or using deployment tools. The service deployment center that needs to deploy multiple instances can be easily managed to ensure the stable operation of each instance service.
[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 One of the structural diagrams of a microservice deployment system provided in an embodiment of the present application;
[0034] Figure 2The second structural diagram of a microservice deployment system provided in an embodiment of the present application;
[0035] Figure 3 An interactive schematic diagram of a microservice deployment system provided in an embodiment of the present application;
[0036] Figure 4 A flowchart of a microservice deployment method provided in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0038] Icons: 100 - microservice deployment system; 110 - host; 120 - deployment file management module; 130 - deployment center module; 140 - Nacos module; 150 - host management module; 500 - electronic device; 510 - processor; 520 - memory; 530 - bus. DETAILED DESCRIPTION
[0039] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0040] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0041] In order to enable those skilled in the art to use the contents of this application, the following implementation method is provided in combination with the specific application scenario of "deploying microservices". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.
[0042] The following methods, devices, electronic devices, or computer-readable storage media of the embodiments of the present application can be applied to any scenario where microservices need to be deployed. The embodiments of the present application are not limited to specific application scenarios. Any solution using a microservice deployment system, method, electronic device, and storage medium provided by the embodiments of the present application is within the protection scope of the present application.
[0043] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of computer processing technology.
[0044] After research, it was found that in the microservice architecture adopted by FDC, manual deployment is labor-intensive and error-prone. Some services require multiple instances to run, and manual deployment cannot flexibly start and close services. For example, when FDC deploys DC services, each machine needs to deploy a service. Manual deployment is too labor-intensive and inflexible. In the existing technology, service configuration can also be performed through K8s, but the microservice platform excludes DC and also has about 20 services. Using K8s is a waste of resources, and it is difficult to integrate K8s into the business system, and it is not well suited for business use. Therefore, how to deploy microservices has become a technical issue that cannot be underestimated.
[0045] Based on this, an embodiment of the present application provides a microservice deployment system, which enables services in both Linux and Windows environments to be deployed simultaneously without connecting to a server or using deployment tools. The service deployment center that needs to deploy multiple instances can be easily managed to ensure the stable operation of each instance service.
[0046] See also Figure 1 , Figure 1 This is one of the structural diagrams of a microservice deployment system provided in an embodiment of the present application. Figure 1 As shown in, the microservice deployment system 100 provided in an embodiment of the present application includes multiple hosts 110, a deployment file management module 120, a deployment center module 130 and a Nacos module 140. The Nacos module 140, the host 110 and the deployment file management module 120 are all communicatively connected to the deployment center module 130, and the Nacos module 140 is communicatively connected to the host 110.
[0047] Specifically, the deployment center module 130 is used to send a deployment package acquisition request for each target instance service to the deployment file management module 120 after receiving deployment requests for different target instance services sent by multiple clients, perform service deployment on each target instance service after receiving the deployment package of each target instance service, push the deployment package to the corresponding host 110 based on Ansible, and send the received health feedback status of each deployment center module 130 to the corresponding client; the deployment file management module 120 is used to send the deployment package of each target instance service to the deployment center module 130 after receiving the deployment package acquisition request for each target instance service; the host 110 is used to perform service startup processing after receiving the deployment package of each corresponding target instance service, send a service registration request to the Nacos module 140 after the service startup is completed, determine the health feedback status of the target instance service after receiving the service health check instruction, and send the health feedback status to the deployment center module 130; the Nacos module 140 is used to complete the registration of the target instance service based on the service registration request sent by the host 110, and send the service health check instruction to the host 110.
[0048] Here, after receiving the deployment requests for different target instance services sent by multiple clients, the deployment center module 130 sends a request for obtaining a deployment package for each target instance service to the deployment file management module 120. The deployment file management module 120 is used to send the deployment package of each target instance service to the deployment center module 130 after receiving the request for obtaining a deployment package for each target instance service. After receiving the deployment package of each target instance service, the deployment center module 130 performs service deployment for each target instance service, and pushes the deployment package to the corresponding host 110 based on Ansible. After receiving the deployment package of each corresponding target instance service, the host 110 performs service startup processing, and after the service startup is completed, sends a service registration request to the Nacos module 140. The Nacos module 140 is used to complete the registration of the target instance service based on the service registration request sent by the host 110, and send a service health check instruction to the host 110. After receiving the service health check instruction, the host 110 determines the health feedback status of the target instance service, and sends the health feedback status to the deployment center module 130. The deployment center module 130 sends the received health feedback status of each deployment center module 130 to the corresponding client.
[0049] The host 110 can be a Windows or Linux operating system.
[0050] Here, the deployment file management module 120 is used to upload the relevant service deployment files to OSS and to control the file version. Windows uploads Zip compressed packages, and Liunx uploads jar packages.
[0051] In a specific embodiment, the deployment center module 130 downloads the deployment package from OSS and uses Ansible to push it to the host 110 that needs to run. Java jar can directly use Ansible to execute the startup command to start the service. The Windows zip compressed package is decompressed to the relevant directory using Ansible, and the configuration file is automatically generated, and the service is started using psexec.exe. When the service is started and Nacos is successfully registered, the service is started and the health check function of Nacos is used to monitor the service status, and the service startup process and status are fed back to the client through Server-Sent Events (SSE) technology.
[0052] In this application, when a new kernel or DC service needs to be added, just right-click on the deployment and select the corresponding service, select the host 110, version, port or machine name, and the deployment center module 130 will deploy the relevant version of the code to the selected host 110 without the need to manually connect to the service for deployment.
[0053] For further information, see Figure 2 , Figure 2 This is a second structural diagram of a microservice deployment system 100 provided in an embodiment of the present application. Figure 2 As shown, the microservice deployment system 100 also includes a host management module 150, and the host management module 150 is communicatively connected to the deployment center module 130; wherein, the host management module 150 is used to receive a request sent by the deployment center module 130 to set the configuration information of the host 110 corresponding to the client, set the IP address information, port information, user name information and password information of the host 110, and connect to the host 110 based on the Ansible to verify whether the configuration of the host 110 is correct.
[0054] Here, after the control host 110 management module receives the request sent by the deployment center module 130 to set the configuration information of the host 110 corresponding to the client, it sets the IP address information, port information, user name information and password information of the host 110, and detects whether Ansible is connected to the configured host 110. If the connection fails, it means that the configuration information of the host 110 is incorrect.
[0055] In a possible implementation manner, the deployment center module 130 is further used for:
[0056] After receiving the request for batch deactivation of multiple target instance services sent by the client, batch deactivation processing is performed on the multiple target instance services after the locations of the target instance services are determined.
[0057] Here, after receiving the request for batch deactivation of multiple target instance services sent by the client, the control deployment center module 130 determines the location of the target instance services and then performs batch deactivation processing on the multiple target instance services. This enables the deployment center module 130 to easily manage services that require the deployment of multiple instances, ensure the stable operation of each instance service, and facilitate batch operations, such as batch deactivation and batch deployment.
[0058] In a possible implementation manner, the deployment center module 130 is further used for:
[0059] After receiving the request for changing the configuration information of the target instance service sent by the client, the configuration file of the target instance service in the Nacos module 140 is changed.
[0060] Here, after the control deployment center module 130 receives the request for changing the configuration information of the target instance service sent by the client, the configuration file of the target instance service in the Nacos module 140 is changed.
[0061] In a possible implementation manner, the deployment center module 130 is further used for:
[0062] Check whether the version of the target instance service is the latest version; if so, do not upgrade the version of the target instance service; if not, directly upgrade the version of the target instance service.
[0063] Here, it is detected whether the version of the target instance service is the latest version; if so, the version of the target instance service is not upgraded; if not, the version of the target instance service is directly upgraded.
[0064] The deployment center module 130 may also delete the deactivated services.
[0065] In a possible implementation manner, the deployment center module 130 is further used for:
[0066] The memory usage information, CPU consumption information, service status information and version information of the target instance service are displayed.
[0067] For further information, see Figure 3 , Figure 3This is a schematic diagram of an interaction of a microservice deployment system provided in an embodiment of the present application. Figure 3 As shown in , multiple clients send deployment requests to the deployment center module. After the deployment center obtains the deployment requests for different target instance services sent by multiple clients, it sends a deployment package request to the deployment file management module. OOS sends the deployment package of each target instance service to the deployment center. The deployment center uses Ansible to push the deployment package to the corresponding host for service deployment. After the host receives the corresponding deployment package of each target instance service, it starts the service. After the service startup is completed, it sends a service registration request to Nacos. Nacos completes the registration of the target instance service and sends a service health check instruction to the host. After receiving the service health check instruction, the host determines the health feedback status of the target instance service and sends the health feedback status to the deployment center. The deployment center module sends the health feedback status to the client through Server-Sent Events (SSE).
[0068] In this application, the deployment center provides a unified interface so that services in both Linux and Windows environments can be deployed on the FDC management terminal without connecting to a server or using deployment tools. And for services that need to deploy multiple instances, the deployment center can easily manage and ensure the stable operation of each instance, while facilitating batch operations such as updates and restarts. The automated deployment process reduces human errors and provides flexible configuration options to adjust deployment strategies according to different environments and needs.
[0069] The embodiment of the present application provides a microservice deployment system, the microservice deployment system includes multiple hosts, a deployment file management module, a deployment center module and a Nacos module, the Nacos module, the host and the deployment file management module are all in communication with the deployment center module, the Nacos module is in communication with the host, wherein the deployment center module is used to send a deployment package acquisition request for each target instance service to the deployment file management module after receiving deployment requests for different target instance services sent by multiple clients, perform service deployment on each target instance service after receiving the deployment package of each target instance service, push the deployment package to the corresponding host based on Ansible, and receive the received The received health feedback status of each deployment center module is sent to the corresponding client; the deployment file management module is used to send the deployment package of each target instance service to the deployment center module after receiving the deployment package request of each target instance service; the host is used to start the service after receiving the deployment package of each corresponding target instance service, send a service registration request to the Nacos module after the service startup is completed, determine the health feedback status of the target instance service after receiving the service health check instruction, and send the health feedback status to the deployment center module; the Nacos module is used to complete the registration of the target instance service based on the service registration request sent by the host, and send a service health check instruction to the host. It realizes that services in both Linux and Windows environments can be deployed simultaneously without connecting to the server or using deployment tools. The service deployment center that needs to deploy multiple instances can be easily managed to ensure the stable operation of each instance service.
[0070] See also Figure 4 , Figure 4 This is a flow chart of a microservice deployment method provided in an embodiment of the present application. Figure 4 As shown in , the microservice deployment method provided in the embodiment of the present application includes:
[0071] S401: After receiving deployment requests for different target instance services sent by multiple clients, the control deployment center module sends a deployment package acquisition request for each target instance service to the deployment file management module.
[0072] In this step, after receiving deployment requests for different target instance services sent by multiple clients, the control deployment center module sends a deployment package acquisition request for each target instance service to the deployment file management module.
[0073] S402: After the deployment package of each target instance service is received by the control deployment center module, service deployment is performed on each target instance service, and the deployment package is pushed to the corresponding host based on Ansible.
[0074] In this step, the control deployment center module receives the deployment package of each target instance service and deploys the service for each target instance service, and uses Ansible to push the deployment package to the corresponding host.
[0075] S403: After receiving the deployment package of each corresponding target instance service, the control host performs service startup processing, and after the service startup is completed, sends a service registration request to each target instance service.
[0076] In this step, the control host performs service startup processing after receiving the corresponding deployment package of each target instance service, and after the service startup is completed, sends a service registration request to each target instance service.
[0077] S404: Control the Nacos module to complete the registration of the target instance service based on the service registration request sent by the host and send a service health check instruction to the host. After receiving the service health check instruction, the control host determines the health feedback status of the target instance service and sends the health feedback status to the deployment center module.
[0078] In this step, the control Nacos module completes the registration of the target instance service after using the service registration request sent by the host and sends a service health check instruction to the host. After receiving the service health check instruction, the control host determines the health feedback status of the target instance service and sends the health feedback status to the deployment center module.
[0079] In a possible implementation, after receiving deployment requests for different target instance services sent by multiple clients, before sending a request for obtaining a deployment package for each target instance service to the deployment file management module, the microservice deployment method further includes:
[0080] After the control host management module receives the request sent by the deployment center module to set the configuration information of the host corresponding to the client, it sets the IP address information, port information, user name information and password information of the host, and connects to the host based on Ansible to verify whether the configuration of the host is correct.
[0081] In a possible implementation manner, the microservice deployment method further includes:
[0082] After receiving the request for batch deactivation of multiple target instance services sent by the client, the control deployment center module determines the locations of the target instance services and then performs batch deactivation processing on the multiple target instance services.
[0083] In a possible implementation manner, the microservice deployment method further includes:
[0084] After the deployment center module receives a request for changing the configuration information of the target instance service sent by the client, the configuration file of the target instance service in the Nacos module is changed.
[0085] In a possible implementation manner, the microservice deployment method further includes:
[0086] The control center module detects whether the version of the target instance service is the latest version;
[0087] If yes, the version of the target instance service is not upgraded;
[0088] If not, the version of the target instance service is directly upgraded.
[0089] In a possible implementation manner, the microservice deployment method further includes:
[0090] The control deployment center module displays the memory usage information, CPU consumption information, service status information and version information of the target instance service.
[0091] A microservice deployment method provided by an embodiment of the present application comprises: after the control deployment center module receives the deployment requests for different target instance services sent by multiple clients, the control deployment center module sends a request for obtaining a deployment package for each target instance service to the deployment file management module; after the control deployment center module receives the deployment package of each target instance service, the control deployment package is deployed for each target instance service, and the deployment package is pushed to the corresponding host based on Ansible; after the control host receives the deployment package of each corresponding target instance service, the control host performs service startup processing, and after the service startup is completed, the control host performs service registration request for each target instance service; after the control Nacos module completes the registration of the target instance service based on the service registration request sent by the host and sends a service health check instruction to the host, the control host determines the health feedback status of the target instance service after receiving the service health check instruction, and sends the health feedback status to the deployment center module. It is realized that services in both Linux and Windows environments can be deployed at the same time without connecting to a server or using a deployment tool. For the service deployment center that needs to deploy multiple instances, it can be easily managed to ensure the stable operation of each instance service.
[0092] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0093] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 4 The steps of the microservice deployment method in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0094] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 4 The steps of the microservice deployment method in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0095] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0096] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0097] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0098] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0099] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0100] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A microservice deployment system, characterized in that: The microservice deployment system includes multiple hosts, a deployment file management module, a deployment center module and a Nacos module. The Nacos module, the host and the deployment file management module are all communicatively connected to the deployment center module, and the Nacos module is communicatively connected to the host, wherein: The deployment center module is used to send a request for obtaining a deployment package for each target instance service to the deployment file management module after receiving deployment requests for different target instance services sent by multiple clients, perform service deployment on each target instance service after receiving the deployment package of each target instance service, push the deployment package to the corresponding host based on Ansible, and send the received health feedback status of each deployment center module to the corresponding client; The deployment file management module is used to send the deployment package of each target instance service to the deployment center module after receiving the deployment package acquisition request of each target instance service; The host is used to perform service startup processing after receiving the deployment package of each corresponding target instance service, send a service registration request to the Nacos module after the service startup is completed, determine the health feedback status of the target instance service after receiving the service health check instruction, and send the health feedback status to the deployment center module; The Nacos module is used to complete the registration of the target instance service based on the service registration request sent by the host, and send a service health check instruction to the host.
2. The microservice deployment system according to claim 1, characterized in that: The microservice deployment system also includes a host management module, which is communicatively connected to the deployment center module; wherein, The host management module is used to receive a request from the deployment center module to set the configuration information of the host corresponding to the client, set the IP address information, port information, user name information and password information of the host, and connect to the host based on Ansible to verify whether the configuration of the host is correct.
3. The microservice deployment system according to claim 1, characterized in that: The deployment center module is also used for: After receiving the request for batch deactivation of multiple target instance services sent by the client, batch deactivation processing is performed on the multiple target instance services after determining the locations of the target instance services.
4. The microservice deployment system according to claim 1, characterized in that: The deployment center module is also used for: After receiving the request for changing the configuration information of the target instance service sent by the client, the configuration file of the target instance service in the Nacos module is changed.
5. The microservice deployment system according to claim 1, characterized in that: The deployment center module is also used for: Check whether the target instance service version is the latest version; If yes, the version of the target instance service is not upgraded; If not, the version of the target instance service is directly upgraded.
6. The microservice deployment system according to claim 1, characterized in that: The deployment center module is also used for: The memory usage information, CPU consumption information, service status information and version information of the target instance service are displayed.
7. A microservice deployment method, characterized in that: The microservice deployment method is applied to the microservice deployment system according to any one of claims 1 to 6, and the microservice deployment method includes: After receiving deployment requests for different target instance services sent by multiple clients, the control deployment center module sends a deployment package acquisition request for each target instance service to the deployment file management module; After the deployment package of each target instance service is received by the control deployment center module, service deployment is performed on each target instance service, and the deployment package is pushed to the corresponding host based on Ansible; After receiving the deployment package of each corresponding target instance service, the control host performs service startup processing, and after the service startup is completed, sends a service registration request to each of the target instance services; The control Nacos module completes the registration of the target instance service based on the service registration request sent by the host and sends a service health check instruction to the host. After receiving the service health check instruction, the control host determines the health feedback status of the target instance service and sends the health feedback status to the deployment center module.
8. The microservice deployment method according to claim 7, characterized in that: After receiving deployment requests for different target instance services sent by multiple clients, before sending a request for obtaining a deployment package for each target instance service to the deployment file management module, the microservice deployment method further includes: After the control host management module receives the request sent by the deployment center module to set the configuration information of the host corresponding to the client, it sets the IP address information, port information, user name information and password information of the host, and connects to the host based on Ansible to verify whether the configuration of the host is correct.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the microservice deployment method as described in claim 7 or 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the microservice deployment method according to claim 7 or 8 are executed.