Management node service inspection method and device, electronic equipment and readable medium
Through automated methods, including generating host grouping lists and service inspection scripts, controlling resource pool bastion machines for management node service inspections, solving the problem of cumbersome and inefficient manual inspection in high-availability testing of management nodes, and realizing automated inspection and efficient testing processes.
Patent Information
- Application Number
- CN202411744429.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-04-15
AI Technical Summary
In the high availability test of management nodes in the cloud computing field, some services cannot be started by themselves or the machines cannot operate normally due to uncontrollable factors. The existing technology requires cumbersome manual inspection, inefficient efficiency, and easy service omissions.
By determining the resource pool type, obtaining host information, generating host grouping lists, writing and integrating service inspection scripts for each production line, generating a unified entry file, and controlling the resource pool bastion machine for management node service inspection based on these files.
It realizes automated inspection and management of the service status of each production line during the high availability test process of the node, without manual coordination, avoiding service omissions, and significantly improving testing efficiency.
Smart Images

Figure CN119829343A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a management node service inspection method, a management node service inspection device, an electronic device and a computer-readable medium. Background Art
[0002] In the field of cloud computing, as users' requirements for product HA (High Availability) capabilities become normalized, product high availability testing has become an indispensable and concerned part. Product high availability testing includes cloud base management node high availability testing. The so-called management node high availability testing verifies whether the cloud base service and cloud management platform can operate normally during operations such as powering off and on the management node.
[0003] During the high availability test of the management node, due to uncontrollable factors, some services cannot start automatically or the machines cannot run normally. Currently, when these situations occur, it is necessary to coordinate with the interface personnel of each production line to manually check whether the service is normal.
[0004] Due to the large number of production lines involved, the complexity of production line services, and the large number of machines deployed on the production lines, manual inspection requires coordination between the interface personnel of each production line to repeatedly log into each deployed machine to manually check whether each type of service is normal. The inspection process is cumbersome and the troubleshooting efficiency is low. In addition, services may be missed during the manual inspection process, which makes the high availability test of the management node time-consuming, labor-intensive, and inefficient. Summary of the invention
[0005] The embodiment of the present invention provides a management node service inspection method, device, electronic device and readable medium to solve the problem that high-availability testing of management nodes is time-consuming, labor-intensive and inefficient.
[0006] An embodiment of the present invention discloses a management node service inspection method, comprising:
[0007] Determine the type of resource pool;
[0008] Get host information based on type;
[0009] Generate a host grouping list based on host information;
[0010] Generate service inspection scripts for each production line;
[0011] Integrate the service inspection scripts of each production line to generate a unified entry file;
[0012] The control resource pool bastion host performs management node service checks based on the host group list, service check scripts for each production line, and entry files.
[0013] Optionally, obtain host information based on type, including:
[0014] Determine the target audience by type;
[0015] Get the host information under the target object.
[0016] Optionally, the type of the resource pool is: a single availability zone resource pool, or a managed resource pool, or a multi-availability zone resource pool;
[0017] Target audiences by type, including:
[0018] If the resource pool type is a single-zone resource pool, the resource pool is the target object;
[0019] If the resource pool type is a managed resource pool, this resource pool and the main resource pool are the target objects;
[0020] If the resource pool type is a multi-zone resource pool, all zones are determined as target objects.
[0021] Optionally, obtain host information under the target object, including:
[0022] Get the deployment document of the target object;
[0023] Extract the six-tuple information of all hosts from the deployment document. The six-tuple information includes: production line, availability zone, host type, host name, IP type, and host IP.
[0024] Classify the six-tuple information according to the preset host information classification rules;
[0025] Based on the six-tuple information of the host in each category, the host information of each category is obtained.
[0026] Optionally, based on the host information, a host group list is generated, including:
[0027] The host information is grouped based on the availability zone, IP type, and host name to obtain the host group name of each host.
[0028] For any host group name, each host under any host group name is grouped again according to the production line to obtain the host group information;
[0029] Summarize the host group names and host group information to generate a host group list.
[0030] Optionally, generate a service check script for each production line, including:
[0031] Based on the production line, write service inspection scripts based on automated operation and maintenance tools;
[0032] Among them, the hosts reference rule in the service check script follows the host group name and host group information; the generation of the service check script is independent of the generation of the host group list.
[0033] Optionally, the control resource pool bastion host performs management node service checks based on the host group list, service check scripts for each production line, and entry files, including:
[0034] The control resource pool bastion host determines the service check script of the target production line from the service check scripts of each production line according to the entry file and option parameters, executes the service check script of the target production line, and performs management node service check based on the host group list.
[0035] The embodiment of the present invention also discloses a management node service inspection device, including:
[0036] A determination module, used to determine the type of resource pool;
[0037] An acquisition module, used for acquiring host information according to the type determined by the determination module;
[0038] A first generating module, used for generating a host grouping list based on the host information acquired by the acquiring module;
[0039] The second generation module is used to generate a service inspection script for each production line;
[0040] The third generation module is used to integrate the service inspection scripts of each production line generated by the second generation module to generate a unified entry file;
[0041] The inspection module is used to control the resource pool bastion host to perform management node service inspection based on the host group list generated by the first generation module, the service inspection script for each production line generated by the second generation module, and the entry file generated by the third generation module.
[0042] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0043] The memory is used to store computer programs;
[0044] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0045] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.
[0046] The embodiments of the present invention include the following advantages:
[0047] Determine the type of resource pool; obtain host information based on the type; generate a host group list based on the host information; generate service inspection scripts for each production line; integrate the service inspection scripts for each production line to generate a unified entry file; control the resource pool bastion host to perform management node service inspection based on the host group list, service inspection scripts for each production line, and entry files. The service status of each production line during the high availability test of the management node can be automatically checked, without the need to coordinate and pull together personnel from each production line for manual inspection, thus avoiding service omissions and improving the efficiency of the high availability test of the management node. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flowchart of a method for checking management node services provided in an embodiment of the present invention;
[0049] Figure 2 It is a flow chart of steps for generating a host group list and an entry file provided in an embodiment of the present invention;
[0050] Figure 3 is a flow chart of another management node service inspection method provided in an embodiment of the present invention;
[0051] Figure 4 is a structural block diagram of a management node service inspection device provided in an embodiment of the present invention;
[0052] Figure 5 is a block diagram of an electronic device provided in an embodiment of the present invention;
[0053] Figure 6 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] In the process of implementing the present invention, the inventors found that during the high availability test of the management node, due to uncontrollable factors, some services cannot start automatically or the machines cannot operate normally. Currently, when these situations occur, it is necessary to coordinate the interface personnel of each production line to manually check whether the service is normal.
[0056] Due to the large number of production lines involved, the complexity of production line services, and the large number of machines deployed on the production lines, manual inspection requires coordination between the interface personnel of each production line to repeatedly log into each deployed machine to manually check whether each type of service is normal. The inspection process is cumbersome and the troubleshooting efficiency is low. In addition, services may be missed during the manual inspection process, which makes the high availability test of the management node time-consuming, labor-intensive, and inefficient.
[0057] Based on this, an embodiment of the present invention provides a management node service inspection method, device, electronic device and readable medium, the method comprising: determining the type of resource pool; obtaining host information according to the type; generating a host grouping list based on the host information; generating a service inspection script for each production line; integrating the service inspection scripts of each production line to generate a unified entry file; controlling the resource pool bastion host to perform management node service inspection based on the host grouping list, the service inspection scripts of each production line, and the entry file. The method provided by the present invention obtains host information according to the type of resource pool; generates a host grouping list based on the host information; generates a service inspection script for each production line; integrating the service inspection scripts of each production line to generate a unified entry file; controlling the resource pool bastion host to perform management node service inspection based on the host grouping list, the service inspection scripts of each production line, and the entry file, which can automatically check the service status of each production line during the high availability test of the management node, without the need to coordinate and pull together the personnel of each production line to perform manual inspection, thereby avoiding service omissions and improving the efficiency of the high availability test of the management node.
[0058] Reference Figure 1 , shows a flowchart of a management node service inspection method provided in an embodiment of the present invention, which may specifically include the following steps:
[0059] 101, determine the type of resource pool.
[0060] The resource pool is a cloud resource pool. The resource pool type is: a single AZ (Availability Zone) resource pool, or a managed resource pool, or a multi-AZ resource pool.
[0061] 102, obtain host information according to type.
[0062] Different types of resource pools have different host information acquisition scopes, so the implementation process of step 102 is:
[0063] 102-1, determine the target object according to the type.
[0064] The target object is the acquisition scope of the host information.
[0065] If the resource pool type is a single-AZ resource pool, the resource pool is the target object.
[0066] If the resource pool type is a managed resource pool, this resource pool and the main resource pool are the target objects.
[0067] If the resource pool type is a multi-AZ resource pool, all AZs are determined as target objects.
[0068] 102-2, obtain the host information under the target object.
[0069] The implementation process of step 102-2 is as follows:
[0070] 1. Get the deployment document of the target object.
[0071] Taking the target object as a single-AZ resource pool as an example, the deployment document of the single-AZ resource pool will be obtained here. The deployment document contains information about all hosts deployed in the resource pool.
[0072] 2. Extract the six-tuple information of all hosts from the deployment document.
[0073] The six-tuple information includes: production line, availability zone, host type, host name, IP type, and host IP.
[0074] By analyzing the deployment document, we can know the production line, availability zone, host type, host name, and IP type. The host IP can be uniquely confirmed through the production line, availability zone, host type, host name, and IP type, thus forming a six-tuple of information.
[0075] This step can automatically extract the production line, availability zone, host type, host name, and IP type from the deployment document, and uniquely identify the host IP through the production line, availability zone, host type, host name, and IP type to form a six-tuple of information.
[0076] 3. Classify the six-tuple information according to the preset host information classification rules.
[0077] Among them, the host information classification rules can be determined based on the virtual machine planning information, VIP planning information, physical machine planning information, etc. of each production line.
[0078] For example, the host information classification rules are shown in Table 1.
[0079] Table 1
[0080]
[0081] Among them, manage is the management network, and cn2 (China Net Next Carrying Network) is the next-generation multi-service bearer network.
[0082] Based on the preset host information classification rules and the six-tuple information of each host, each host can be automatically classified according to the host information classification rules.
[0083] 4. Based on the six-tuple information of the host in each category, obtain the host information of each category.
[0084] After classification, the six-tuple information of the hosts under each category will be obtained. By integrating the six-tuple information of the hosts in each category, the host information of each category can be obtained.
[0085] In specific implementation, the host can also be represented by six-tuple information, and the host information can be classified and displayed according to the available zone, host type, and IP type in the six-tuple information. The classified information can be displayed in a graphical manner to be more intuitive and user-friendly.
[0086] 103. Generate a host grouping list based on the host information.
[0087] The host grouping list generated in step 103 can be adapted to automated operation and maintenance tools (such as ansible).
[0088] The implementation process of step 103 is:
[0089] 103-1, grouping the host information based on the available zone, IP type, and host name, and obtaining a host group name for each host.
[0090] The uniqueness of the host group name can be ensured by the availability zone, IP type, and host name. Therefore, in step 103-1, the availability zone, IP type, and host name are used together as the host group name. According to the various types of host information obtained by classification according to the host information classification rules in step 102, the host IP addresses of the hosts are divided into each host group name to obtain the host group name of each host.
[0091] 103-2, for any host group name, each host under any host group name is grouped again according to the production line to obtain host group information.
[0092] In step 103 - 2 , the hosts under each host group are grouped again based on the production line dimension to form host group information for unified management of the hosts.
[0093] 103-3, summarize the host group names and host group information, and generate a host group list.
[0094] In step 103-3, the host group names and host group information are summarized to generate a host group list based on an automated operation and maintenance tool (such as Ansible).
[0095] 104, generate a service inspection script for each production line.
[0096] The service check script generated in step 104 is a systematic service check script based on an automated operation and maintenance tool (such as ansible).
[0097] For example, based on the production line, write a service inspection script based on automated operation and maintenance tools (such as Ansible).
[0098] The hosts reference rule in the service check script follows the host group name and host group information. The generation of the service check script is independent of the generation of the host group list.
[0099] 105. Integrate the service inspection scripts of each production line to generate a unified entry file.
[0100] The entry file can specify the service check script execution of the production line according to the option parameters.
[0101] Through steps 102 to 105, a host grouping list adapted to an automated operation and maintenance tool (such as Ansible) and an entry file for an integrated service check script can be automatically generated, such as Figure 2 As shown, first obtain the deployment document, then extract the six-tuple information from the deployment document, and then classify it according to the host information classification rules to obtain various types of host information, then generate the host group information, and then generate a host group list, and generate a service inspection script according to the host group name and host group information. Finally, integrate the service inspection scripts of each production line to generate a unified entry file.
[0102] 106. The control resource pool bastion host performs management node service inspection based on the host grouping list, the service inspection script of each production line, and the entry file.
[0103] For example, the host group list, the service check scripts for each production line, and the entry file are placed in the bastion host. The control resource pool bastion host determines the service check script for the target production line from the service check scripts for each production line according to the option parameters through the entry file, executes the service check script for the target production line, and performs management node service checks based on the host group list.
[0104] Taking Ansible as an example of an automated operation and maintenance tool, the management node service inspection method provided in this embodiment is a method for automatically generating a host grouping list adapted to Ansible and adaptively generating an Ansible service inspection script. This method can be applied to the management node service inspection of each resource pool in the cloud computing field.
[0105] The management node service inspection method provided in this embodiment can automatically obtain host information according to the cloud resource pool type, use the host information to generate a host group list adapted to Ansible, and generate a systematic service inspection script adapted to Ansible playbook. According to the host group list and the service inspection script, the service status of each production line during the high availability test of the management node can be automatically checked, without the need to coordinate and pull together the personnel of each production line for manual inspection.
[0106] In addition, the management node service inspection method provided in this embodiment can automatically identify and locate abnormal services and corresponding production lines without the need to check the service operation status one by one.
[0107] In specific implementation, the management node service inspection method provided in this embodiment can be implemented by a management node service inspection tool, such as Figure 3 shown.
[0108] The management node service inspection tool determines the type of resource pool (single-AZ resource pool, managed resource pool, multi-AZ resource pool) by executing step 101.
[0109] By executing step 102, the host information is automatically obtained according to the type. If the resource pool type is a single-AZ resource pool, the resource pool is the target object, that is, the host information under the resource pool is obtained. If the resource pool type is a managed resource pool, the resource pool and the main resource pool are the target objects, that is, the host information under the managed resource pool and the main resource pool is obtained. If the resource pool type is a multi-AZ resource pool, all AZs are determined as target objects, that is, the host information under each AZ is obtained.
[0110] By executing step 103, a host grouping list adapted to an automated operation and maintenance tool (such as Ansible) is generated based on the host information.
[0111] By executing step 104, a service check script adapted to an automated operation and maintenance tool (such as ansible) is generated. The hosts reference rule in the script follows the host group name and host group information, so that the generation of the script file is independent of the generation of the host group list, and they are interdependent but do not affect each other.
[0112] By executing step 105, the service inspection scripts of each production line are integrated to generate a unified entry file.
[0113] By executing step 106, the host grouping list, the service inspection scripts of each production line, and the entry files are uniformly placed on the resource pool bastion host. The production line script execution can be specified according to the option parameters to achieve the effect of batch and automated inspection of whether each service in the high availability test of the management node is normal.
[0114] The management node service inspection method provided in this embodiment can avoid the need for each production line personnel to manually check whether the service is normal one by one, thereby saving manpower costs. At the same time, the abnormal service automatic identification function of the management node service inspection method provided in this embodiment improves the efficiency of problem location, further saves time costs, and thus improves the efficiency of high-availability testing of management nodes.
[0115] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0116] The management node service inspection method provided in this embodiment determines the type of resource pool; obtains host information according to the type; generates a host group list based on the host information; generates a service inspection script for each production line; integrates the service inspection scripts of each production line to generate a unified entry file; controls the resource pool bastion host to perform management node service inspection based on the host group list, the service inspection script of each production line, and the entry file. The service status of each production line during the high availability test of the management node can be automatically checked, without the need to coordinate and pull together the personnel of each production line for manual inspection, thus avoiding service omissions and improving the efficiency of the high availability test of the management node.
[0117] Reference Figure 4 , shows a structural block diagram of a management node service inspection device provided in an embodiment of the present invention, which may specifically include the following modules:
[0118] The determination module 401 is used to determine the type of the resource pool.
[0119] The acquisition module 402 is used to acquire the host information according to the type determined by the determination module 401.
[0120] The first generating module 403 is used to generate a host grouping list based on the host information obtained by the obtaining module 402 .
[0121] The second generating module 404 is used to generate a service inspection script for each production line.
[0122] The third generation module 405 is used to integrate the service inspection scripts of each production line generated by the second generation module 404 to generate a unified entry file.
[0123] The inspection module 406 is used to control the resource pool bastion host to perform management node service inspection based on the host group list generated by the first generation module 403, the service inspection script of each production line generated by the second generation module 404, and the entry file generated by the third generation module 405.
[0124] The acquisition module 402 is used to determine the target object according to the type and acquire the host information under the target object.
[0125] The resource pool type is: single-availability zone resource pool, managed resource pool, or multi-availability zone resource pool.
[0126] Target audiences by type, including:
[0127] If the resource pool type is a single-zone resource pool, the resource pool is the target object.
[0128] If the resource pool type is a managed resource pool, this resource pool and the main resource pool are the target objects.
[0129] If the resource pool type is a multi-zone resource pool, all zones are determined as target objects.
[0130] Among them, obtaining the host information under the target object includes:
[0131] Get the deployment document of the target object.
[0132] Extract the six-tuple information of all hosts from the deployment document. The six-tuple information includes: production line, availability zone, host type, host name, IP type, and host IP.
[0133] Classify the six-tuple information according to the preset host information classification rules.
[0134] Based on the six-tuple information of the host in each category, the host information of each category is obtained.
[0135] The first generation module 403 is used to group the host information based on the available zone, IP type, and host name to obtain the host group name of each host. For any host group name, each host under any host group name is grouped again by production line to obtain host group information. The host group name and host group information are summarized to generate a host group list.
[0136] The second generation module 404 is used to write a service inspection script based on the automated operation and maintenance tool based on the production line.
[0137] The hosts reference rule in the service check script follows the host group name and host group information. The generation of the service check script is independent of the generation of the host group list.
[0138] Among them, the inspection module 406 is used to control the resource pool bastion host to determine the service inspection script of the target production line from the service inspection scripts of each production line through the entry file according to the option parameters, execute the service inspection script of the target production line, and perform management node service inspection based on the host grouping list.
[0139] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0140] The device provided in this embodiment obtains host information according to the type of resource pool; generates a host group list based on the host information; generates a service check script for each production line; integrates the service check scripts of each production line to generate a unified entry file; controls the resource pool bastion host to perform management node service checks based on the host group list, the service check scripts of each production line, and the entry file. It can automatically check the service status of each production line during the high availability test of the management node, without the need to coordinate and pull together the personnel of each production line to perform manual inspections, thereby avoiding service omissions and improving the efficiency of the high availability test of the management node.
[0141] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0142] Memory 503, used for storing computer programs;
[0143] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:
[0144] Determine the type of resource pool.
[0145] Get host information by type.
[0146] Generate a host grouping list based on the host information.
[0147] Generate service inspection scripts for each production line.
[0148] Integrate the service inspection scripts of each production line to generate a unified entry file.
[0149] The control resource pool bastion host performs management node service checks based on the host group list, service check scripts for each production line, and entry files.
[0150] Optionally, obtain host information based on type, including:
[0151] Target objects by type.
[0152] Get the host information under the target object.
[0153] Optionally, the type of the resource pool is: a single-availability zone resource pool, or a managed resource pool, or a multi-availability zone resource pool.
[0154] Target audiences by type, including:
[0155] If the resource pool type is a single-zone resource pool, the resource pool is the target object.
[0156] If the resource pool type is a managed resource pool, this resource pool and the main resource pool are the target objects.
[0157] If the resource pool type is a multi-zone resource pool, all zones are determined as target objects.
[0158] Optionally, obtain host information under the target object, including:
[0159] Get the deployment document of the target object.
[0160] Extract the six-tuple information of all hosts from the deployment document. The six-tuple information includes: production line, availability zone, host type, host name, IP type, and host IP.
[0161] Classify the six-tuple information according to the preset host information classification rules.
[0162] Based on the six-tuple information of the host in each category, the host information of each category is obtained.
[0163] Optionally, based on the host information, a host group list is generated, including:
[0164] The host information is grouped based on the available zone, IP type, and host name to obtain the host group name of each host.
[0165] For any host group name, each host under the host group name is grouped again according to the production line to obtain the host group information.
[0166] Summarize the host group names and host group information to generate a host group list.
[0167] Optionally, generate a service check script for each production line, including:
[0168] Based on the production line, write service inspection scripts based on automated operation and maintenance tools.
[0169] The hosts reference rule in the service check script follows the host group name and host group information. The generation of the service check script is independent of the generation of the host group list.
[0170] Optionally, the control resource pool bastion host performs management node service checks based on the host group list, service check scripts for each production line, and entry files, including:
[0171] The control resource pool bastion host determines the service check script of the target production line from the service check scripts of each production line according to the entry file and option parameters, executes the service check script of the target production line, and performs management node service check based on the host group list.
[0172] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0173] The communication interface is used for communication between the above terminal and other devices.
[0174] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0175] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0176] The electronic device provided in this embodiment obtains host information according to the type of resource pool; generates a host group list based on the host information; generates a service check script for each production line; integrates the service check scripts of each production line to generate a unified entry file; controls the resource pool bastion host to perform management node service checks based on the host group list, the service check scripts of each production line, and the entry file. It can automatically check the service status of each production line during the high availability test of the management node, without the need to coordinate and pull together the personnel of each production line to perform manual inspections, thus avoiding service omissions and improving the efficiency of the high availability test of the management node.
[0177] like Figure 6 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 601 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the management node service checking method described in the above embodiment.
[0178] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the management node service checking method described in the above embodiment.
[0179] Specifically, the method is:
[0180] Determine the type of resource pool.
[0181] Get host information by type.
[0182] Generate a host grouping list based on the host information.
[0183] Generate service inspection scripts for each production line.
[0184] Integrate the service inspection scripts of each production line to generate a unified entry file.
[0185] The control resource pool bastion host performs management node service checks based on the host group list, service check scripts for each production line, and entry files.
[0186] Optionally, obtain host information based on type, including:
[0187] Target objects by type.
[0188] Get the host information under the target object.
[0189] Optionally, the type of the resource pool is: a single-availability zone resource pool, or a managed resource pool, or a multi-availability zone resource pool.
[0190] Target audiences by type, including:
[0191] If the resource pool type is a single-zone resource pool, the resource pool is the target object.
[0192] If the resource pool type is a managed resource pool, this resource pool and the main resource pool are the target objects.
[0193] If the resource pool type is a multi-zone resource pool, all zones are determined as target objects.
[0194] Optionally, obtain host information under the target object, including:
[0195] Get the deployment document of the target object.
[0196] Extract the six-tuple information of all hosts from the deployment document. The six-tuple information includes: production line, availability zone, host type, host name, IP type, and host IP.
[0197] Classify the six-tuple information according to the preset host information classification rules.
[0198] Based on the six-tuple information of the host in each category, the host information of each category is obtained.
[0199] Optionally, based on the host information, a host group list is generated, including:
[0200] The host information is grouped based on the available zone, IP type, and host name to obtain the host group name of each host.
[0201] For any host group name, each host under the host group name is grouped again according to the production line to obtain the host group information.
[0202] Summarize the host group names and host group information to generate a host group list.
[0203] Optionally, generate a service check script for each production line, including:
[0204] Based on the production line, write service inspection scripts based on automated operation and maintenance tools.
[0205] The hosts reference rule in the service check script follows the host group name and host group information. The generation of the service check script is independent of the generation of the host group list.
[0206] Optionally, the control resource pool bastion host performs management node service checks based on the host group list, service check scripts for each production line, and entry files, including:
[0207] The control resource pool bastion host determines the service check script of the target production line from the service check scripts of each production line according to the entry file and option parameters, executes the service check script of the target production line, and performs management node service check based on the host group list.
[0208] The computer-readable storage medium provided in this embodiment obtains host information according to the type of resource pool; generates a host grouping list based on the host information; generates a service inspection script for each production line; integrates the service inspection scripts of each production line to generate a unified entry file; controls the resource pool bastion host to perform management node service inspection based on the host grouping list, the service inspection script of each production line, and the entry file, and can automatically check the service status of each production line during the high availability test of the management node. There is no need to coordinate and pull together the personnel of each production line to perform manual inspection, which avoids service omissions and improves the efficiency of the high availability test of the management node.
[0209] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0210] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0211] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0212] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A management node service inspection method, characterized in that: include: Determine the type of resource pool; Get host information according to the type; Based on the host information, generate a host group list; Generate service inspection scripts for each production line; Integrate the service inspection scripts of each production line to generate a unified entry file; The control resource pool bastion host performs management node service inspection based on the host grouping list, the service inspection script of each production line, and the entry file.
2. The method according to claim 1, characterized in that The acquiring host information according to the type includes: Determine the target object according to the type; Get the host information under the target object.
3. The method according to claim 2, characterized in that The type of the resource pool is: a single availability zone resource pool, or a managed resource pool, or a multi-availability zone resource pool; The determining the target object according to the type includes: If the resource pool type is a single-zone resource pool, the resource pool is the target object; If the resource pool type is a managed resource pool, this resource pool and the main resource pool are the target objects; If the resource pool type is a multi-zone resource pool, all zones are determined as target objects.
4. The method according to claim 2, characterized in that: The obtaining host information under the target object includes: Obtaining a deployment document for the target object; Extracting six-tuple information of all hosts from the deployment document; wherein the six-tuple information includes: production line, availability zone, host type, host name, IP type, and host IP; Classifying the six-tuple information according to a preset host information classification rule; Based on the six-tuple information of the host in each category, the host information of each category is obtained.
5. The method according to claim 4, characterized in that The generating a host grouping list based on the host information includes: The host information is grouped based on the available zone, IP type, and host name to obtain a host group name for each host; For any host group name, each host under the host group name is grouped again according to the production line to obtain host group information; Summarize the host group names and host group information to generate a host group list.
6. The method according to claim 5, characterized in that The generation of the service inspection script for each production line includes: Based on the production line, write service inspection scripts based on automated operation and maintenance tools; Among them, the hosts reference rule in the service check script follows the host group name and host group information; the generation of the service check script is independent of the generation of the host group list.
7. The method according to claim 1, characterized in that The control resource pool bastion host performs management node service inspection based on the host grouping list, the service inspection script of each production line, and the entry file, including: The control resource pool bastion host determines the service check script of the target production line from the service check scripts of each production line according to the option parameters through the entry file, executes the service check script of the target production line, and performs management node service check based on the host grouping list.
8. A management node service inspection device, characterized in that: include: A determination module, used to determine the type of resource pool; An acquisition module, used to acquire host information according to the type determined by the determination module; A first generating module, configured to generate a host grouping list based on the host information acquired by the acquiring module; The second generation module is used to generate a service inspection script for each production line; A third generation module is used to integrate the service inspection scripts of each production line generated by the second generation module to generate a unified entry file; The inspection module is used to control the resource pool bastion host to perform management node service inspection based on the host group list generated by the first generation module, the service inspection script for each production line generated by the second generation module, and the entry file generated by the third generation module.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.