Micro-service operation environment deployment method, system and device and electronic equipment
Through centrally encapsulated software packages and script files, the basic software and containers of the microservice running environment are quickly installed, the version incompatibility problem is solved, the deployment efficiency is improved, and the time cost is reduced, and the enterprise-level application needs are met.
Patent Information
- Application Number
- CN202510399920.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, software operation abnormalities caused by incompatible versions of different infrastructures, diversified installation methods and inconsistent configuration files during the deployment of microservice clusters, resulting in long deployment cycles and low efficiency.
Through the centrally encapsulated software package, the first script file is used to install the basic software and the second script file is used to install the container, integrating the basic software that supports microservices to run and the rapid installation of containers to solve the version incompatibility problem.
It realizes efficient deployment of microservice operation environment, reduces deployment time costs, improves deployment efficiency, and meets the elastic capacity expansion and operation monitoring needs of enterprise-level applications.
Smart Images

Figure CN120448028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a deployment method, system, device, and electronic device for a microservice operating environment. Background Art
[0002] Currently, Kubernetes (an automated container operation and maintenance platform) is the most widely used technology in container clusters, while Spring Boot is the most widely used microservices framework in JavaSE (a programming language and platform). Regarding data storage, MySQL (a relational database management system), Redis (an in-memory data structure storage system), and MongoDB (a document-based database) are also commonly used for structured and unstructured enterprise-level storage databases. Furthermore, RocketMQ (a distributed messaging middleware platform) and OSS (object storage service) storage are essential infrastructure for many enterprise-level applications.
[0003] Existing technologies, when deploying these infrastructures separately, can easily lead to version incompatibility. When deploying microservice clusters, different software cannot communicate due to version incompatibility. Diverse software installation methods and inconsistent configuration files can lead to software anomalies, and cluster deployments can be long and problematic. With the rapid advancement of technology, it's necessary to integrate these infrastructures to meet more complex needs. Summary of the Invention
[0004] In view of the above problems, the present application provides a deployment method for a microservice operating environment, which can integrate the installation of basic software that supports microservice operation and the rapid installation of containers, solve the version incompatibility problem of different basic software, realize integrated installation and deployment, improve the deployment efficiency of the microservice operating environment, and reduce the time cost of deployment.
[0005] In a first aspect, the present application provides a method for deploying a microservice operating environment, the method comprising: receiving a centrally packaged software package, and processing the software package to obtain operating environment deployment data, wherein the operating environment deployment data includes basic software data to be installed and container data to be installed that support the operation of microservices; performing software installation on the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed; and performing container installation on the container data to be installed based on container configuration information by executing a second script file corresponding to the container data to be installed, so as to run the microservice based on the installed basic software through the installed container.
[0006] In the technical solution of the embodiment of the present application, the operating environment deployment data supporting the operation of microservices is obtained through a centrally packaged software package, and the software is installed in accordance with the basic software data to be installed through the first script file, and the container is installed according to the container data to be installed through the second script file, so that the microservices can be run based on the installed basic software through the installed container. This can integrate the installation of basic software supporting the operation of microservices and the rapid installation of containers, solve the problem of incompatibility between versions of different basic software, realize integrated installation and deployment, improve the deployment efficiency of the microservice operating environment, and reduce the time cost of deployment.
[0007] In some embodiments, the basic software data to be installed includes at least one of database software data, cache software data, message middleware software data, and object storage software data. Installing the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed includes: determining the first script file from an installation directory of the basic software data to be installed, and executing the first script file to install the basic software data to be installed.
[0008] In some embodiments, a second script file corresponding to the container data to be installed is executed to perform container installation on the container data to be installed based on the container configuration information, including: configuring the container configuration information in the second script file; executing the second script file to perform container installation on the container data to be installed based on the container configuration information.
[0009] In some embodiments, the method can be applied to any one of multiple physical servers; the container configuration information includes at least one of the cluster master node information, business node information, login information of the physical server, and configuration information of the microservice; based on the container configuration information, the container data to be installed is installed in a container, including: based on the cluster master node information, determining the master physical server as the master node from multiple physical servers, wherein the master physical server is used to schedule and manage the operation of the microservice; based on the business node information, determining the slave physical server running the microservice from multiple physical servers, wherein the slave physical server is used to run the microservice; based on the login information of the physical server and the configuration information of the microservice, the master physical server and the slave physical server are configured to realize the container installation of the container data to be installed.
[0010] In some embodiments, the method can be applied to any one of a plurality of physical servers, each of which is installed with an Ubuntu operating system. Before receiving a centrally packaged software package and processing the software package to obtain operating environment deployment data, the method further includes: any one of the physical servers communicates with the Ubuntu operating systems of the remaining physical servers based on the Ubuntu operating system, so that after basic software and containers are installed on any one of the physical servers, the remaining physical servers communicate with any one of the physical servers to run microservices based on the installed containers and basic software.
[0011] In some embodiments, after executing a second script file corresponding to the container data to be installed to perform container installation on the container data to be installed based on the container configuration information, the method further includes: loading the microservice into the installed container; based on the container, running the microservice according to the configuration information of the microservice, wherein the microservice includes the original microservice and / or the mirror microservice.
[0012] On the other hand, the present application provides a microservice operating environment system, the system including: microservice; a microservice operating environment device, which is communicatively connected with the microservice and the physical server, and the microservice operating environment device is used to provide operating environment deployment data; a physical server, wherein the physical server is used to execute the method of any of the above-mentioned implementation methods.
[0013] On the other hand, the present application provides a deployment device for a microservice operating environment, the device including: a receiving module for receiving a centrally packaged software package and processing the software package to obtain operating environment deployment data, wherein the operating environment deployment data includes basic software data to be installed and container data to be installed that support the operation of microservices; a first installation module for performing software installation on the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed; a second installation module for performing container installation on the container data to be installed based on the container configuration information by executing a second script file corresponding to the container data to be installed, so as to run the microservice based on the installed basic software through the installed container.
[0014] On the other hand, the present application provides an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of any of the above embodiments when executing the computer program.
[0015] On the other hand, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method of any of the above embodiments when the computer program is executed by a processor.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference numerals are used throughout the drawings to represent the same components. In the drawings:
[0018] Figure 1 A flow chart of a method for deploying a microservices operating environment according to an embodiment of the present application is shown;
[0019] Figure 2 A code diagram showing the loading of microservices into a container according to an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of a microservice operating environment system according to an embodiment of the present application is shown;
[0021] Figure 4 A block diagram of a deployment device for a microservice operating environment according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0025] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0026] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0027] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0028] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0029] In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0030] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.
[0031] Currently, Kubernetes containers are the most widely used technology in container clusters, while Spring Boot is the most widely used microservices framework in Java. For data storage, MySQL, Redis, and MongoDB are also commonly used structured and unstructured enterprise-level storage databases. Furthermore, RocketMQ and OSS storage are essential infrastructure for many enterprise-level applications.
[0032] Existing technologies, when deploying these infrastructures separately, can easily lead to version incompatibility. When deploying microservice clusters, different software cannot communicate due to version incompatibility. Diverse software installation methods and inconsistent configuration files can lead to software anomalies, and cluster deployments can be long and problematic. With the rapid advancement of technology, it's necessary to integrate these infrastructures to meet more complex needs.
[0033] In view of this, the present application proposes a deployment method for a microservice operating environment, which can integrate the installation of basic software that supports microservice operation and the rapid installation of containers, solve the version incompatibility problem of different basic software, realize integrated installation and deployment, improve the deployment efficiency of the microservice operating environment, and reduce the time cost of deployment.
[0034] In the technical solution of the embodiment of the present application, the operating environment deployment data supporting the operation of microservices is obtained through a centrally packaged software package, and the software is installed in accordance with the basic software data to be installed through the first script file, and the container is installed according to the container data to be installed through the second script file, so that the microservices can be run based on the installed basic software through the installed container. This can integrate the installation of basic software supporting the operation of microservices and the rapid installation of containers, solve the problem of incompatibility between versions of different basic software, realize integrated installation and deployment, improve the deployment efficiency of the microservice operating environment, and reduce the time cost of deployment.
[0035] The basic software, containers, microservices installed and deployed in this application, as well as the first script file and the second script file for installation are all open source data. The deployment method and device of the microservice operating environment based on this application can integrate and install the basic software and containers that support the operation of microservices, solve the version incompatibility problem of different basic software, improve the efficiency of container installation, and reduce the time cost of deployment.
[0036] Figure 1 A flow chart of a method for deploying a microservice operating environment according to an embodiment of the present application is shown.
[0037] like Figure 1 As shown, the deployment method 100 of the microservice operating environment provided in the embodiment of the present application includes steps S110 to S130.
[0038] Step S110: receiving the centrally packaged software package and processing the software package to obtain the operating environment deployment data, wherein the operating environment deployment data includes the basic software data to be installed and the container data to be installed that support the operation of the microservice.
[0039] Exemplarily, the centrally packaged software package can be, for example, a software package that has been centrally managed in advance and has built-in operating environment related data to be installed (basic software data to be installed and container data to be installed). For example, it can be a compressed package including relevant data, so as to ensure the compatibility of different software versions and realize normal communication between software. The operating environment deployment data can be obtained by receiving a compressed package of relevant files uploaded by the user based on the XShell (terminal simulation software) tool and decompressing it. The operating environment deployment data includes the basic software data to be installed and the container data to be installed that support the operation of microservices. The basic software data to be installed can, for example, include databases, storage, message transmission and other resources required to support the operation of microservices. The container data to be installed can include operating environment data that supports the operation of microservices, for example, it can include a kubernetes (hereinafter referred to as k8s) cluster.
[0040] Step S120 , performing software installation on the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed.
[0041] Exemplarily, the first script file can be an installation program for the basic software data to be installed. It can enter the installation directory of each basic software resource according to the relevant files of the basic software data to be installed, and install them in sequence to install the basic software that supports the operation of microservices.
[0042] Step S130 , performing container installation on the container data to be installed based on the container configuration information by executing a second script file corresponding to the container data to be installed, so as to run the microservice based on the installed basic software through the installed container.
[0043] Exemplarily, the second script file may be a corresponding installation program that includes configuration information of the container data to be installed. The second script file can be used to install the container data to be installed based on the container configuration information. The container configuration information may include cluster orchestration and management information set by the user according to needs, as well as the running microservice configuration information, so as to quickly install the container and deploy the operating environment, so that the microservices can be run based on the installed basic software through the installed container. The containerized deployed operating environment is lightweight and portable.
[0044] In the technical solution of the embodiment of the present application, the operating environment deployment data supporting the operation of microservices is obtained through a centrally packaged software package, and the software is installed in accordance with the basic software data to be installed through the first script file, and the container is installed according to the container data to be installed through the second script file, so that the microservices can be run based on the installed basic software through the installed container. This can integrate the installation of basic software supporting the operation of microservices and the rapid installation of containers, solve the problem of incompatibility between versions of different basic software, realize integrated installation and deployment, improve the deployment efficiency of the microservice operating environment, and reduce the time cost of deployment.
[0045] In another example, the present invention implements a method for deploying a microservices runtime environment based on multiple physical servers running the Ubuntu operating system. Taking six physical servers as an example, the microservices runtime environment can be deployed on any one of the six physical servers, maintaining network connectivity between the six servers. This allows multiple microservices to run on multiple physical servers with a single deployment.
[0046] Exemplarily, the method can be applied to any one of a plurality of physical servers, each of which is installed with an Ubuntu operating system, for example, an Ubuntu 22.0 version of the operating system can be installed. Before receiving a centrally packaged software package and processing the software package to obtain the operating environment deployment data, the network settings of the physical server are completed to ensure normal connection to the Internet. The method also includes: any one physical server communicates with the Ubuntu operating systems of the remaining physical servers based on the Ubuntu operating system, so that after basic software and containers are installed on any one physical server, the remaining physical servers communicate with any one physical server to run microservices based on the installed containers and basic software.
[0047] In the technical solution of the embodiment of the present application, based on multiple physical servers installed with Ubuntu operating systems, the basic software and containers are installed on any one of the physical servers to deploy the operating environment of the microservices. The Ubuntu operating systems of the remaining physical servers communicate with the physical server based on the Ubuntu operating system, so that the microservices are run based on the installed containers and basic software. This can solve the problems of long deployment cycle and many exceptions of the microservice cluster, improve the deployment efficiency of the microservice operating environment, reduce the time cost of deployment, and quickly deploy application microservices.
[0048] Next, we will explain in detail how to deploy the microservice operating environment and run the microservice in the container (cluster) deployed by this method.
[0049] For example, first, a compressed package (software package) uploaded by the user to the physical server through a remote transmission tool can be received. The compressed package may include the operating environment related data to be installed (basic software data to be installed and container data to be installed) that has been centrally managed and built-in in advance, thereby ensuring the compatibility of different software versions and achieving normal communication between software. For example, the compressed package can be uploaded to the / home / Ubuntu / quictstart path of the physical server through the XShell (terminal emulation software) tool, and then the compressed package can be decompressed to obtain the operating environment deployment data for software installation and container installation.
[0050] Exemplarily, the basic software data to be installed includes at least one of database software data, cache software data, message middleware software data, and object storage software data. Based on the received software package, the basic software data to be installed is installed by executing a first script file corresponding to the basic software data to be installed. For example, the first script file can be determined from the installation directory of the basic software data to be installed, and the first script file can be executed to install the basic software data to be installed.
[0051] Specifically, the basic software data to be installed can be the basic software that supports the operation of microservices that is pre-built into the software package, such as databases, caches, message middleware, object storage, etc. based on the jdk8 operating environment. For example, MySQL5.2 (relational database management system) and RocketMQ4.9.2 (distributed message middleware platform) can be used, which can achieve version compatibility through centralized management. The first script file is determined from the installation directory of the basic software data to be installed, and the first script file is executed to install the software for the basic software data to be installed. For example, based on the files in the decompressed software package, according to the shell (command interpreter) script command, the MySQL, Redis, Mongo, ActiveMQ (message queue application server), and Minio (object storage) directories can be automatically entered in sequence, and the "*.sh" files (first script files) in the current directory are executed in sequence to complete the installation and configuration of the basic software.
[0052] In the technical solution of the embodiment of the present application, by determining the first script file from the installation directory of the basic software data to be installed, the database software data, cache software data, message middleware software data, object storage software data, etc. are installed in sequence according to the first script file, and the installation files of each basic component can be integrated to avoid the incompatibility problem of different versions of basic software. The installation scripts of the basic components are programmed, and the configuration files of the basic components can be replaced in a standardized manner, avoiding the problem of software operation abnormalities caused by diversified software installation methods and inconsistent configuration files, realizing integrated installation and deployment, improving the deployment efficiency of the microservice operating environment, and reducing the time cost of deployment.
[0053] Next, we will introduce how to quickly deploy containers to manage and schedule microservice operations.
[0054] Exemplarily, the method can be applied to any one of multiple physical servers; the container configuration information includes at least one of the cluster master node information, business node information, login information of the physical server, and configuration information of the microservice; based on the container configuration information, container installation of the container data to be installed can be performed, for example, including: based on the cluster master node information, determining a master physical server as a master node from multiple physical servers, wherein the master physical server is used to schedule and manage the operation of microservices; based on the business node information, determining a slave physical server running the microservice from multiple physical servers, wherein the slave physical server is used to run the microservice; based on the login information of the physical server and the configuration information of the microservice, configuring the master physical server and the slave physical server to achieve container installation of the container data to be installed.
[0055] Specifically, the container configuration information may include, for example, masterIp (cluster master node information, cluster master node ip list), the cluster master node ip is separated by ",", the nodes are an odd number, for example, it can be 3, the node can be a physical server, based on the cluster master node information, determine the master physical server as the master node from multiple physical servers, the master physical server is used to schedule and manage the operation of microservices, for example, it can monitor and schedule the entire cluster environment; nodeIp (business node information, business node ip list), the business node ip is any number, determine the slave physical server running the microservice from multiple physical servers, the slave physical server can be, for example, the physical server of the business node, which is the physical machine that actually runs the microservice. When the user needs to add a new business node, it can only be done through the master node. Line arrangement and operation; pk (physical server login information, the address of the server login-free certificate file), password (physical server login information, server login password), rootDir (microservice configuration information, the directory where the microservice configuration file is located), based on the physical server login information and microservice configuration information, it can remotely log in to the master physical server and the slave physical server based on the Ubuntu operating system, and perform corresponding configuration to achieve container installation for the container data to be installed, complete the creation of the container, and then realize the integrated deployment of microservices, which can improve the deployment efficiency of the microservice operating environment, ensure security, reduce the time cost of deployment, and meet the requirements of elastic expansion, operation monitoring, data persistence, etc. for application services in enterprise-level applications.
[0056] Exemplarily, executing a second script file corresponding to the container data to be installed to perform container installation on the container data to be installed based on the container configuration information includes: configuring the container configuration information in the second script file; executing the second script file to perform container installation on the container data to be installed based on the container configuration information.
[0057] Specifically, configure the container configuration information in the second script file. For example, you can set the container configuration information by editing the second script file, the cluster master node information, business node information, physical server login information, and microservice configuration information of the container. Then, run the startK8S.sh script (second script file, shell script) for container installation to quickly install the k8s cluster based on the springboot (microservice framework) framework based on the container configuration information, complete the deployment of the operating environment, and perform integrated deployment of microservices. It can quickly install containers, improve the deployment efficiency of the microservice operating environment, reduce the time cost of deployment, and meet the requirements of elastic expansion, operation monitoring, data persistence, etc. for application services in enterprise-level applications.
[0058] In the technical solution of the embodiment of the present application, based on the cluster master node information, a master physical server is determined from multiple physical servers to serve as the master node for scheduling and managing the operation of microservices; based on the business node information, a slave physical server for running microservices is determined from multiple physical servers; based on the login information of the physical server and the configuration information of the microservice, the master physical server and the slave physical server are configured, thereby configuring the container configuration information in the second script file, and by executing the second script file, the container data to be installed is installed in a container based on the container configuration information to complete the creation of the container, thereby quickly deploying the operating environment of the microservice based on the first script file and the second script file, integrating the installation files of various basic components, programming and standardizing the installation scripts of the basic components, being compatible with different versions of basic software installations, and quickly deploying containers, thereby improving the deployment efficiency of the microservice operating environment, ensuring the security of deployment, reducing the time cost of deployment, and meeting the requirements of elastic expansion, operation monitoring, data persistence, etc. for application services in enterprise-level applications.
[0059] Figure 2 A code schematic diagram of loading a microservice into a container according to an embodiment of the present application is shown.
[0060] For example, Figure 2 As shown, after executing the second script file, the container data to be installed is installed based on the container configuration information, and the microservice is loaded into the deployed operating environment and runs. For example, first, the microservice is loaded into the installed container, for example, the configuration information of the microservice (yaml file, related code reference Figure 2 ) is stored in the yaml directory under the rootDir directory of the installed container; then, based on the container, the microservice is run according to the configuration information of the microservice, where the microservice includes the original microservice and / or the mirror microservice. For example, the startPod.sh script (shell script) can be run to run the microservice based on the deployed k8s cluster. The microservice can include the original microservice or the microservice image file downloaded from the public network or other address.
[0061] In the technical solution of the embodiment of the present application, the microservice is loaded into the installed container, and the microservice is run based on the container according to the configuration information of the microservice. It can quickly deploy application microservices based on the quickly installed container and mutually compatible basic software, thereby improving deployment efficiency.
[0062] Figure 3 A schematic diagram of the microservice operating environment system of an embodiment of the present application is shown.
[0063] like Figure 3As shown, the microservice operating environment system 300 provided in an embodiment of the present application includes: a microservice 301, a microservice operating environment device 302, and a physical server 303. The microservice 301; the microservice operating environment device 302, which is in communication with the microservice 301 and the physical server 303 and is configured to provide operating environment deployment data; and the physical server 303, which is configured to execute the method described in any of the above embodiments.
[0064] For example, refer to Figure 3 , microservice 301 can include microservice 1, microservice 2, ... microservice x, etc., microservice 301 (service image) can be the original microservice, or it can be a microservice image file downloaded from the public network or other address; the microservice operating environment device 302 (this device) is used to provide operating environment deployment data, for example, it can provide basic software based on the jdk8 environment: MySQL5.x, Redis, RocketMQ4.9.2, Mongodb4.4.0, Minio, and Sealos (cloud operating system) based on the k8s cluster, the physical server 303 (physical machine) can include multiple, for example, it can include six physical servers 303, which are used to execute the above-mentioned microservice operating environment deployment method, that is, to load the operating environment deployment data and run the microservice 301.
[0065] Exemplarily, based on the microservice operating environment system 300, users can download microservice image files from the public network or other addresses and load them into this device. For example, they can use the sealos pull command to download the image file to the k8s cluster, use the sealos images command to view the image file ID, and use sealos push{id} to push the image file of the corresponding address to the specified location of the container. Then, create a yaml file according to the specified syntax and enter the content of the file on the control interface to run the microservice image in the cluster.
[0066] In the technical solution of the embodiment of the present application, the operating environment deployment data that supports the operation of microservices is provided through a microservice operating environment device, and the operating environment is deployed through a physical server, as well as the scheduling, management and operation of microservices, thereby integrating the installation files and microservices of various basic components, improving deployment efficiency, reducing the time cost of deployment, and quickly deploying microservices.
[0067] Next, an example of quickly deploying a microservice operating environment based on a microservice operating environment system and running the microservice in a created container is described in detail.
[0068] For example, first install the Ubuntu 22.0 version operating system on the physical server and complete the network settings to ensure that the physical server can connect to the Internet normally.
[0069] Then, use the XShell tool to upload the compressed package to a path on any physical server that can communicate with the remaining servers over the network. For example, upload the compressed package to the path: / home / Ubuntu / quictstart and decompress it. The compressed package contains built-in basic software that supports the operation of microservices: database, cache, message middleware, object storage, k8s cluster, etc.
[0070] After decompression, go to the MySQL, Redis, Mongo, ActiveMQ, and Minio directories in turn and execute the *.sh files in the current directory in sequence to complete the installation of the basic software.
[0071] Next, configure the container to be installed by editing the startK8S.sh script and completing the following settings: masterIp (a list of cluster master node IP addresses, separated by ","; the number of nodes is an odd number, for example, 3, i.e., 3 primary physical servers), nodeIp (an arbitrary list of business node IP addresses, i.e., the physical servers where the microservices actually run), pk (the address of the server's login-free certificate file), password (the server login password), rootDir (the directory where the microservice's YAML configuration file is located), and then run the startK8S.sh script to install k8s. This completes the creation of the container, which supports the integrated deployment of microservices.
[0072] Based on the installed basic software and container, store the created microservice YAML file in the YAML directory under the rootDir directory of the container. YAML files can be created by users according to the specified syntax. For the standard YAML format, please refer to Figure 2 .
[0073] Finally, by running the startPod.sh script, the microservice is run into the deployed operating environment, that is, the k8s cluster based on the basic software, to achieve integrated deployment of microservices; among them, the microservice can be a microservice image file downloaded from the public network or other addresses.
[0074] Figure 4 A block diagram of a deployment device for a microservice operating environment according to an embodiment of the present application is shown.
[0075] The present application embodiment provides a deployment device 400 for a microservice operating environment, the device 400 including:
[0076] The receiving module 410 is used to receive the centrally packaged software package and process the software package to obtain the operating environment deployment data, wherein the operating environment deployment data includes the basic software data to be installed and the container data to be installed to support the operation of the microservice.
[0077] The first installation module 420 is configured to install the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed.
[0078] The second installation module 430 is configured to execute a second script file corresponding to the container data to be installed, so as to perform container installation on the container data to be installed based on the container configuration information, so as to run the microservice based on the installed basic software through the installed container.
[0079] Exemplarily, the basic software data to be installed includes at least one of database software data, cache software data, message middleware software data, and object storage software data. The first installation module 420 is also used to: determine a first script file from the installation directory of the basic software data to be installed, and execute the first script file to perform software installation on the basic software data to be installed.
[0080] Exemplarily, the second installation module 430 is further configured to: configure container configuration information in the second script file; and execute the second script file to perform container installation on the container data to be installed based on the container configuration information.
[0081] Exemplarily, the method can be applied to any one of a plurality of physical servers; the container configuration information includes at least one of the cluster master node information, the business node information, the login information of the physical server, and the configuration information of the microservice; the second installation module 430 is also used to: based on the cluster master node information, determine the master physical server as the master node from a plurality of physical servers, wherein the master physical server is used to schedule and manage the operation of the microservice; based on the business node information, determine the slave physical server running the microservice from a plurality of physical servers, wherein the slave physical server is used to run the microservice; based on the login information of the physical server and the configuration information of the microservice, configure the master physical server and the slave physical server to realize container installation of the container data to be installed.
[0082] Exemplarily, the method can be applied to any one of a plurality of physical servers, each of which is installed with an Ubuntu operating system. Before obtaining the operating environment deployment data, the deployment device 400 of the microservice operating environment also includes: a communication module, which is used for any one physical server to communicate with the Ubuntu operating systems of the remaining physical servers based on the Ubuntu operating system, so that after the basic software and containers are installed on any one physical server, the remaining physical servers can run microservices based on the installed containers and basic software by communicating with any one physical server.
[0083] Exemplarily, after executing the second script file corresponding to the container data to be installed to perform container installation on the container data to be installed based on the container configuration information, the deployment device 400 of the microservice operating environment also includes: a microservice running module, used to load the microservice into the installed container; based on the container, running the microservice according to the configuration information of the microservice, wherein the microservice includes the original microservice and / or the mirror microservice.
[0084] Figure 5 A schematic diagram of an electronic device according to an embodiment of the present application is shown.
[0085] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any of the above embodiments are implemented.
[0086] like Figure 5 As shown, for ease of understanding, the embodiment of the present application shows a specific electronic device 500.
[0087] The electronic device 500 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are intended to be examples only and are not intended to limit implementations of the present disclosure described and / or claimed herein.
[0088] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0089] Multiple components in the electronic device 500 are connected to the I / O interface 505, including an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0090] The computing unit 501 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods described above. For example, in some embodiments, any one or more of the methods described above can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of any one or more of the methods described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform any one or more of the methods described above by any other appropriate means (e.g., by means of firmware).
[0091] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.
[0092] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device, or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device, or apparatus and execute the instructions), or in conjunction with such instruction execution systems, devices, or apparatuses. For purposes of this application, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, device, or apparatus, or in conjunction with such instruction execution systems, devices, or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing it in a suitable manner if necessary, and then storing it in a computer memory.
[0093] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. A method for deploying a microservice operating environment, characterized in that: The method comprises: Receiving the centrally packaged software package and processing the software package to obtain runtime environment deployment data, wherein the runtime environment deployment data includes basic software data to be installed and container data to be installed that support the operation of the microservice; Performing software installation on the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed; By executing the second script file corresponding to the container data to be installed, the container data to be installed is installed in a container based on the container configuration information, so that the microservice is run through the installed container based on the installed basic software.
2. The method according to claim 1, characterized in that The basic software data to be installed includes at least one of database software data, cache software data, message middleware software data, and object storage software data. The executing a first script file corresponding to the basic software data to be installed to install the basic software data to be installed includes: The first script file is determined from the installation directory of the basic software data to be installed, and the first script file is executed to perform software installation on the basic software data to be installed.
3. The method according to claim 1, characterized in that The executing a second script file corresponding to the container data to be installed to perform container installation on the container data to be installed based on the container configuration information includes: Configure the container configuration information in the second script file; The second script file is executed to perform container installation on the container data to be installed based on the container configuration information.
4. The method according to claim 1, wherein The method can be applied to any one of a plurality of physical servers; the container configuration information includes at least one of cluster master node information, business node information, physical server login information, and configuration information of the microservice; Performing container installation on the container data to be installed based on the container configuration information includes: Based on the cluster master node information, determine a master physical server as a master node from the multiple physical servers, wherein the master physical server is used to schedule and manage the operation of the microservice; Based on the service node information, determining a slave physical server that runs the microservice from the multiple physical servers, wherein the slave physical server is used to run the microservice; Based on the login information of the physical server and the configuration information of the microservice, the master physical server and the slave physical server are configured to implement container installation of the container data to be installed.
5. The method according to claim 4, characterized in that The method can be applied to any one of the multiple physical servers, each of which is installed with an Ubuntu operating system. Before receiving the centrally packaged software package and processing the software package to obtain the operating environment deployment data, the method further includes: Any one of the physical servers is connected to communicate with the Ubuntu operating systems of the remaining physical servers based on the Ubuntu operating system, so that after the basic software and the container are installed on any one of the physical servers, the remaining physical servers communicate with the any one of the physical servers to run the microservice based on the installed container and the basic software.
6. The method according to claim 4, characterized in that After executing the second script file corresponding to the container data to be installed to perform container installation on the container data to be installed based on the container configuration information, the method further includes: Load the microservice into the installed container; Based on the container, the microservice is run according to the configuration information of the microservice, wherein the microservice includes the original microservice and / or the mirror microservice.
7. A microservice operating environment system, characterized in that: The system comprises: Microservices; A microservice operating environment device is communicatively connected to the microservice and the physical server, and is used to provide operating environment deployment data; A physical server, wherein the physical server is used to execute the method according to any one of claims 1-6.
8. A deployment device for a microservice operating environment, characterized in that: The device comprises: a receiving module, configured to receive the centrally packaged software package and process the software package to obtain runtime environment deployment data, wherein the runtime environment deployment data includes data of basic software to be installed and data of containers to be installed that support the operation of the microservice; A first installation module, configured to install the basic software data to be installed by executing a first script file corresponding to the basic software data to be installed; The second installation module is used to execute a second script file corresponding to the container data to be installed to perform container installation on the container data to be installed based on the container configuration information, so as to run the microservice based on the installed basic software through the installed container.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.