Intelligent operation and maintenance system and method based on database virtual software
Through an intelligent operation and maintenance system based on database virtual software, using task process orchestration and script enhancement modules, the problems of complex and difficult maintenance of operation and maintenance scripts in the existing technology are solved, and the development of operation and maintenance programs is simplified and operation and maintenance efficiency is improved. effect.
Patent Information
- Application Number
- CN202411527532.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In the prior art, software operation and maintenance scripts are complex and difficult to maintain, and different operation and maintenance scripts are needed for different architecture scenarios, resulting in bloated scripts, increasing operation and maintenance costs, and reducing execution efficiency and success rate.
Adopt an intelligent operation and maintenance system based on database virtual software, including script writing module, task scheduling module, script enhancement module, file transfer module, remote execution module and report generation module. It reduces hard coding through task process orchestration configuration, generates enhanced scripts and Automatically parse variable values to simplify the development and execution of operation and maintenance scripts.
Through the execution steps of abstract operation and maintenance scripts, the task process is arranged and configured, the hard coding is reduced, the difficulty of operation and maintenance program development is simplified, the efficiency of operation and maintenance program development is improved, the cost of operation and maintenance is reduced, and the execution efficiency and success rate of operation and maintenance are improved.
Smart Images

Figure CN119473371A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology and relates to an intelligent operation and maintenance system and method based on database virtualization software. Background Art
[0002] With the popularity of distributed system architecture, especially the microservice architecture style, it can meet the rapidly growing business needs of software development teams. However, at the same time, the number of service nodes is also growing rapidly, making the installation and upgrade of the entire system and other operation and maintenance operations more and more cumbersome and complicated. The existing software operation and maintenance methods are generally: write operation and maintenance scripts containing multiple tasks, and execute them in sequence on each node in a specific software architecture scenario; but this will make the operation and maintenance scripts of large software systems very complex and difficult to maintain; at the same time, different operation and maintenance scripts need to be developed to meet different customer scenarios (architecture scenarios); and as the system architecture evolves, the scripts will become more and more complex. This undoubtedly greatly increases the cost of operation and maintenance, and cannot guarantee the execution efficiency and success rate of operation and maintenance. Summary of the invention
[0003] The purpose of the present invention is to solve the problem in the prior art that software operation and maintenance scripts are complex and difficult to maintain, and different operation and maintenance scripts are developed when facing different architecture scenarios, resulting in increasingly bloated operation and maintenance scripts. An intelligent operation and maintenance system and method based on database virtualization software is provided.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] Intelligent operation and maintenance system based on database virtualization software, including: script writing module, task scheduling module, script enhancement module, file transfer module, remote execution module and report generation module;
[0006] The script writing module is used to write task configuration files and operation and maintenance scripts according to the operation and maintenance tasks;
[0007] The task scheduling module is used to read and parse the task configuration file to obtain the task flow arrangement configuration file, the task node configuration file and the node information configuration file;
[0008] The script enhancement module is used to generate a new enhanced script according to the operation and maintenance script file defined in the task flow arrangement configuration file, add the definition of variables at the beginning of the new script, and execute the enhanced new script when executing the operation and maintenance task;
[0009] The file transfer module arranges the enhanced scripts and required media defined in the task flow configuration file, and transfers the enhanced scripts and media to the specified paths of all remote hosts; selects the corresponding task node configuration file according to the current software architecture scenario; describes the corresponding relationship between the host node number and the IP in the node information configuration file, as well as the account and password used for operation and maintenance, according to the host node number described in the task node configuration file;
[0010] The remote script execution module initiates a call to execute the scripts on all host nodes that need to be executed for the current task;
[0011] The report generation module obtains the standard output and standard error output returned after each task is executed, and prints them to the console in real time and records them in the log file.
[0012] A further improvement of the present invention is:
[0013] Furthermore, the script writing module includes: a splitting submodule and a writing submodule; the splitting submodule is used to split the operation and maintenance process of the target system to obtain a number of operation and maintenance tasks; the writing submodule is used to write task configuration files and operation and maintenance scripts according to the operation and maintenance tasks.
[0014] Furthermore, the operation and maintenance tasks include: environmental detection, dependent media inspection, basic environment configuration and installation services.
[0015] Furthermore, the task configuration file includes: a task flow orchestration configuration file, a task node configuration file and a node information configuration file; the task flow orchestration configuration file describes the execution order of each task and whether it is performed concurrently; the task node configuration file describes the node identification, connection information and authentication information; the node information configuration file describes the node's IP address, port number and resource allocation.
[0016] Furthermore, the script enhancement module generates a new enhanced script, specifically: adding variable definitions at the front of the new script, there is no need to redefine variables and variable assignments when writing operation and maintenance scripts; the variable names added to the enhanced scripts come from the script input parameter variable names defined in the task flow orchestration configuration file, and the variable values come from the automatic parsing of the standard output of the previously executed script; the parsing method is: after each task is executed, all variable names and values are parsed according to the standard output format of the operation and maintenance script defined in the task flow orchestration configuration file, and cached in the variable pool in key-value form. If the subsequently executed task outputs the same variable as the previous task, the variable value is directly updated.
[0017] Furthermore, if a task fails to execute in the report generation module, the "ignore_failed" field value of the task configured in the task flow arrangement determines whether to continue to execute subsequent tasks or end the entire operation and maintenance; after all tasks are executed, the final operation and maintenance report is generated.
[0018] Furthermore, the remote execution script module initiates a call to execute the scripts on all host nodes that need to be executed for the current task, specifically: parsing the configuration file to obtain the job flow, and executing each task according to the task sequence described in the job flow; before each task is executed, an enhanced script needs to be generated first, and the enhanced script and the medium are transferred to the target host node; tasks in a serial relationship must wait for the previous task to be completed before the next one can be executed; tasks in a parallel relationship can execute tasks simultaneously.
[0019] Further, the configuration file is parsed to obtain the job flow, specifically: the task flow orchestration configuration file is parsed to obtain the task flow data, with the task flow data as the main data and the data obtained by parsing the task node configuration file and the node information configuration file as the supplementary data to obtain the task flow data.
[0020] Intelligent operation and maintenance methods based on database virtualization software include:
[0021] Write task configuration files and operation and maintenance scripts based on operation and maintenance tasks;
[0022] Read and parse the task configuration file to obtain the task flow arrangement configuration file, task node configuration file and node information configuration file;
[0023] Generate a new enhanced script based on the operation and maintenance script file defined in the task flow orchestration configuration file, add the definition of variables at the beginning of the new script, and execute the enhanced new script when executing the operation and maintenance task;
[0024] According to the task flow, the enhanced scripts and required media defined in the configuration file are arranged, and the enhanced scripts and media are transferred to the specified paths of all remote hosts; according to the current software architecture scenario, the corresponding task node configuration file is selected; according to the host node number described in the task node configuration file, the corresponding relationship between the host node number and the IP, as well as the account and password used for operation and maintenance, are described in the node information configuration file;
[0025] Initiate a call to execute the scripts on all host nodes that need to be executed for the current task;
[0026] Get the standard output and standard error output returned after each task is executed, and print them to the console and log files in real time.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] The present invention reduces hard coding by abstracting the execution steps of the operation and maintenance script into the configuration of task flow arrangement, and describes the serial and parallel dependencies between tasks through a small amount of configuration, so that the operation and maintenance process is flexible and configurable, and the configuration is simple enough, which simplifies the difficulty of operation and maintenance program development. At the same time, the task execution steps and the task execution object (node) configuration are separated, and the change points are separated, so that the configuration of each operation and maintenance task in different scenarios in the complex and changeable software architecture can be simple and flexible. The present invention enhances the script through the script enhancement module, so that developers can directly use variables without defining variables when writing scripts, thereby improving the efficiency of operation and maintenance program development. The automatic assignment of task script input parameters implemented in the execution engine greatly simplifies the configuration work of cumbersome operation and maintenance script variables, that is, improves the efficiency of operation and maintenance program development. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 It is a structural diagram of the intelligent operation and maintenance system of virtual software of the present invention;
[0031] Figure 2 A flowchart for implementing operation and maintenance;
[0032] Figure 3 A diagram showing the construction of the task flow orchestration configuration file task-flow.yaml;
[0033] Figure 4 This is a diagram for the new installation and upgrade of task-flow.yaml;
[0034] Figure 5 This is a diagram for building the task node configuration file task-node.yaml.
[0035] Figure 6 This is a schematic diagram of the IP address corresponding to each node number in the node information configuration file base.cfg. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0037] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0039] In the description of the embodiments of the present invention, it should be noted that if the terms "upper", "lower", "horizontal", "inner", etc. indicate an orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of the invention is usually placed when in use, it is only for the convenience of describing the present invention and simplifying the description, and does 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 present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0040] In addition, if the term "horizontal" appears, it does not mean that the component is required to be absolutely horizontal, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", which does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0041] In the description of the embodiments of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0042] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0043] See also Figure 1 , the present invention discloses an intelligent operation and maintenance system based on database virtual software, including: a script writing module, a task scheduling module, a script enhancement module, a file transmission module, a remote execution module and a report generation module;
[0044] The script writing module is used to write task configuration files and operation and maintenance scripts according to the operation and maintenance tasks;
[0045] The task scheduling module is used to read and parse the task configuration file to obtain the task flow arrangement configuration file, the task node configuration file and the node information configuration file;
[0046] The script enhancement module is used to generate a new enhanced script according to the operation and maintenance script file defined in the task flow arrangement configuration file, add the definition of variables at the beginning of the new script, and execute the enhanced new script when executing the operation and maintenance task;
[0047] The file transfer module arranges the enhanced scripts and required media defined in the task flow configuration file, and transfers the enhanced scripts and media to the specified paths of all remote hosts; selects the corresponding task node configuration file according to the current software architecture scenario; describes the corresponding relationship between the host node number and the IP in the node information configuration file, as well as the account and password used for operation and maintenance, according to the host node number described in the task node configuration file;
[0048] The remote script execution module initiates a call to execute the scripts on all host nodes that need to be executed for the current task;
[0049] The report generation module obtains the standard output and standard error output returned after each task is executed, and prints them to the console in real time and records them in the log file.
[0050] The script writing module includes: a splitting submodule and a writing submodule; the splitting submodule is used to split the operation and maintenance process of the target system to obtain a number of operation and maintenance tasks; the writing submodule is used to write task configuration files and operation and maintenance scripts according to the operation and maintenance tasks.
[0051] Operation and maintenance tasks include: environmental testing, dependent media inspection, basic environment configuration and installation services.
[0052] The task configuration file includes: a task flow orchestration configuration file, a task node configuration file and a node information configuration file; the task flow orchestration configuration file describes the execution order of each task and whether it is performed concurrently; the task node configuration file describes the node identification, connection information and authentication information; the node information configuration file describes the node's IP address, port number and resource allocation.
[0053] The script enhancement module generates a new enhanced script, specifically: add the definition of variables at the front of the new script. When writing the operation and maintenance script, there is no need to redefine the variables and variable assignments; the variable names added to the enhanced script come from the script input parameter variable names defined in the task flow orchestration configuration file, and the variable values come from the automatic parsing of the standard output of the previously executed script; the parsing method is: after each task is executed, all variable names and values are parsed according to the standard output format of the script defined in the task flow orchestration configuration file, and cached in the variable pool in key-value form. If the subsequently executed task outputs the same variable as the previous task, the variable value is directly updated.
[0054] If a task fails to execute in the report generation module, the "ignore_failed" field value of the task configured in the task flow arrangement determines whether to continue to execute subsequent tasks or end the entire operation and maintenance; after all tasks are completed, the final operation and maintenance report is generated.
[0055] The remote script execution module initiates a call to execute the scripts on all host nodes that need to be executed for the current task. Specifically, the configuration file is parsed to obtain the job flow, and each task is executed according to the task sequence described in the job flow; before each task is executed, an enhanced script needs to be generated first, and the enhanced script and the medium are transferred to the target host node; tasks in a serial relationship must wait for the previous task to be completed before the next task can be executed; tasks in a parallel relationship can be executed simultaneously.
[0056] Parse the configuration file to obtain the job flow, specifically: parse the task flow orchestration configuration file to obtain the task flow data, with the task flow data as the main data, and the data obtained by parsing the task node configuration file and the node information configuration file as the supplementary data to obtain the task flow data.
[0057] Intelligent operation and maintenance methods based on database virtualization software include:
[0058] Write task configuration files and operation and maintenance scripts based on operation and maintenance tasks;
[0059] Read and parse the task configuration file to obtain the task flow arrangement configuration file, task node configuration file and node information configuration file;
[0060] Generate a new enhanced script based on the operation and maintenance script file defined in the task flow orchestration configuration file, add the definition of variables at the beginning of the new script, and execute the enhanced new script when executing the operation and maintenance task;
[0061] According to the task flow, the enhanced scripts and required media defined in the configuration file are arranged, and the enhanced scripts and media are transferred to the specified paths of all remote hosts; according to the current software architecture scenario, the corresponding task node configuration file is selected; according to the host node number described in the task node configuration file, the corresponding relationship between the host node number and the IP, as well as the account and password used for operation and maintenance, are described in the node information configuration file;
[0062] Initiate a call to execute the scripts on all host nodes that need to be executed for the current task;
[0063] Get the standard output and standard error output returned after each task is executed, and print them to the console and log files in real time.
[0064] Example:
[0065] The invention discloses an intelligent operation and maintenance method based on database virtual software, comprising: writing configuration files and operation and maintenance scripts → developing an execution engine → implementing operation and maintenance.
[0066] Among them, see Figure 2 The key action to implement operation and maintenance is to start the execution engine. The execution steps of the execution engine are:
[0067] (1) Read and parse the configuration file
[0068] (2) Execute the scheduled task according to the parsed task flow. The execution process of each task is divided into: generating an enhanced script, transferring files to the target node, remotely calling the operation and maintenance script corresponding to the task, obtaining the output after the script is executed and parsing the output. The parsed variables are added to the variable pool to assign values to the input parameters of the subsequent script.
[0069] (3) If a task fails to execute in the middle, the value of the "ignore_failed" field of the task configured in the task flow orchestration determines whether to continue executing subsequent tasks or terminate the entire operation and maintenance.
[0070] (4) After all tasks are completed, generate the final operation and maintenance report.
[0071] 1. The specific steps for writing configuration files are:
[0072] (1) Analyze the operation and maintenance actions of the entire software system, formulate a reasonable operation and maintenance process, and divide it into individual operation and maintenance tasks. For example: environment detection, dependent media inspection, basic environment configuration, installation service A, installation service B, etc.
[0073] (2) Write operation and maintenance scripts based on the split operation and maintenance tasks. The scripts should be reused as much as possible to facilitate reuse in subsequent operation and maintenance process configuration.
[0074] (3) Write a task process orchestration configuration file based on the operation and maintenance tasks. The operation and maintenance process configuration file supports describing the execution order of each task, whether it is concurrent, and other information.
[0075] (4) According to different software architecture scenarios, write the task node configuration files that need to be executed for the operation and maintenance tasks.
[0076] 2. Development of execution engine
[0077] Parsing configuration: Parsing task process orchestration configuration files, task node configuration files, and node information configuration files.
[0078] The parsing process can be understood as the process of the program reading the data of the three configuration files into the memory for calculation. After reading the task flow arrangement configuration file, the task flow data is obtained, and then the task flow data is used as the main data, and the task node configuration and node information configuration data are used as supplementary data. After the three types of data are sorted, a complete task flow data is obtained. The task flow can also be called the task flow, which is a concept in the process engine. The operation and maintenance execution engine executes the tasks in sequence according to the order, concurrency or serial relationship of each task described in the task flow. This process can also be called scheduling. The task flow data also includes the operation and maintenance script path, script type, medium, script input parameters required for each task execution, the processing method after the script execution fails (whether to ignore), whether to execute concurrently, etc.
[0079] Scheduling operation and maintenance tasks: Scheduling operation and maintenance tasks serially or in parallel according to the execution process described in the task flow orchestration configuration file.
[0080] Automatic script enhancement processing: Automatically generate a new enhanced script based on the operation and maintenance script file defined in the task flow arrangement configuration file. When executing the operation and maintenance task, the enhanced new script is executed instead of the original script. In the new script, the definition of variables is added at the very beginning. When developers write operation and maintenance scripts, they do not need to define variables and assign values to variables themselves for any variable values that can only be calculated after the previous operation and maintenance tasks are completed. They can be used directly just like using operating system environment variables, which greatly improves development efficiency. The variable names of the input parameters come from the script input parameter variable names defined in the task flow arrangement configuration file, and the variable values come from the automatic parsing of the standard output of the previously executed script. The parsing method is: after each task is executed, all variable names and values are parsed according to the standard output format of the operation and maintenance script defined in the task flow arrangement configuration file, and cached in the variable pool in the form of key-value. If the subsequent executed task outputs the same variable as the previous task, the variable value is directly updated. This method of automatic assignment of task script input parameters greatly simplifies the configuration of operation and maintenance.
[0081] Transfer files and media: Arrange the task scripts and required media defined in the configuration file according to the task flow, and transfer the enhanced scripts and media to the specified paths of all remote hosts. The hosts that need to be transferred come from all host nodes that need to execute the current task described in the task node configuration file.
[0082] There are 2 types of files that need to be transferred:
[0083] The path of the operation and maintenance script comes from the task flow data parsed by the execution engine. The task flow data comes from the configuration file. Therefore, the path of the operation and maintenance script is the script field configured in the task flow orchestration configuration file task-flow.yaml. Figure 3 .
[0084] The media path also comes from the configuration in task-flow.yaml, mediaPath field, see Figure 3 .
[0085] Remote script execution: remotely call and execute scripts on all hosts that need to be executed for the current task.
[0086] The call is to execute an ssh command on the node where the execution engine is located, but the same ssh command needs to be executed once for each target node required by the current task, that is, a task may be executed on multiple nodes.
[0087] The calling conditions are: parse the configuration file to get the job flow, and execute each task according to the task order described in the job flow. Before each task is executed, it is necessary to generate an enhanced script and then transfer the enhanced script and the medium to the target host (node). The tasks in a serial relationship must wait for the previous task to be completed before the next one can be executed. The tasks in a parallel relationship can be executed at the same time.
[0088] Generate execution report: Stream the standard output and standard error output returned after each task is executed, print them to the console and log them in real time. After a task is executed, automatically parse the output in Json format to obtain variables for subsequent tasks, and confirm success / failure based on the return code. If it fails, the execution ends. After all tasks are executed, the execution result information of all tasks is automatically summarized to form a report, which is convenient for operation and maintenance personnel to intuitively view the operation and maintenance results.
[0089] 3. Implementation of Operation and Maintenance
[0090] (1) Select the corresponding task node configuration file based on the current software architecture scenario (the same software may have different architecture scenarios. For example, for a service, it may be a single instance or a cluster. The hardware requirements of each service on the host, such as the number of CPU cores and memory size, can be flexibly changed according to business needs).
[0091] (2) Based on the host node number described in the task node configuration file, describe the correspondence between the node number and the IP address, as well as the account and password used for operation and maintenance, in the node information configuration file.
[0092] like Figure 5 As shown in the figure, the base.cfg configuration file describes the mapping relationship between the numbers and IP addresses of all three hosts (nodes) that require maintenance.
[0093] For example, node1 is the node with the IP address 192.168.1.10, and this number corresponds to Figure 6 The nodeNumber field in Figure 5 The configuration also indicates that the tasks that the node with nodeNumber 1 needs to perform are: taskA, taskB, taskD. And the task names correspond to Figure 5 The name field of each task in Figure 3 The following describes the basic necessary information of taskA and taskB, such as the task script path and required media.
[0094] (3) Run the execution engine, initiate operation and maintenance, view the real-time log of the console, and observe the execution status of the operation and maintenance operations.
[0095] (4) If the execution fails, check the operation and maintenance report to quickly locate the problem and solve it; after the problem is solved, the execution engine supports continued execution until all tasks are successfully executed.
[0096] In the process of configuring the configuration file, the configuration file is explained, specifically:
[0097] 1. Task flow orchestration configuration file task-flow.yaml
[0098] All subtasks included in the operation and maintenance task flow are arranged through a configuration file. This includes the name of the task, type, whether it is executed concurrently, the medium on which the task depends, the path of the task execution script, input parameters, and other information. The configuration file can accurately describe all the operation and maintenance tasks that need to be executed, as well as the relationship between the order or concurrent execution of tasks, and whether to continue execution or directly interrupt the task after failure. Specific configuration items are as follows Figure 3 shown.
[0099] In addition, different process configurations can be written according to different operation and maintenance purposes. For example, new installation and upgrade installation can have different operation and maintenance steps. Figure 4 shown.
[0100] 2. Task node configuration file task-node.yaml
[0101] For a large software system, the operation and maintenance sequence of each component is relatively fixed, that is, the task flow orchestration configuration file arranged according to the entire operation and maintenance process will not change frequently. However, in different operation scenarios, the target object (node) of each subtask execution may change.
[0102] For example, for a microservice A, when the business concurrency is 10,000, A needs to be deployed on nodes 1 and 2 in the cluster, but when the concurrency is 100,000, A needs to be deployed on nodes 1, 2, and 3. In addition, microservice B, which has affinity with A, can only be deployed on nodes 1, 2, and 3, while microservice C, which has anti-affinity with A, cannot be deployed on nodes 1, 2, and 3. Each microservice has its own resource requirements (CPU memory, etc.) for the operating environment. Considering the need to save overall deployment resources as much as possible, the node location of each service deployment should be considered as a whole in different business scenarios.
[0103] like Figure 5 As shown in the directory structure, different task node configuration files are planned based on the business scale and cluster size. Scale 1 represents a scale of 10,000 concurrent nodes, which can be divided into four deployment scenarios, that is, the deployment modes when the number of nodes is 1, 2, 3, and 6. Figure 5 , design a configuration example task-node.yaml with a business scale of 100,000 and a cluster size of 3 nodes; Figure 5 In the example, tasks A and B have affinity, and the execution nodes of the corresponding tasks are the same, while A and C have anti-affinity, and the execution nodes are different.
[0104] The task-node.yaml configuration file focuses on expressing its structure, that is, what configuration items are included. This configuration item can indicate the operation and maintenance tasks that need to be performed on each host (node). When the execution engine is started, this configuration file will be read together with the other two configuration files and converted into a job flow containing complete operation and maintenance tasks.
[0105] Business scale: The business scale of the software currently being operated and maintained. Since different business scales may have different software architectures, task-node.yaml can also be written in multiple copies for different business scenarios. Each time the operation and maintenance is performed, the appropriate copy is used according to the business scale of the current software. Therefore, this field is mainly for the convenience of human reading and distinction. It can be set to a number representing the size of the business scale, or it can be set to a name string representing a specific business scenario.
[0106] Cluster size: The number of hosts (nodes) required to perform the current operation and maintenance implementation.
[0107] Node Number: The number of the node.
[0108] Memory size: The minimum memory size required by the host of this node in the current business scale scenario. After the execution engine is started, it will first check the resource configuration of each node before executing all tasks, including memory, CPU, disk space, etc. If the resources on the node are less than those defined in the configuration file, the operation and maintenance personnel will be prompted that the resource configuration is insufficient and the operation and maintenance task will not be initiated.
[0109] Task name: The tasks field is an array (list) that can be used to set the names of multiple tasks, indicating that the node has multiple tasks to execute.
[0110] 3. Node information configuration file base.cfg
[0111] The first two configuration files describe the overall execution steps of the operation and maintenance tasks, the dependent resources (media scripts, etc.), and the target nodes that each task needs to execute. Finally, when implementing in a specific environment, it is necessary to obtain the on-site environment information to configure the node information configuration file. This configuration is used to specify the IP address corresponding to each node number. Figure 6 shown.
[0112] A terminal device is provided in one embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0113] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.
[0114] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0115] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0116] The memory may be used to store the computer program and / or module, and the processor implements various functions of the terminal device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.
[0117] If the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various 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 capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. 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.
[0118] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. Intelligent operation and maintenance system based on database virtualization software, characterized by: include: Script writing module, task scheduling module, script enhancement module, file transfer module, remote execution module and report generation module; The script writing module is used to write task configuration files and operation and maintenance scripts according to the operation and maintenance tasks; The task scheduling module is used to read and parse the task configuration file to obtain the task flow arrangement configuration file, the task node configuration file and the node information configuration file; The script enhancement module is used to generate a new enhanced script according to the operation and maintenance script file defined in the task flow arrangement configuration file, add the definition of variables at the beginning of the new script, and execute the enhanced new script when executing the operation and maintenance task; The file transfer module arranges the enhanced scripts and required media defined in the configuration file according to the task flow, and transfers the enhanced scripts and media to the specified paths of all remote hosts; selects the corresponding task node configuration file according to the current software architecture scenario; According to the host node number described in the task node configuration file, describe the correspondence between the host node number and the IP address, as well as the account and password used for operation and maintenance in the node information configuration file; The remote script execution module initiates a call to execute the scripts on all host nodes that need to be executed for the current task; The report generation module obtains the standard output and standard error output returned after each task is executed, and prints them to the console and records them in a log file in real time.
2. The intelligent operation and maintenance system based on database virtualization software according to claim 1 is characterized in that: The script writing module includes: a splitting submodule and a writing submodule; the splitting submodule is used to split the operation and maintenance process of the target system to obtain a number of operation and maintenance tasks; the writing submodule is used to write task configuration files and operation and maintenance scripts according to the operation and maintenance tasks.
3. The intelligent operation and maintenance system based on database virtualization software according to claim 2 is characterized in that: The operation and maintenance tasks include: environmental detection, dependent media inspection, basic environment configuration and installation services.
4. The intelligent operation and maintenance system based on database virtualization software according to claim 3 is characterized in that: The task configuration file includes: a task flow orchestration configuration file, a task node configuration file and a node information configuration file; the task flow orchestration configuration file describes the execution order of each task and whether it is performed concurrently; the task node configuration file describes the node identification, connection information and authentication information; the node information configuration file describes the node's IP address, port number and resource allocation.
5. The intelligent operation and maintenance system based on database virtualization software according to claim 4 is characterized in that: The script enhancement module generates a new enhanced script, specifically: adding the definition of variables at the front of the new script, so that there is no need to redefine variables and variable assignments when writing operation and maintenance scripts; the variable names added to the enhanced scripts come from the script input parameter variable names defined in the task flow orchestration configuration file, and the variable values come from the automatic parsing of the standard output of the previously executed script; the parsing method is: after each task is executed, all variable names and values are parsed according to the standard output format of the operation and maintenance script defined in the task flow orchestration configuration file, and cached in the variable pool in the form of key-value; if the subsequently executed task outputs the same variable as the previous task, the variable value is directly updated.
6. The intelligent operation and maintenance system based on database virtualization software according to claim 5 is characterized in that: If a task fails to execute in the report generation module, the value of the "ignore_failed" field of the task configured in the task flow arrangement determines whether to continue to execute subsequent tasks or terminate the entire operation and maintenance; After all tasks are completed, a final operation and maintenance report is generated.
7. The intelligent operation and maintenance system based on database virtualization software according to claim 6 is characterized in that: The remote execution script module initiates a call to execute the scripts on all host nodes that need to be executed for the current task, specifically: parsing the configuration file to obtain the job flow, and executing each task according to the task sequence described in the job flow; before each task is executed, an enhanced script needs to be generated first, and the enhanced script and the medium are transferred to the target host node; tasks in a serial relationship must wait for the previous task to be completed before the next one can be executed; tasks in a parallel relationship can be executed simultaneously.
8. The intelligent operation and maintenance system based on database virtualization software according to claim 7 is characterized in that: The configuration file is parsed to obtain the job flow, specifically: the task flow data is obtained by parsing the task flow arrangement configuration file, with the task flow data as the main data, and the data obtained by parsing the task node configuration file and the node information configuration file as the supplementary data to obtain the task flow data.
9. An intelligent operation and maintenance method based on database virtualization software, characterized in that: include: Write task configuration files and operation and maintenance scripts based on operation and maintenance tasks; Read and parse the task configuration file to obtain the task flow arrangement configuration file, task node configuration file and node information configuration file; Generate a new enhanced script based on the operation and maintenance script file defined in the task flow orchestration configuration file, add the definition of variables at the beginning of the new script, and execute the enhanced new script when executing the operation and maintenance task; Arrange the enhancement scripts and required media defined in the configuration file according to the task flow, and transfer the enhancement scripts and media to the specified paths of all remote hosts; select the corresponding task node configuration file according to the current software architecture scenario; According to the host node number described in the task node configuration file, describe the correspondence between the host node number and the IP address, as well as the account and password used for operation and maintenance in the node information configuration file; Initiate a call to execute the scripts on all host nodes that need to be executed for the current task; Get the standard output and standard error output returned after each task is executed, and print them to the console and log files in real time.
Citation Information
Patent Citations
Task arrangement engine system
CN111158708A
Operation and maintenance script generation and execution method and system
CN111930358A
Test script execution method and device, server, electronic equipment and medium
CN112181823A
Flexibly configured automatic operation system
CN112330180A
Automatic operation and maintenance platform adaptation method and device, equipment, storage medium and product
CN114281403A