Deployment method, system, device and storage medium of distributed cluster system
By analyzing the deployment instructions, loading configuration information and execution deployment task sets, the problems of time and effort and configuration error of the deployment of the multi -regional distributed cluster system have been solved, and the efficient and reliable deployment and upgrade process has been achieved.
Patent Information
- Application Number
- CN202110485404.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-04-30
AI Technical Summary
The prior art is time-consuming and labor-intensive when deploying distributed cluster systems in multiple regions, and it is prone to configuration errors. When upgrading the system, it is necessary to upgrade and configure each region one by one, which increases the workload and configuration error rate of deployment personnel.
By analyzing the receiving deployment instructions, obtain the system version and deployment area of the distributed cluster system to be deployed, load the corresponding configuration information, obtain the corresponding deployment task set of the system version, and control each deployment task. The node device specified by the hosts file is performed to complete the deployment of the distributed cluster system.
It realizes efficient and reliable multi-region deployment of distributed cluster systems, reduces the workload of deployment personnel, reduces the configuration error rate, and improves the efficiency of system deployment.
Smart Images

Figure CN113220451B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software deployment, and in particular to a deployment method, system, device and storage medium of a distributed cluster system. Background Art
[0002] A distributed cluster system usually includes multiple node devices (such as computer devices). When deploying a distributed cluster system, each node device needs to be configured one by one. With the continuous development of the application requirements of distributed cluster systems, it is often necessary to deploy the same distributed cluster system in different regions. The current deployment method for multi-region distributed cluster systems is mainly that the deployment personnel first deploy the distributed cluster system in one region, then copy the configuration information after the system is deployed, modify the relevant parameters in the configuration information according to the deployment environment of other regions, and use the modified configuration information to deploy the system. This deployment method is not only time-consuming and labor-intensive, but also prone to configuration errors. Summary of the invention
[0003] In order to overcome the above-mentioned defects, the present invention is proposed to provide a distributed cluster system deployment method, system, device and storage medium that solves or at least partially solves the technical problem of how to efficiently and reliably deploy multi-region software.
[0004] In a first aspect, a deployment method of a distributed cluster system is provided, the method comprising:
[0005] Parse the received deployment instructions to obtain the system version and deployment area of the distributed cluster system to be deployed;
[0006] Loading configuration information corresponding to the deployment area, wherein the configuration information includes hosts files and environment variables of node devices in the distributed cluster system to be deployed;
[0007] Obtaining a deployment task set corresponding to the system version;
[0008] Each deployment task in the deployment task set is controlled to be executed on the node device specified in the hosts file in turn using the environment variables according to their respective execution order, so as to complete the deployment of the distributed cluster system to be deployed.
[0009] In a technical solution of the above-mentioned distributed cluster system deployment method, the deployment task set includes a main deployment task set, and the main deployment task set is a playbook file generated based on the Ansible Playbook engine and determined according to one or more main deployment tasks corresponding to the system application of the system version;
[0010] The step of “controlling each deployment task in the deployment task set to be executed in the respective execution order, using the environment variables in sequence on the node devices specified in the hosts file” specifically includes:
[0011] The Ansible Playbook engine is used to call the roles file associated with the playbook file, and by executing the roles file, each of the main deployment tasks is executed on the node devices specified in the hosts file in sequence using the environment variables in their respective execution order.
[0012] In a technical solution of the above-mentioned distributed cluster system deployment method, the deployment task set includes an auxiliary deployment task set, and the auxiliary deployment task set is a Manifests file generated by one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version;
[0013] The step of “controlling each deployment task in the deployment task set to be executed in the respective execution order, using the environment variables in sequence on the node devices specified in the hosts file” specifically includes:
[0014] Parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function;
[0015] By executing the roles file, each of the auxiliary deployment tasks is executed on the node device specified in the hosts file in turn using the environment variables according to their respective execution orders.
[0016] In a technical solution of the above-mentioned distributed cluster system deployment method, the method further includes: obtaining and storing the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment;
[0017] And / or, the method further comprises: in response to the received information entry instruction, acquiring and storing configuration information of the deployment area specified in the information entry instruction;
[0018] And / or, the method further comprises: in response to the received plug-in setting instruction, setting a plug-in program of the distributed cluster system to be deployed;
[0019] And / or, the deployment instruction is an instruction received via a data interface encapsulated by Makefile;
[0020] And / or, the environment variables include global variables, global group variables, group variables, private variables and default variables; the global variables are variables available in the Ansible Playbook engine that can be assigned to each node device in the hosts file; the global group variables are variables available in the Ansible Playbook engine that can be assigned to each node device in each preset node device group in the hosts file; the group variables are variables available in the Ansible Playbook engine that can be assigned to each node device in one or more specified preset node device groups; the private variables are available variables that can be assigned to a specified role file in a specified roles file; the default variables are default available variables for a specified role file in the roles file.
[0021] In a second aspect, a deployment system of a distributed cluster system is provided, the system comprising:
[0022] An instruction receiving / parsing module, which is configured to parse the received deployment instruction to obtain the system version and deployment area of the distributed cluster system to be deployed;
[0023] A configuration information loading module, configured to load configuration information corresponding to the deployment area, wherein the configuration information includes hosts files and environment variables of node devices in the distributed cluster system to be deployed;
[0024] A deployment task set acquisition module, configured to acquire a deployment task set corresponding to the system version;
[0025] The system deployment module is configured to control each deployment task in the deployment task set to be executed in their respective execution order, and to use the environment variables in sequence to execute on the node devices specified in the hosts file, so as to complete the deployment of the distributed cluster system to be deployed.
[0026] In a technical solution of the deployment system of the above-mentioned distributed cluster system, the deployment task set includes a main deployment task set, and the main deployment task set is a playbook file generated based on the Ansible Playbook engine and determined according to one or more main deployment tasks corresponding to the system application of the system version;
[0027] The system deployment module is further configured to perform the following operations:
[0028] The Ansible Playbook engine is used to call the roles file associated with the playbook file, and by executing the roles file, each of the main deployment tasks is executed on the node devices specified in the hosts file in sequence using the environment variables in their respective execution order.
[0029] In a technical solution of the deployment system of the above-mentioned distributed cluster system, the deployment task set includes an auxiliary deployment task set, and the auxiliary deployment task set is a Manifests file generated by one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version;
[0030] The system deployment module is further configured to perform the following operations:
[0031] Parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function;
[0032] By executing the roles file, each of the auxiliary deployment tasks is executed on the node device specified in the hosts file in turn using the environment variables according to their respective execution orders.
[0033] In a technical solution of the deployment system of the above-mentioned distributed cluster system, the system further includes a running time recording module and / or a regional environment configuration module and / or a plug-in setting module;
[0034] The running time recording module is configured to obtain and store the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment;
[0035] The regional environment configuration module is configured to, in response to a received information entry instruction, obtain and store configuration information of a deployment area specified in the information entry instruction;
[0036] The plug-in setting module is configured to set the plug-in program of the distributed cluster system to be deployed in response to the received plug-in setting instruction;
[0037] And / or, the instruction receiving / parsing module includes a data interface formed by Makefile encapsulation;
[0038] And / or, the environment variables include global variables, global group variables, group variables, private variables and default variables; the global variables are variables available in the Ansible Playbook engine that can be assigned to each node device in the hosts file; the global group variables are variables available in the Ansible Playbook engine that can be assigned to each node device in each preset node device group in the hosts file; the group variables are variables available in the Ansible Playbook engine that can be assigned to each node device in one or more specified preset node device groups; the private variables are available variables that can be assigned to a specified role file in a specified roles file; the default variables are default available variables for a specified role file in the roles file.
[0039] According to a third aspect, a control device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the distributed cluster system deployment method described in any one of the technical solutions of the above-mentioned distributed cluster system deployment method.
[0040] In a fourth aspect, a computer-readable storage medium is provided, which stores a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the distributed cluster system deployment method described in any one of the technical solutions of the above-mentioned distributed cluster system deployment method.
[0041] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0042] In the technical solution for implementing the present invention, the steps of the distributed cluster system deployment method may include: parsing the received deployment instructions to obtain the system version and deployment area of the distributed cluster system to be deployed; loading the configuration information corresponding to the deployment area, wherein the configuration information includes the hosts file and environment variables of the node devices in the distributed cluster system to be deployed; obtaining the deployment task set corresponding to the system version; controlling each deployment task in the deployment task set to be executed in their respective execution order, and using the environment variables in sequence on the node devices specified in the hosts file to complete the deployment of the distributed cluster system to be deployed.
[0043] Based on the above implementation, the deployment personnel only need to input the system version of the distributed cluster system to be deployed and the configuration information of the deployment area, and then the distributed cluster system of the corresponding system version can be deployed in the deployment area according to the configuration information. In addition, since the deployment method of the distributed cluster system according to the embodiment of the present invention can be completely automatically executed by a computer device such as a processor, in actual application, the deployment personnel only need to ensure the correctness of the input information to conveniently and accurately complete the deployment of the distributed cluster system, which greatly reduces the workload of the deployment personnel and the error rate of the system configuration, and improves the efficiency of system deployment.
[0044] Furthermore, deployment personnel can enter configuration information of multiple deployment areas at the same time. The deployment method of the distributed cluster system according to an embodiment of the present invention can deploy the distributed cluster system in each deployment area in a parallel or serial manner according to the configuration information of each deployment area, thereby further improving the efficiency of system deployment.
[0045] Furthermore, when it is necessary to upgrade the distributed cluster system, the deployment personnel only need to determine the system version to be upgraded. The deployment method according to the embodiment of the present invention can obtain the deployment task set of this system version, and then according to the configuration information of the deployment area of the distributed cluster system to be deployed, the distributed cluster system can be deployed again by executing the deployment tasks in the deployment task set. In this way, the upgrade of the distributed cluster system can be completed. There is no need for the deployment personnel to upgrade and configure the distributed cluster system in each deployment area one by one, which further reduces the workload of the deployment personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. Among them:
[0047] Figure 1 is a schematic flow chart of main steps of a method for deploying a distributed cluster system according to an embodiment of the present invention;
[0048] Figure 2 is a schematic flow chart of main steps of a method for deploying a distributed cluster system according to another embodiment of the present invention;
[0049] Figure 3 is a schematic flow chart of main steps of a method for deploying a distributed cluster system according to yet another embodiment of the present invention;
[0050] Figure 4 is a main structural block diagram of a partial system of a distributed cluster system according to an embodiment of the present invention;
[0051] Figure 5 It is a main structural block diagram of a partial system of a distributed cluster system according to another embodiment of the present invention.
[0052] List of reference numerals:
[0053] 11: Instruction receiving / parsing module; 12: Configuration information loading module; 13: Deployment task set acquisition module; 14: System deployment module. DETAILED DESCRIPTION
[0054] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0055] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B. The singular terms "one" and "the" may also include plural forms.
[0056] Here we first explain some terms involved in the present invention.
[0057] Engine refers to the supporting part of a computer program or a system, while Ansible Playbook Engine is an engine that can provide a set of internal components for Ansible Playbook to support services. Ansible is a conventional automated operation and maintenance tool developed based on Python in the field of computer technology, and Playbook is an operation mode in Ansible where the control host operates on the controlled nodes, i.e., the script mode. Playbook can complete a class of functions through multiple task sets, such as the installation and deployment of Web services. Playbook is a configuration file that combines multiple ad-hoc (point-to-point mode) operations, and can therefore be described as a playbook file.
[0058] The roles file refers to a role file configured using the Role configuration function in the Ansible Playbook engine, wherein the roles file may include one or more roles. It should be noted that in the embodiment of the present invention, the conventional method in Ansible can be used to set the playbook file and the roles file. For the sake of simplicity, the specific method and principle of setting the playbook file and the roles file will not be repeated here.
[0059] Manifest refers to an XML file (Manifests file) with a .manifest suffix in the field of computer technology. Manifest can organize and describe isolated applications and parallel components. It should be noted that in the embodiment of the present invention, the conventional setting method in the field of computer technology can be used to set the Manifests file. For the sake of brevity, the specific method and principle of setting the Manifests file will not be repeated here.
[0060] The hosts file is a computer file in the field of computer technology used to store node information of each node in a computer network. In an embodiment of the present invention, the hosts file refers to a file used to store device information of node devices in a distributed cluster system to be deployed. The information stored in the hosts file can accurately determine which node devices are included in the distributed cluster system to be deployed.
[0061] Environment variables refer to some parameters in the computer technology field used to specify the operating environment of the operating system. In the embodiment of the present invention, environment variables refer to the parameters of the system operating environment of the distributed cluster system to be deployed.
[0062] Makefile refers to a file in the field of computer technology that can describe the relationship between source programs and automatically maintain compilation work to implement the functions of the Make tool.
[0063] API service refers to a service that is implemented using API (Application Programming Interface) technology and can support the functions of the distributed cluster system to be deployed.
[0064] System applications refer to applications that are essential for the normal operation of the distributed cluster system to be deployed, such as the operating system (OS) of the distributed cluster system to be deployed.
[0065] Auxiliary business functions refer to business functions that can be additionally deployed on the premise of ensuring the normal operation of the distributed cluster system to be deployed, so as to enrich the functions of the distributed cluster system to be deployed.
[0066] At present, the traditional deployment method for distributed cluster systems in multiple regions often requires the deployment personnel to first deploy the distributed cluster system in one region, then copy the configuration information after the system is deployed, modify the relevant parameters in the configuration information according to the deployment environment of other regions, and use the modified configuration information to deploy the system. Therefore, this deployment method is not only time-consuming and labor-intensive, but also very prone to configuration errors. In addition, if the system is upgraded after the system is deployed (such as repairing system defects and / or increasing or decreasing system functions), the deployment personnel are still required to upgrade and configure the distributed cluster system of each deployment area one by one, further increasing the workload of the deployment personnel and the error rate of the system configuration. According to the deployment method of the distributed cluster system of the embodiment of the present invention, the distributed cluster systems deployed in different regions can be deployed at the same time, which significantly improves the multi-region deployment efficiency of the distributed cluster system and reduces the workload of the deployment personnel. At the same time, the deployment method according to the embodiment of the present invention can be completely automatically executed by a computer device such as a processor. Therefore, in actual applications, the deployment personnel only need to input the correct configuration information of the deployment area, and the deployment method of the embodiment of the present invention can automatically perform the corresponding deployment operation according to the configuration information to complete the deployment of the distributed cluster system, further reducing the workload of the deployment personnel, and also reducing the error rate of the system configuration during the deployment process. In addition, when the distributed cluster system needs to be upgraded, the deployment personnel only needs to determine the system version to be upgraded. The deployment method of the embodiment of the present invention can obtain the deployment task set of this system version, and then according to the configuration information of the deployment area of the distributed cluster system to be deployed, the distributed cluster system can be deployed again by executing the deployment tasks in the deployment task set, and the upgrade of the distributed cluster system can be completed.
[0067] In an example of an application scenario of the present invention, when a customer credit analysis system based on a distributed cluster system needs to be deployed in branches of a certain bank in Beijing, Tianjin and Shanghai, the deployment personnel can use the deployment device according to an embodiment of the present invention to simultaneously deploy the customer credit analysis system in the branches in Beijing, Tianjin and Shanghai. Specifically, the deployment personnel first determine the configuration information of the three deployment areas of Beijing, Tianjin and Shanghai and the system version to be deployed, and then input the three configuration information into the deployment device in sequence, and the deployment device can automatically perform the deployment operation on the computer device specified in each configuration information according to the three configuration information, thereby completing the deployment of the customer credit analysis system for the branches in Beijing, Tianjin and Shanghai.
[0068] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart showing the main steps of a method for deploying a distributed cluster system according to an embodiment of the present invention. Figure 1 As shown, the deployment method of the distributed cluster system in the embodiment of the present invention mainly includes the following steps S101 to S104.
[0069] Step S101: Parse the received deployment instruction to obtain the system version and deployment area of the distributed cluster system to be deployed.
[0070] The system version refers to the version identification number (Version Number) of the distributed cluster system to be deployed. The system functions of different versions of the distributed cluster system to be deployed may be the same or different. Therefore, the deployer can flexibly select the system version with corresponding functions according to the user's deployment system requirements.
[0071] In one implementation of this embodiment, the deployment instruction may be an instruction received via a data interface encapsulated by Makefile, wherein the specific meaning of Makefile can be found in the aforementioned term explanation and will not be repeated here.
[0072] Step S102: Load configuration information corresponding to the deployment area, wherein the configuration information may include hosts files and environment variables of node devices in the distributed cluster system to be deployed.
[0073] A node device refers to a computer device such as a server used to deploy and install a distributed cluster system to be deployed. In this embodiment, there are multiple node devices in the distributed cluster system to be deployed, and the device information of each node device can be stored in the hosts file. The specific meanings of the hosts file and environment variables can be found in the aforementioned term explanations, which will not be repeated here.
[0074] In one implementation of the present embodiment, environment variables may include global variables, global group variables, group variables, private variables, and default variables. Specifically, global variables refer to variables available in the Ansbile Playbook engine that can be assigned to each node device in the hosts file. Global group variables refer to variables available in the Ansbile Playbook engine that can be assigned to each node device in each preset node device group in the hosts file. Group variables refer to variables available in the Ansbile Playbook engine that can be assigned to each node device in one or more specified preset node device groups. Private variables refer to available variables that can be assigned to a specified role file in a specified roles file. Default variables refer to the default available variables for a specified role file in the roles file.
[0075] In one implementation of this embodiment, the deployment method may further include the step of receiving configuration information, which may include: in response to the received information entry instruction, obtaining and storing the configuration information of the deployment area specified in the information entry instruction. The configuration information may be information entered by the user through the human-computer interaction device, and the information entry instruction may be an instruction generated based on the information after receiving the information. Further, in this implementation, the human-computer interaction device may include a data interface encapsulated by Makefile, that is, the user may input configuration information through this data interface, wherein the specific meaning of Makefile can be found in the aforementioned term explanation, which will not be repeated here.
[0076] Step S103: Obtain the deployment task set corresponding to the system version.
[0077] The deployment task set may include one or more deployment tasks, and the deployment work of the distributed cluster system to be deployed can be completed by executing these deployment tasks.
[0078] In this embodiment, different deployment task sets can be obtained according to the deployment requirements of the distributed cluster system to be deployed. For example, if the deployment requirement is only to make the distributed cluster system to be deployed run normally, and no additional auxiliary business functions need to be deployed, then the main deployment task set can be obtained, and the work of the distributed cluster system to be deployed can be completed by executing the main deployment tasks in the main deployment task set. Furthermore, if it is necessary not only to make the distributed cluster system to be deployed run normally, but also to deploy some additional auxiliary business functions, then in addition to obtaining the main deployment task set, the auxiliary deployment task set can also be obtained, and the deployment of the above-mentioned auxiliary business functions can be completed by executing the auxiliary deployment tasks in the auxiliary deployment task set.
[0079] Step S104: Control each deployment task in the deployment task set to be executed in accordance with their respective execution order, and sequentially use the environment variables to be executed on the node devices specified in the hosts file, so as to complete the deployment of the distributed cluster system to be deployed.
[0080] As can be seen from the aforementioned step S103, the deployment task set may include a primary deployment task set and may also include an auxiliary deployment task set. The following specifically describes the deployment implementation methods of the primary deployment task set and the auxiliary deployment task set in this embodiment.
[0081] 1. Main deployment task set
[0082] In this embodiment, the main deployment task set can be a playbook file generated by one or more main deployment tasks based on the Ansbile Playbook engine and determined according to the system application corresponding to the system version. The specific meanings of the Ansbile Playbook engine and the playbook file can be found in the above-mentioned term explanation, which will not be repeated here.
[0083] After obtaining the main deployment task set corresponding to the system version, you can deploy the system through the following steps: Use the Ansbile Playbook engine to call the roles file associated with the playbook file, and execute the roles file to make each main deployment task execute in its own execution order on the node devices specified in the hosts file using environment variables.
[0084] It should be noted that the deployment method according to the embodiment of the present invention does not change the working principle of the Ansbile Playbook engine. Therefore, in this embodiment, the conventional playbook file calling method in the Ansbile Playbook engine can be used to call the roles file associated with the playbook file. Since the playbook file is generated by one or more main deployment tasks determined by the system application, each role in the roles file associated with the playbook file is configured with the main deployment task to be executed. Therefore, after calling the roles file associated with the playbook file, these roles files can automatically make the main deployment tasks respectively execute on the node devices specified in the hosts file in their respective execution order using environment variables in sequence.
[0085] 2. Auxiliary deployment task set
[0086] In this embodiment, the auxiliary deployment task set can be a Manifests file generated by one or more auxiliary deployment tasks determined according to the auxiliary business function corresponding to the system version. The specific meaning of the Manifests file can be found in the above term explanation, which will not be repeated here.
[0087] After obtaining the auxiliary deployment task set corresponding to the system version, you can deploy the system by following the steps below:
[0088] Step 11: Parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function. The specific meaning of the API service can be found in the above terminology explanation, which will not be repeated here. Step 12: By executing the roles file, each auxiliary deployment task is executed in its own execution order, using the environment variables in turn on the node device specified in the hosts file.
[0089] According to the aforementioned explanation of terms, the roles file refers to a role file configured using the Role configuration function in the Ansible Playbook engine. Therefore, this embodiment reuses the roles file set in the Ansible Playbook engine when executing deployment tasks in the auxiliary deployment task set. That is to say, this embodiment not only uses the roles file to complete the deployment of the main deployment task set, but also completes the deployment of the auxiliary deployment task set, which significantly improves the utilization rate of the Ansible Playbook engine.
[0090] According to the deployment method embodiment of the distributed cluster system described in the above steps S101 to S104, it can be known that according to the deployment method according to the embodiment of the present invention, the deployment personnel only need to input the system version of the distributed cluster system to be deployed and the configuration information of the deployment area, and the distributed cluster system of the corresponding system version can be automatically deployed in the deployment area according to the received configuration information. In other words, the deployment personnel only need to ensure the correctness of the input information to accurately complete the deployment of the distributed cluster system, which greatly reduces the workload of the deployment personnel and improves the efficiency of system deployment. In addition, the deployment personnel can enter the configuration information of multiple deployment areas at the same time. According to the deployment method according to the embodiment of the present invention, the distributed cluster system can be deployed for each deployment area in a parallel or serial manner according to the configuration information of each deployment area, which further reduces the workload of the deployment personnel and improves the efficiency of system deployment.
[0091] Further, in a deployment method of a distributed cluster system according to another embodiment of the present invention, in addition to the following steps: Figure 1Steps S101 to S104 in the deployment method embodiment shown may further include the following step S105.
[0092] Step S105: Acquire and store the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment.
[0093] By recording the running time of each deployment step and the total running time to complete the deployment, it is helpful for deployment personnel to accurately monitor whether there are any operational abnormalities in each deployment step, so as to take effective measures in time to complete the deployment work normally.
[0094] See attached Figure 2 and 3 , Figure 2 and 3 The main steps of the deployment method of the distributed cluster system in the embodiment of the present invention are respectively shown when the deployment target is the main deployment task set and the auxiliary deployment task set.
[0095] 1. Main deployment task set
[0096] like Figure 2 As shown, when the deployment target is the main deployment task set, the deployment method of the distributed cluster system may include the following steps S201 to S205.
[0097] Step S201: Parse the received deployment instruction to obtain the system version and deployment area of the distributed cluster system to be deployed.
[0098] Step S202: Load configuration information corresponding to the deployment area, wherein the configuration information includes hosts files and environment variables of node devices in the distributed cluster system to be deployed.
[0099] Step S203: Obtain the main deployment task set corresponding to the system version. The main deployment task set is a playbook file generated based on the AnsbilePlaybook engine and determined according to one or more main deployment tasks corresponding to the system application functions of the system version.
[0100] Step S204: Use the Ansbile Playbook engine to call the roles file associated with the playbook file, and by executing the roles file, each main deployment task is executed in its own execution order and in turn on the node device specified in the hosts file using the environment variables.
[0101] Step S205: Acquire and store the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment.
[0102] It should be noted that the specific implementations of the above steps S201 to S204 are respectively the same as those described above. Figure 1 The related implementations in step S101 to step S104 in the deployment method embodiment shown are similar, and will not be described in detail for the sake of brevity.
[0103] 2. Auxiliary deployment task set
[0104] like Figure 3 As shown, when the deployment target is an auxiliary deployment task set, the deployment method of the distributed cluster system may include the following steps S301 to S306.
[0105] Step S301: Parse the received deployment instruction to obtain the system version and deployment area of the distributed cluster system to be deployed.
[0106] Step S302: Load configuration information corresponding to the deployment area, wherein the configuration information includes hosts files and environment variables of node devices in the distributed cluster system to be deployed.
[0107] Step S303: Acquire the auxiliary deployment task set corresponding to the system version. The auxiliary deployment task set is a Manifests file generated by one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version.
[0108] Step S304: Parse the Manifests file to directly call the roles file or call the roles file via the API service corresponding to the auxiliary business function.
[0109] Step S305: by executing the roles file, each auxiliary deployment task is executed in its own execution order and in turn on the node device specified in the hosts file using the environment variables.
[0110] Step S306: Acquire and store the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment.
[0111] It should be noted that the specific implementations of the above steps S301 to S305 are respectively the same as those described above. Figure 1 The related implementations in step S101 to step S104 in the deployment method embodiment shown are similar, and will not be described in detail for the sake of brevity.
[0112] Further, in a deployment method of a distributed cluster system according to another embodiment of the present invention, in addition to steps S101 to S105 in the aforementioned deployment method embodiment, a plug-in setting step may also be included, which may include: in response to a received plug-in setting instruction, setting a plug-in program for the distributed cluster system to be deployed.
[0113] In practical applications, the plug-in programs to be set can be flexibly set according to the deployment requirements of the distributed cluster system to be deployed, so as to further enrich the system functions of the distributed cluster system.
[0114] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0115] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each of the above method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0116] Furthermore, the present invention also provides a deployment system for a distributed cluster system.
[0117] See attached Figure 4 , Figure 4 FIG. 1 is a main structural block diagram of a deployment system of a distributed cluster system according to an embodiment of the present invention. Figure 4As shown, the deployment system of the distributed cluster system in the embodiment of the present invention mainly includes an instruction receiving / parsing module 11, a configuration information loading module 12, a deployment task set acquisition module 13 and a system deployment module 14. In some embodiments, one or more of the instruction receiving / parsing module 11, the configuration information loading module 12, the deployment task set acquisition module 13 and the system deployment module 14 can be combined into one module. In some embodiments, the instruction receiving / parsing module 11 can be configured to parse the received deployment instructions to obtain the system version and deployment area of the distributed cluster system to be deployed. The configuration information loading module 12 can be configured to load the configuration information corresponding to the deployment area, wherein the configuration information can include the hosts file and environment variables of the node device in the distributed cluster system to be deployed. The deployment task set acquisition module 13 can be configured to obtain the deployment task set corresponding to the system version. The system deployment module 14 can be configured to control each deployment task in the deployment task set to be executed in accordance with their respective execution order, and to use the environment variables in sequence on the node device specified in the hosts file to complete the deployment of the distributed cluster system to be deployed. In one embodiment, the description of the specific implementation function can be referred to the description of steps S101 to S104.
[0118] In one embodiment, the deployment task set may include a main deployment task set, which may be a playbook file generated based on the Ansible Playbook engine and determined by one or more main deployment tasks corresponding to the system application of the system version. In addition, in this embodiment, the system deployment module 14 may be further configured to perform the following operations: use the Ansible Playbook engine to call the roles file associated with the playbook file, and by executing the roles file, each main deployment task is executed in accordance with its own execution order, using environment variables in sequence on the node devices specified in the hosts file. In one embodiment, the description of the specific implementation function can be found in steps S201 to S205.
[0119] In one embodiment, the deployment task set may include an auxiliary deployment task set, which may be a Manifests file generated by one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version. In addition, in this embodiment, the system deployment module 14 may be further configured to perform the following operations: parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function; by executing the roles file, each auxiliary deployment task is executed in accordance with its own execution order, using the environment variables in sequence on the node device specified in the hosts file. In one embodiment, the description of the specific implementation function can be found in steps S301 to S306.
[0120] In one embodiment, Figure 4 The deployment system shown may also include a runtime recording module and / or a regional environment configuration module and / or a plug-in setting module. In the present embodiment, the runtime recording module may be configured to obtain and store the runtime of each deployment step in the process of deploying the distributed cluster system to be deployed, as well as the total runtime to complete the deployment. The regional environment configuration module may be configured to, in response to a received information entry instruction, obtain and store configuration information of the deployment area specified in the information entry instruction. The plug-in setting module may be configured to, in response to a received plug-in setting instruction, set a plug-in program for the distributed cluster system to be deployed.
[0121] In one embodiment, the instruction receiving / analyzing module 11 may include a data interface formed by Makefile encapsulation. In one embodiment, the description of the specific implementation function may refer to the description of step S101.
[0122] The deployment system of the above distributed cluster system is used to execute Figures 1 to 3 The deployment method embodiments of the distributed cluster system shown in any one of the items are similar in technical principles, technical problems solved and technical effects produced. Technical personnel in this technical field can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the deployment system of the distributed cluster system can refer to the contents described in the implementation example of the deployment method of the distributed cluster system, which will not be repeated here.
[0123] Furthermore, the present invention also provides another distributed cluster system deployment system. Figure 5 , Figure 5 FIG. 1 is a main structural block diagram of a deployment system of a distributed cluster system according to another embodiment of the present invention. Figure 5As shown, the deployment system of the distributed cluster system in the embodiment of the present invention mainly includes a Playbooks module, a Manifests module, an Environments module, a Makefile module, a Roles module, a Tools module and a Plugins module.
[0124] The module functions of the Playbooks module are the same as those mentioned above. Figure 4 In the deployment system embodiment of the distributed cluster system shown, the functions of the deployment task set acquisition module 13 and part of the system deployment module 14 are similar. The Playbooks module can obtain the main deployment task set corresponding to the system version, and control each main deployment task in the main deployment task set to be executed in accordance with their respective execution order, using environment variables in sequence on the node devices specified in the hosts file to complete the deployment of the distributed cluster system to be deployed. Among them, the main deployment task set can be a playbook file generated based on the Ansible Playbook engine and one or more main deployment tasks determined by the system application corresponding to the system version.
[0125] The module functions of the manifests module are the same as those mentioned above. Figure 4 In the deployment system embodiment of the distributed cluster system shown, the functions of the deployment task set acquisition module 13 and part of the system deployment module 14 are similar. The Manifests module can obtain the auxiliary deployment task set corresponding to the system version (the auxiliary deployment task set can be a Manifests file generated by one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version), parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function, and by executing the roles file, each auxiliary deployment task is executed in their respective execution order and in sequence on the node devices specified in the hosts file using environment variables.
[0126] The module functions of the Environments module are the same as those mentioned above. Figure 4 Part of the functions of the regional environment configuration module in the deployment system embodiment of the distributed cluster system shown are similar. The regional environment configuration module can respond to the received information entry instruction and obtain and store the configuration information of the deployment area specified in the information entry instruction.
[0127] The module function of the Makefile module is the same as mentioned above Figure 4The functions of part of the instruction receiving / parsing module 11 in the deployment system embodiment of the distributed cluster system shown are similar. The Makefile module can provide a data interface formed by the Makefile encapsulation to receive deployment instructions or information entry instructions and other instructions via the data interface formed by the Makefile encapsulation.
[0128] The module functions of the Roles module are the same as those mentioned above. Figure 4 A portion of the functions of the system deployment module 14 in the deployment system embodiment of the distributed cluster system shown are similar. The Roles module can configure the roles file so that the Playbooks module and / or the Manifests module can call the roles file, and by executing the roles file, each deployment task (main deployment task and / or auxiliary deployment task) is executed in their respective execution order, using environment variables in sequence on the node devices specified in the hosts file, to complete the deployment of the distributed cluster system to be deployed.
[0129] The module functions of the Tools module are the same as those mentioned above. Figure 4 The functions of part of the instruction receiving / parsing module 11 in the deployment system embodiment of the distributed cluster system shown are similar, and the Tools module can be configured to set and store the CLI (Command-Line Interface) tool for controlling the distributed cluster system. After the distributed cluster system is deployed, the user can enter function call instructions and / or cluster control instructions through the CLI tool. The function call instruction can be an instruction to call a certain auxiliary business function in the distributed cluster system, and the cluster control instruction can be an instruction to adjust the node device in the distributed cluster system, such as adding a new node device or setting the permissions for different users to use the distributed cluster system, etc. Various instructions that can control the distributed cluster system.
[0130] The module functions of the Plugins module are the same as those mentioned above. Figure 4 Part of the functions of the plug-in setting module in the distributed cluster system deployment system embodiment shown are similar. The Plugins module can set the plug-in program of the distributed cluster system to be deployed in response to the received plug-in setting instruction.
[0131] Furthermore, the present invention also provides a control device. In an embodiment of a control device according to the present invention, the control device includes a processor and a storage device, the storage device can be configured to store a program for executing a distributed cluster system deployment method of the above method embodiment, and the processor can be configured to execute the program in the storage device, which includes but is not limited to a program for executing a distributed cluster system deployment method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The control device can be a control device device formed by various electronic devices.
[0132] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the deployment method of the distributed cluster system of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned distributed cluster system deployment method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
[0133] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0134] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0135] So far, the technical solution of the present invention has been described in conjunction with an embodiment shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A deployment method for a distributed cluster system, characterized in that: The method comprises: Parse the received deployment instructions to obtain the system version and deployment area of the distributed cluster system to be deployed; Loading configuration information corresponding to the deployment area, wherein the configuration information includes hosts files and environment variables of node devices in the distributed cluster system to be deployed; Obtaining a deployment task set corresponding to the system version; Control each deployment task in the deployment task set to be executed in their respective execution order on the node devices specified in the hosts file using the environment variables in sequence, so as to complete the deployment of the distributed cluster system to be deployed; in, The deployment task set includes a main deployment task set, which is a playbook file generated based on the Ansible Playbook engine and determined according to one or more main deployment tasks corresponding to the system application of the system version; The step of "controlling each deployment task in the deployment task set to be executed in their respective execution order, and using the environment variables in sequence to be executed on the node devices specified in the hosts file" specifically includes: using the AnsiblePlaybook engine to call the roles file associated with the playbook file, and by executing the roles file, each of the main deployment tasks is executed in their respective execution order, and using the environment variables in sequence to be executed on the node devices specified in the hosts file, and each role in the roles file is configured with the main deployment task to be executed.
2. The distributed cluster system deployment method according to claim 1, characterized in that: The deployment task set includes an auxiliary deployment task set, and the auxiliary deployment task set is a Manifests file generated according to one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version; The step of "controlling each deployment task in the deployment task set to be executed in the respective execution order, using the environment variables in sequence on the node devices specified in the hosts file" specifically includes: Parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function; By executing the roles file, each of the auxiliary deployment tasks is executed on the node device specified in the hosts file in turn using the environment variables according to their respective execution orders.
3. The method for deploying a distributed cluster system according to any one of claims 1 to 2, characterized in that: The method further comprises: Acquire and store the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment; and / or, The method further comprises: In response to the received information entry instruction, acquiring and storing configuration information of the deployment area specified in the information entry instruction; and / or, The method further comprises: In response to the received plug-in setting instruction, setting the plug-in program of the distributed cluster system to be deployed; and / or, The deployment instruction is an instruction received via a data interface encapsulated by Makefile; and / or, The environment variables include global variables, global group variables, group variables, private variables and default variables; the global variables are variables available in the Ansible Playbook engine that can be assigned to each node device in the hosts file; the global group variables are variables available in the Ansible Playbook engine that can be assigned to each node device in each preset node device group in the hosts file; the group variables are variables available in the Ansible Playbook engine that can be assigned to each node device in one or more specified preset node device groups; the private variables are available variables that can be assigned to a specified role file in a specified roles file; the default variables are the default available variables for a specified role file in the roles file.
4. A deployment system for a distributed cluster system, characterized in that: The system comprises: An instruction receiving / parsing module, which is configured to parse the received deployment instruction to obtain the system version and deployment area of the distributed cluster system to be deployed; A configuration information loading module, configured to load configuration information corresponding to the deployment area, wherein the configuration information includes hosts files and environment variables of node devices in the distributed cluster system to be deployed; A deployment task set acquisition module, configured to acquire a deployment task set corresponding to the system version; A system deployment module, which is configured to control each deployment task in the deployment task set to be executed on the node devices specified in the hosts file in turn using the environment variables in their respective execution order, so as to complete the deployment of the distributed cluster system to be deployed; in, The deployment task set includes a main deployment task set, which is a playbook file generated based on the Ansible Playbook engine and determined according to one or more main deployment tasks corresponding to the system application of the system version; The system deployment module is further configured to perform the following operations: using the Ansible Playbook engine to call the roles file associated with the playbook file, and by executing the roles file, each of the main deployment tasks is executed on the node devices specified in the hosts file in their respective execution order using the environment variables in sequence, and each role in the roles file is configured with the main deployment task to be executed.
5. The distributed cluster system deployment system according to claim 4, characterized in that: The deployment task set includes an auxiliary deployment task set, and the auxiliary deployment task set is a Manifests file generated according to one or more auxiliary deployment tasks determined according to the auxiliary business functions corresponding to the system version; The system deployment module is further configured to perform the following operations: Parse the Manifests file to directly call the roles file or call the roles file through the API service corresponding to the auxiliary business function; By executing the roles file, each of the auxiliary deployment tasks is executed on the node device specified in the hosts file in turn using the environment variables according to their respective execution orders.
6. The deployment system of a distributed cluster system according to any one of claims 4 to 5, characterized in that: The system also includes a running time recording module and / or a regional environment configuration module and / or a plug-in setting module; The running time recording module is configured to obtain and store the running time of each deployment step in the process of deploying the distributed cluster system to be deployed, and the total running time to complete the deployment; The regional environment configuration module is configured to, in response to a received information entry instruction, obtain and store configuration information of a deployment area specified in the information entry instruction; The plug-in setting module is configured to set the plug-in program of the distributed cluster system to be deployed in response to the received plug-in setting instruction; and / or, The instruction receiving / parsing module includes a data interface formed by Makefile encapsulation; and / or, The environment variables include global variables, global group variables, group variables, private variables and default variables; The global variable is a variable available in the Ansible Playbook engine that can be assigned to each node device in the hosts file; The global group variable is a variable available in the Ansible Playbook engine that can be assigned to each node device in each preset node device group in the hosts file; The group variable is a variable available in the Ansible Playbook engine that can be assigned to each node device in the specified one or more preset node device groups; The private variable is an available variable that can be assigned to a specified role file in a specified roles file; The default variables are the default available variables for the role file specified in the roles file.
7. A control device, comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by the processor to execute the distributed cluster system deployment method according to any one of claims 1 to 3.
8. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the distributed cluster system deployment method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Task deployment method, device, equipment and platform
CN110138876A
Kubernetes node extension method and device, equipment and storage medium
CN112333229A