Middleware inspection method and device and electronic equipment
By deploying the extension suite in the container orchestration platform, middleware inspection tasks are periodically performed on nodes of the private cloud cluster, the problem of low inspection efficiency and accuracy caused by manual or static statistics of middleware operation information in the private cloud cluster is solved, and real-time, comprehensive and accurate version and status inspection of the middleware is achieved.
Patent Information
- Application Number
- CN202510011330.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-06
AI Technical Summary
In the private cloud multi-cluster scenario, there is a lack of automation to conduct full inspection of middleware, resulting in low inspection efficiency and accuracy.
Deploy the extension suite in the container orchestration platform, periodically perform inspection tasks on the nodes of the target cluster, determine and inspect middleware running on the business container through inspection scripts, and obtain its version and status information.
Real-time, comprehensive and accurate version and status inspection of middleware in operating business containers is realized, which improves the real-time and accuracy of inspections, simplifies operation and maintenance processes, and promptly warns of safety hazards.
Smart Images

Figure CN119938224A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing, and more specifically, to a middleware inspection method, device, and electronic device. Background Art
[0002] In the scenario of multiple clusters in a private cloud, real-time statistics of the versions and types of running business container middleware are required in many occasions, such as business production data reconciliation, external disciplinary review, production governance, and problem warning. Currently, in the relevant technology, there is no automated means to conduct full inspection of running middleware in the face of large-scale cluster scenarios. It mainly relies on the manual entry of the middleware type and version before the application enters the cloud, or when building a business container, the container base image of the container is counted, and rough statistics are made based on the base image used.
[0003] Currently, no effective solution has been proposed to address the problem of low efficiency and accuracy of middleware inspection caused by manual or static statistics of middleware operation information in private cloud clusters in related technologies. Summary of the invention
[0004] The main purpose of the present application is to provide a middleware inspection method, device and electronic device to solve the problem of low middleware inspection efficiency and accuracy caused by manual or static statistics of middleware operation information in a private cloud cluster in the related art.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a middleware inspection method is provided. The method comprises: deploying an extension kit in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the node is a physical server or a virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; deploying the inspection container group to the target cluster through the extension kit, wherein the extension kit includes an inspection script; running the inspection script based on the extension kit, determining the target middleware running on the business container included in the node, inspecting the target middleware, and obtaining the inspection result.
[0006] Optionally, an inspection script is run based on the extension suite to determine the target middleware running on the business container included in the node, and the target middleware is inspected to obtain an inspection result, including: running the inspection script based on the extension suite to determine the target middleware running on the business container included in the node, and determining the node information, container information and middleware running information to which the target middleware belongs; and obtaining the inspection result based on the node information, container information and middleware running information.
[0007] Optionally, running an inspection script based on the extension suite to determine the target middleware running on the business container included in the node, and determining the node information, container information, and middleware running information to which the target middleware belongs, includes: executing the inspection script based on the extension suite to obtain the node information of the node, wherein the node information includes at least: the cluster to which the node belongs and the operating system of the node; obtaining a running container list corresponding to the node, and traversing and querying the business containers included in the running container list, wherein the running container list is used to store the container identifiers of the running containers in the node; for the target business container in the running container list, obtaining the container information of the target business container, wherein the container The container information at least includes: container namespace, container name, container identifier, container image name and operating system information in the container, and the target business container is any business container in the running container list; query whether the target business container is running middleware in a preset list, wherein the preset list includes at least N middlewares, and middleware process keywords, path information and version check instructions corresponding to the N middlewares, respectively, and N is an integer greater than or equal to 2; determine the queried middleware as the target middleware, and obtain the middleware running information of the target middleware, wherein the middleware running information at least includes a static version number, a dynamic running version number and a middleware running status.
[0008] Optionally, obtaining container information of the target business container includes: executing a first instruction in the inspection script to obtain a container namespace, container name, container identifier, and container image name of the target business container; and executing a second instruction in the inspection script in the target business container to obtain operating system information within the container of the target business container.
[0009] Optionally, query whether middleware in a preset list is running in the target business container, including: querying whether the current middleware in the preset list is running in the target business container based on the middleware process keyword; if the current middleware is running in the target business container, using the current middleware as the queried middleware; if the current middleware is not running in the target business container, using the next middleware of the current middleware in the preset list as the new current middleware, and repeating the above operation until the last middleware in the preset list is reached.
[0010] Optionally, when the path information includes a main directory acquisition instruction and a binary file storage directory acquisition instruction, and the version check instruction includes a static version number acquisition instruction, a running version acquisition instruction, and a health status acquisition instruction, the middleware running information of the target middleware is obtained, including: based on the main directory acquisition instruction, obtaining the main directory information corresponding to the target middleware; based on the main directory information and the static version number acquisition instruction, obtaining the static version number corresponding to the target middleware; based on the main directory information and the binary file storage directory acquisition instruction, obtaining the binary file storage directory information corresponding to the target middleware; based on the binary file storage directory information and the health status acquisition instruction, obtaining the middleware running status corresponding to the target middleware; obtaining the dynamic running version number corresponding to the target middleware according to the running version acquisition instruction.
[0011] Optionally, based on the node information, container information and middleware operation information, an inspection result is obtained, including: splicing the node information, container information and middleware operation information according to a predetermined format to obtain the inspection result; mounting the inspection result to the inspection result directory generated on the node.
[0012] Optionally, an inspection script is run based on the extension kit to determine the target middleware running on the business container included in the node, the target middleware is inspected, and an inspection result is obtained, including: configuring a job template based on the extension kit, wherein the job template is used to specify the operation rules of the inspection container group, wherein the operation rules include at least one of the following: the inspection container group automatically terminates after executing the scheduled task, and the inspection container group works according to the preset scheduled task; running the inspection script based on the extension kit and the job template to determine the target middleware, the target middleware is inspected, and an inspection result is obtained.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a middleware inspection device is provided. The device includes: an extension module, which is used to deploy an extension kit in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the node is a physical server or virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; a deployment module, which is used to deploy the inspection container group to the target cluster through the extension kit, wherein the extension kit includes an inspection script; an inspection module, which is used to run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, inspect the target middleware, and obtain the inspection result.
[0014] Optionally, the inspection module includes: a first determination sub-module, used to run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, and determine the node information, container information and middleware running information to which the target middleware belongs; a first result sub-module, used to obtain the inspection result based on the node information, container information and middleware running information.
[0015] Optionally, the first determination submodule includes: a first acquisition submodule, which is used to execute the inspection script based on the extension kit to obtain the node information of the node, wherein the node information includes at least: the cluster to which the node belongs and the operating system of the node; a second acquisition submodule, which is used to obtain the running container list corresponding to the node, and traverse and query the business containers included in the running container list, wherein the running container list is used to store the container identifier of the running container in the node; a third acquisition submodule, which is used to obtain the container information of the target business container in the running container list, wherein the container information includes at least: container namespace, container name, container identifier , container image name and operating system information in the container, the target business container is any business container in the running container list; a first query submodule, used to query whether the target business container is running middleware in a preset list, wherein the preset list includes at least N middlewares, and middleware process keywords, path information and version check instructions corresponding to the N middlewares, respectively, and N is an integer greater than or equal to 2; a fourth acquisition submodule, used to determine the queried middleware as the target middleware, and obtain the middleware running information of the target middleware, wherein the middleware running information includes at least a static version number, a dynamic running version number and a middleware running status.
[0016] Optionally, the third acquisition sub-module includes: a fifth acquisition sub-module, used to execute the first instruction in the inspection script to obtain the container namespace, container name, container identifier and container image name of the target business container; a sixth acquisition sub-module, used to execute the second instruction in the inspection script in the target business container to obtain the operating system information within the container of the target business container.
[0017] Optionally, the first query submodule includes: a second query submodule, used to query whether the current middleware in the preset list is running in the target business container based on the middleware process keyword; a first running submodule, used to use the current middleware as the queried middleware when the current middleware is running in the target business container; and a second running submodule, used to use the next middleware of the current middleware in the preset list as the new current middleware when the current middleware is not running in the target business container, and repeat the above operations until the last middleware in the preset list is reached.
[0018] Optionally, the fourth acquisition submodule includes: a seventh acquisition submodule, which is used to acquire the main directory information corresponding to the target middleware based on the main directory acquisition instruction; an eighth acquisition submodule, which is used to acquire the static version number corresponding to the target middleware based on the main directory information and the static version number acquisition instruction; a ninth acquisition submodule, which is used to acquire the binary file storage directory information corresponding to the target middleware based on the main directory information and the binary file storage directory acquisition instruction; a tenth acquisition submodule, which is used to acquire the middleware running status corresponding to the target middleware based on the binary file storage directory information and the health status acquisition instruction; and a tenth acquisition submodule, which is used to acquire the dynamic running version number corresponding to the target middleware according to the running version acquisition instruction.
[0019] Optionally, the first result submodule includes: a second result submodule, used to splice the node information, container information and middleware operation information according to a predetermined format to obtain the inspection result; a first mounting submodule, used to mount the inspection result to the inspection result directory generated on the node.
[0020] Optionally, the inspection module includes: a first configuration sub-module, used to configure a job template based on an extension kit, wherein the job template is used to specify the operating rules of the inspection container group, wherein the operating rules include at least one of the following: the inspection container group automatically terminates after executing a scheduled task, and the inspection container group works according to a preset scheduled task; a second inspection sub-module, used to run an inspection script based on the extension kit and the job template, determine the target middleware, inspect the target middleware, and obtain the inspection result.
[0021] In an embodiment of the present application, an extension kit is deployed in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the node is a physical server or virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; the inspection container group is deployed to the target cluster through the extension kit, wherein the extension kit includes an inspection script; the inspection script is run based on the extension kit, the target middleware running on the business container included in the node is determined, the target middleware is inspected, and the inspection result is obtained, thereby achieving the purpose of real-time, comprehensive and accurate version and status inspection of the middleware in the running business container, thereby achieving the technical effect of improving the real-time and accuracy of the inspection, simplifying the operation and maintenance process, and timely warning of safety hazards, thereby solving the technical problem of low efficiency and accuracy of middleware inspection caused by manual or static statistics of middleware operation information in private cloud clusters. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 A hardware structure block diagram of a computer terminal for implementing a middleware inspection method is shown;
[0024] Figure 2 is a flow chart of a middleware inspection method provided according to an embodiment of the present application;
[0025] Figure 3 is a flow chart of an optional middleware inspection method provided according to an embodiment of the present application;
[0026] Figure 4 is a schematic diagram of a middleware inspection device provided according to an embodiment of the present application;
[0027] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0031] A private cloud is a cloud computing model in which the cloud infrastructure is used only by a single organization, either on-premises or hosted by a third-party provider. Private clouds offer the highest level of control over data, security, and quality of service.
[0032] Multi-cluster refers to an architectural pattern for managing multiple independent clusters (such as Kubernetes clusters) in a data center or cloud environment. Each cluster can run in a different geographical location, on different hardware resources, or serve a different business unit or application.
[0033] Middleware is an independent system software service located between the operating system and the application program, used to connect, manage and coordinate the communication and data sharing between different software components or applications. It provides a layer of abstraction so that application developers do not have to pay attention to the underlying network protocol, data format conversion, transaction processing, security and other complex details, so that they can focus more on the business logic and function development of the application.
[0034] A container orchestration tool used to automate the deployment, expansion, and management of containerized applications. It provides a platform-independent, portable, and scalable way to manage multi-container applications, allowing developers and operators to easily deploy and manage applications in different environments (such as development, testing, and production).
[0035] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0036] Example 1
[0037] According to an embodiment of the present application, a method embodiment of middleware inspection is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a middleware inspection method. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0039] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0040] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the middleware inspection method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned middleware inspection method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0042] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0043] In the above operating environment, the present application provides an optional middleware inspection method. Figure 2 1 is a flow chart of a middleware inspection method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0044] Step S200, deploying an extension kit in the container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in the target cluster, wherein the node is a physical server or a virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1;
[0045] Among them, the container orchestration platform can provide a controller capability to distribute a temporary inspection container group to each node in the cluster. This type of inspection container group is not a long-term daemon service, but a temporary container group. After the inspection container group on each node is executed and exited, the controller and these inspection container groups will die automatically and will not occupy cluster resources. It is very helpful for upgrading basic software, inspection and other work.
[0046] Optionally, in a private cloud environment, you can automatically create and run inspection container groups by deploying an extension kit in the container orchestration platform. The controller capabilities provided by the extension kit allow temporary inspection task containers to be distributed to each node in the cluster, implementing an automated inspection process without manual intervention.
[0047] The controller in the extension kit not only deploys the inspection container group, but also automatically executes the inspection task according to a predefined cycle (such as a certain time point every day) without manual triggering. This method can ensure the continuity and timeliness of the inspection, and can regularly check the status of the middleware to detect potential problems in a timely manner.
[0048] Optionally, the private cloud cluster can be composed of multiple nodes, each of which may run a large number of business containers. The extension kit performs inspection tasks on each node of the target cluster through the controller to ensure a comprehensive inspection of the middleware in all business containers. This inspection method can adapt to large-scale multi-cluster environments and improve the overall inspection efficiency.
[0049] It should be noted that the inspection task container is deployed only when the inspection is needed and is automatically deleted after the execution is completed, which can ensure that the inspection process does not continue to occupy valuable computing resources. The startup rule of the controller is set to never, that is, the inspection task container on each node is only executed once and automatically disappears after the task is completed, reducing resource consumption.
[0050] Optionally, deploy the extension kit in the cluster. Install the core manager, configure the container orchestration tool agent, install the container orchestration tool package manager and the extension kit and related dependencies according to the preset installation rules; customize the controller and configure the startup rule to never, to ensure that the newly added nodes will also be sent a temporary inspection container group by the controller object; generate an inspection directory on each node (i.e. host) in the cluster and mount it into the inspection container group, and save the result output to this directory after the inspection script is executed.
[0051] Optionally, configure the controller's startup rule to never, which means that once the temporary container groups sent by the controller are executed on each node, they will not be restarted. This is a key configuration property of the controller, which ensures that the containers on each node will automatically terminate after executing the task, rather than continuing to run or automatically retrying after failure.
[0052] Step S202, deploying the inspection container group to the target cluster through the extension kit, wherein the extension kit includes an inspection script;
[0053] Optionally, the inspection script is encapsulated in an inspection container group. By utilizing the isolation and consistency of container technology, it is possible to ensure that the execution environment of the inspection script on different nodes is the same, thereby avoiding deviations in execution results due to differences in the host environment.
[0054] Optionally, you can use the controller function of the extension kit to automatically deploy the inspection container group to all nodes of the target cluster. This avoids the tediousness and error risks of manually deploying and executing inspection scripts on each node. You can also use the scheduled task component in the extension kit to configure the periodic execution of the inspection container group. That is, the inspection task can be automatically run at predefined time intervals without manual intervention, ensuring the continuity and timeliness of the inspection.
[0055] Optionally, you can write an inspection script and inject it into the extension kit container image. The inspection container group sent by the controller executes the script on each node and writes the results to the mounted inspection result directory.
[0056] Step S204: Run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, inspect the target middleware, and obtain the inspection result.
[0057] Optionally, middleware refers to software components that run inside a business container and are used to provide specific services or functions. These middleware run in a containerized environment and provide necessary services and functions for business applications in the container. The purpose of this embodiment is to automatically inspect the running status, version, and health of these middleware to ensure the stability and security of the production environment, reduce operation and maintenance risks, and provide accurate data for auditing and governance. Through the controller component of the extension kit, the running information of the middleware running in the container can be checked periodically and non-invasively, thereby achieving real-time monitoring and full statistics.
[0058] Optionally, this step can dynamically run the inspection script through the control capability of the extension suite, and can detect and obtain the running status of the middleware in the business container in real time. It is more effective than inspections based on static data (such as image version information) and can reflect the actual usage and version changes of the middleware. By running the inspection script on each node, all business containers can be automatically traversed to detect the running status of the middleware, which can include but is not limited to the middleware version, health status, etc. This fully automated inspection method reduces the need for manual intervention and improves the efficiency and accuracy of inspections. The operation of the inspection script can collect detailed data about the middleware, such as operating system information in the container, static version number of the middleware, dynamic health status and dynamic version number, etc.
[0059] Optionally, through the unified scheduling of standardized inspection scripts and extension kits, the consistency and repeatability of the inspection process can be ensured, avoiding deviations in inspection results caused by differences in different nodes or container environments.
[0060] In an optional embodiment, an inspection script is run based on an extension kit to determine the target middleware running on a business container included in the node, and the target middleware is inspected to obtain an inspection result, including: running an inspection script based on the extension kit to determine the target middleware running on the business container included in the node, and determining the node information, container information and middleware running information to which the target middleware belongs; and obtaining the inspection result based on the node information, container information and middleware running information.
[0061] Optionally, running the inspection script through the extension kit can not only detect the running status of the target middleware, but also collect the related node information, container information and middleware running information. This information includes the node's cluster, operating system type and version, container namespace, container name, container ID and image name, as well as the static and dynamic version number and health status of the middleware. By associating the middleware information with the node information and container information, it helps to more deeply analyze the distribution, usage and running status of the middleware in the cluster, so as to locate problems more accurately and make operation and maintenance decisions. In addition, the collected node information, container information and middleware running information can be stored in a structured manner, which is convenient for subsequent statistical analysis, anomaly detection and report generation, thereby improving the efficiency and accuracy of data processing.
[0062] In an optional embodiment, the inspection script is run based on the extension kit to determine the target middleware running on the business container included in the node, and the node information, container information and middleware running information to which the target middleware belongs are determined, including: executing the inspection script based on the extension kit to obtain the node information of the node, wherein the node information at least includes: the cluster to which the node belongs and the operating system of the node; obtaining the running container list corresponding to the node, and traversing and querying the business containers included in the running container list, wherein the running container list is used to store the container identifier of the running container in the node; for the target business container in the running container list, obtaining the container information of the target business container, Among them, the container information at least includes: container namespace, container name, container identifier, container image name and operating system information in the container, and the target business container is any business container in the running container list; query whether the middleware in the preset list is running in the target business container, wherein the preset list includes at least N middlewares, and the middleware process keywords, path information and version check instructions corresponding to the N middlewares, respectively, and N is an integer greater than or equal to 2; determine the queried middleware as the target middleware, and obtain the middleware running information of the target middleware, wherein the middleware running information at least includes a static version number, a dynamic running version number and a middleware running status.
[0063] Optionally, for each node in the cluster, obtain the node information of the node, including the cluster to which the node belongs and the operating system of the node, and record them; obtain the list of running containers on the node by querying the container identification list instruction running in the container technology platform, and traverse and query the business containers running on the node in turn.
[0064] The first instruction can be a container inspection instruction, which is used to obtain the container information of the business container; the second instruction can be an instruction to execute commands in the container, which is an instruction of the container technology platform command line tool, used to execute commands in the running container technology platform. It allows users to send commands or run command line programs to the running container without restarting the container, which is very useful for container management and maintenance.
[0065] This embodiment can comprehensively scan the environmental information of all nodes in the target cluster, as well as the specific information of the business containers on the nodes, to ensure the comprehensiveness and depth of the middleware inspection. Through the preset list and middleware process keywords, the type of middleware running in the business container can be accurately identified to avoid false positives or negatives, and improve the accuracy of middleware identification. It should be noted that this embodiment not only collects the static version number of the middleware, but also obtains the dynamic running version number and running status of the middleware through dynamic inspection instructions, and associates this information with specific nodes and containers, providing detailed runtime data for subsequent analysis and operation and maintenance.
[0066] In an optional embodiment, obtaining container information of a target business container includes: executing a first instruction in an inspection script to obtain a container namespace, a container name, a container identifier, and a container image name of the target business container; and executing a second instruction in the inspection script in the target business container to obtain operating system information within the container of the target business container.
[0067] Optionally, by executing the first instruction to obtain the container namespace, container name, container identifier, and container image name, the operating environment and configuration of each business container can be accurately identified, providing key context information for subsequent middleware inspections. Execute the second instruction in the business container, enter the business container, obtain the operating system and version number in the container, and record them. This is crucial to understanding the operating environment of the middleware, because different operating systems or versions may affect the compatibility, performance, and security of the middleware.
[0068] In an optional embodiment, querying whether middleware in a preset list is running in a target business container includes: querying whether the current middleware in the preset list is running in the target business container based on a middleware process keyword; if the current middleware is running in the target business container, using the current middleware as the queried middleware; if the current middleware is not running in the target business container, using the next middleware of the current middleware in the preset list as the new current middleware, and repeating the above operations until the last middleware in the preset list is reached.
[0069] Optionally, by using a preset middleware process keyword, it is possible to accurately determine whether a specific middleware is running in the target business container, thereby avoiding false positives or false negatives and improving the accuracy of identification. In addition, in this embodiment, a method of looping through the preset middleware list is adopted to ensure that all middleware that may be running in the container can be detected, and even if multiple types of middleware are running in the container at the same time, they can be checked and confirmed one by one.
[0070] Optionally, maintain a list of middleware, including middleware process keywords, instructions for obtaining the middleware main directory, instructions for obtaining the middleware binary file storage directory, instructions for obtaining the middleware static version number, instructions for obtaining the middleware health status, and instructions for obtaining the middleware running version. Enter the container by executing command instructions in the container, and check the middleware information in turn according to the middleware list.
[0071] Optionally, the command to display the complete status information of all processes in the system and the middleware process keyword can be used to determine whether the middleware exists and record it. If it exists, continue to obtain the middleware information and execute the next step; if it does not exist, check the next middleware type according to the middleware list; among them, the command to display the complete status information of all processes in the system is used to display detailed information of all processes in the system.
[0072] In an optional embodiment, when the path information includes a main directory acquisition instruction and a binary file storage directory acquisition instruction, and the version check instruction includes a static version number acquisition instruction, a running version acquisition instruction, and a health status acquisition instruction, the middleware running information of the target middleware is obtained, including: based on the main directory acquisition instruction, obtaining the main directory information corresponding to the target middleware; based on the main directory information and the static version number acquisition instruction, obtaining the static version number corresponding to the target middleware; based on the main directory information and the binary file storage directory acquisition instruction, obtaining the binary file storage directory information corresponding to the target middleware; based on the binary file storage directory information and the health status acquisition instruction, obtaining the middleware running status corresponding to the target middleware; according to the running version acquisition instruction, obtaining the dynamic running version number corresponding to the target middleware.
[0073] Optionally, the main directory information of the target middleware in the container is obtained by executing the main directory acquisition instruction, where the main directory information refers to the main directory location of the middleware inside the container. For the middleware, this directory is where important resources such as configuration files, log files, and executable files are stored during its runtime. Obtaining the main directory information of the middleware is a key step in the automated inspection solution, which allows the inspection script to further check the static configuration, version files, health check scripts, etc. of the middleware to determine the type, version, and running status of the middleware. Based on the main directory information and static version number acquisition instructions, the static version number can be read directly from the installation package or configuration file of the middleware.
[0074] By executing the binary file storage directory acquisition instruction, the binary file storage directory of the middleware is located, that is, the directory of the binary executable file. In this embodiment, the middleware binary file storage directory refers to the directory that stores the middleware-related executable files and scripts. These executable files include the startup scripts, control scripts, and core service programs of the middleware itself. The binary file storage directory is an important location for runtime middleware health checks and dynamic version queries, because the running status and version information of the middleware can be obtained by executing specific commands or scripts under these directories.
[0075] Optionally, based on the binary file storage directory information and health status acquisition instructions, you can execute the middleware's own health check script or command to directly determine whether the middleware's operating status is normal and promptly discover potential faults or performance issues. By executing the dynamic running version acquisition instruction, you can obtain the actual version information of the middleware at runtime, which helps to confirm whether the actual running version of the middleware is consistent with the static version and whether unrecorded updates are performed.
[0076] In an optional embodiment, an inspection result is obtained based on the node information, container information and middleware operation information, including: splicing the node information, container information and middleware operation information according to a predetermined format to obtain the inspection result; mounting the inspection result to the inspection result directory generated on the node.
[0077] Optionally, the collected node information, container information, and middleware operation information can be spliced in a predetermined format to convert these originally disorganized data into structured inspection results, which is convenient for subsequent processing and analysis. Through the splicing process, it can be ensured that the inspection results contain key information such as the node's operating environment, the detailed configuration of the container, and the operating status of the middleware.
[0078] Optionally, the recorded host basic information (cluster, host operating system), container basic information (container namespace, container name, container ID, container image name, container operating system and version number), and middleware information (middleware name, whether running, whether the status is normal, static version number, dynamic running version number) are spliced according to a fixed format and written into the mounted inspection result directory. Further mounting the inspection results to the inspection result directory on the node can achieve permanent storage of the results, which is convenient for further data analysis, historical tracking and troubleshooting.
[0079] In an optional embodiment, an inspection script is run based on an extension kit, a target middleware running on a business container included in a node is determined, an inspection is performed on the target middleware, and an inspection result is obtained, including: configuring a job template based on the extension kit, wherein the job template is used to specify an operation rule of an inspection container group, wherein the operation rule includes at least one of the following: the inspection container group automatically terminates after executing a scheduled task, and the inspection container group works according to a preset scheduled task; an inspection script is run based on the extension kit and the job template, the target middleware is determined, an inspection is performed on the target middleware, and an inspection result is obtained.
[0080] Optionally, the configuration of job templates allows inspection tasks to be customized according to needs, including inspection frequency, execution time, and automatic termination rules after task execution, which can provide flexibility for on-demand inspection and resource management. By setting the rule that the inspection container group automatically terminates after executing the scheduled task, it can ensure that the inspection container does not occupy resources in the cluster for a long time, improve resource utilization, and reduce the potential impact on business containers. The preset scheduled task function enables middleware inspections to be automatically executed periodically without manual intervention, ensuring the continuity and timeliness of inspections.
[0081] As an optional implementation example, the controller template can be configured through the scheduled task component of the extension suite, and the scheduling configuration can be customized according to the needs to generate a controller delivery cycle for periodically creating controller objects and delivering them to all clusters; the inspection records in the corresponding directory on the host machine can be obtained through the Ansable task to form statistical data, and abnormal situations can be screened for alarms to remind operation and maintenance personnel to perform maintenance.
[0082] Optionally, by configuring the scheduled task component and controller template, you can achieve automation and periodic scheduling of the middleware inspection task. Ensure that the inspection task can be automatically executed on each node of the target cluster according to the preset schedule. The customized list configuration allows the operation and maintenance personnel to flexibly set the inspection frequency and time according to business needs and middleware characteristics, ensuring that the inspection is neither too frequent to interfere with the business nor too outdated to find abnormalities. After the inspection script is executed, the results are saved in the inspection directory of the host machine. These records are obtained through the Ansable task to achieve centralized management and unified processing of inspection results.
[0083] Based on the above embodiments and optional embodiments, the present application proposes an optional implementation method of middleware inspection. Figure 3 is a flow chart of an optional middleware inspection method according to the present application, such as Figure 3 As shown, the method includes:
[0084] Based on the controller provided by the extension, the middleware automatic inspection is completed by regularly detecting the middleware running status of the business container on the node in the cluster. The cluster is controlled and managed by the container orchestration tool. The cluster includes a group of physical or virtual machines that work together to run and manage containerized applications. It realizes functions such as data statistics and early warning to ensure normal production cluster operation and maintenance. The specific implementation process of the method in this embodiment is as follows:
[0085] Step S1, installing the extension kit in the cluster.
[0086] Step S2, customizing the controller, specifically includes:
[0087] Step S21, configure the controller startup rule to never, to ensure that the nodes added later will also be sent a temporary inspection container group by the controller object;
[0088] Step S22: Generate an inspection directory on each node (i.e., host) in the cluster and mount it into the inspection container group. After the inspection script is executed, the result output is saved in the directory;
[0089] Step S23, write an inspection script and inject it into the extension kit container image, execute the script on each node through the inspection container group issued by the controller and write the results to the mounted inspection result directory. The specific inspection logic of the inspection script is the same as above, and will not be repeated here.
[0090] Step S3: regular inspection and feedback of inspection results.
[0091] It should be noted that the middleware inspection method provided in the embodiment of the present application is to deploy an extension kit in the container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on the nodes included in the target cluster, wherein the node is a physical server or virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; through the extension kit, the inspection container group is deployed to the target cluster, wherein the extension kit includes an inspection script; based on the extension kit, the inspection script is run to determine the target middleware running on the business container included in the node, and the target middleware is inspected to obtain the inspection result, which solves the problem of low efficiency and accuracy of middleware inspection caused by manual or static statistics of middleware operation information in private cloud clusters in related technologies. Thus, the purpose of real-time, comprehensive and accurate version and status inspection of the middleware in the running business container is achieved, thereby improving the real-time and accuracy of the inspection, simplifying the operation and maintenance process, and timely warning of safety hazards.
[0092] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0093] Example 2
[0094] The embodiment of the present application also provides a middleware inspection device. It should be noted that the middleware inspection device of the embodiment of the present application can be used to execute the middleware inspection method provided by the embodiment of the present application. The middleware inspection device provided by the embodiment of the present application is introduced below.
[0095] According to an embodiment of the present application, a device for implementing the above-mentioned middleware inspection method is also provided, such as Figure 4 As shown, the device includes: an extension module 300, which is used to deploy an extension kit in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the node is a physical server or a virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; a deployment module 302, connected to the extension module 300, used to deploy an inspection container group to the target cluster through the extension kit, wherein the extension kit includes an inspection script; an inspection module 304, connected to the deployment module 302, used to run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, inspect the target middleware, and obtain an inspection result.
[0096] The middleware inspection device provided in the embodiment of the present application is used to deploy an extension kit in a container orchestration platform by setting an extension module 300, wherein the extension kit is used to periodically perform inspection tasks on nodes included in the target cluster, wherein the node is a physical server or virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; the deployment module 302 is used to deploy the inspection container group to the target cluster through the extension kit, wherein the extension kit includes an inspection script; the inspection module 304 is used to run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, inspect the target middleware, and obtain the inspection result, thereby solving the problem of low efficiency and accuracy of middleware inspection caused by manual or static statistics of middleware operation information in private cloud clusters in related technologies. Thus, the purpose of real-time, comprehensive and accurate version and status inspection of the middleware in the running business container is achieved, thereby improving the real-time and accuracy of the inspection, simplifying the operation and maintenance process, and timely warning of safety hazards.
[0097] Optionally, in the middleware inspection device provided in the embodiment of the present application, the inspection module includes: a first determination sub-module, used to run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, and determine the node information, container information and middleware operation information to which the target middleware belongs; a first result sub-module, used to obtain the inspection result based on the node information, container information and middleware operation information.
[0098] Optionally, in the middleware inspection device provided in the embodiment of the present application, the first determination submodule includes: a first acquisition submodule, which is used to execute the inspection script based on the extension kit to obtain the node information of the node, wherein the node information at least includes: the cluster to which the node belongs, the operating system of the node; a second acquisition submodule, which is used to obtain the running container list corresponding to the node, and traverse and query the business containers included in the running container list, wherein the running container list is used to store the container identifier of the running container in the node; a third acquisition submodule, which is used to obtain the container information of the target business container in the running container list, wherein the container information at least includes: the container namespace , container name, container identifier, container image name and operating system information in the container, where the target business container is any business container in the running container list; a first query submodule, used to query whether the target business container is running middleware in a preset list, wherein the preset list includes at least N middlewares, and middleware process keywords, path information and version check instructions corresponding to the N middlewares, respectively, and N is an integer greater than or equal to 2; a fourth acquisition submodule, used to determine the queried middleware as the target middleware, and obtain the middleware running information of the target middleware, wherein the middleware running information includes at least a static version number, a dynamic running version number and a middleware running status.
[0099] Optionally, in the middleware inspection device provided in an embodiment of the present application, the third acquisition sub-module includes: a fifth acquisition sub-module, used to execute the first instruction in the inspection script to obtain the container namespace, container name, container identifier and container image name of the target business container; a sixth acquisition sub-module, used to execute the second instruction in the inspection script in the target business container to obtain the operating system information within the container of the target business container.
[0100] Optionally, in the middleware inspection device provided in the embodiment of the present application, the first query submodule includes: a second query submodule, which is used to query whether the current middleware in the preset list is running in the target business container based on the middleware process keyword; a first running submodule, which is used to use the current middleware as the queried middleware when the current middleware is running in the target business container; and a second running submodule, which is used to use the next middleware of the current middleware in the preset list as the new current middleware when the current middleware is not running in the target business container, and repeat the above operations until the last middleware in the preset list is reached.
[0101] Optionally, in the middleware inspection device provided in the embodiment of the present application, the fourth acquisition sub-module includes: a seventh acquisition sub-module, which is used to acquire the main directory information corresponding to the target middleware based on the main directory acquisition instruction; an eighth acquisition sub-module, which is used to acquire the static version number corresponding to the target middleware based on the main directory information and the static version number acquisition instruction; a ninth acquisition sub-module, which is used to acquire the binary file storage directory information corresponding to the target middleware based on the main directory information and the binary file storage directory acquisition instruction; a tenth acquisition sub-module, which is used to acquire the middleware running status corresponding to the target middleware based on the binary file storage directory information and the health status acquisition instruction; and a tenth acquisition sub-module, which is used to acquire the dynamic running version number corresponding to the target middleware according to the running state version acquisition instruction.
[0102] Optionally, in the middleware inspection device provided in an embodiment of the present application, the first result sub-module includes: a second result sub-module, used to splice node information, container information and middleware operation information according to a predetermined format to obtain an inspection result; a first mounting sub-module, used to mount the inspection result to an inspection result directory generated on the node.
[0103] Optionally, in the middleware inspection device provided in the embodiment of the present application, the inspection module includes: a first configuration sub-module, used to configure a job template based on an extension kit, wherein the job template is used to specify the operation rules of the inspection container group, wherein the operation rules include at least one of the following: the inspection container group automatically terminates after executing a scheduled task, and the inspection container group works according to a preset scheduled task; a second inspection sub-module, used to run an inspection script based on the extension kit and the job template, determine the target middleware, inspect the target middleware, and obtain an inspection result.
[0104] It should be noted that the above-mentioned expansion module 300, deployment module 302, and inspection module 304 correspond to steps S200 to S204 in Example 1, and the two modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0105] Example 3
[0106] An embodiment of the present application may provide an electronic device, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5(only one is shown) processor 1002, memory 1004, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0107] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0108] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: deploy an extension kit in the container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on the nodes included in the target cluster, wherein the node is a physical server or virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; through the extension kit, deploy the inspection container group to the target cluster, wherein the extension kit includes an inspection script; run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, inspect the target middleware, and obtain the inspection result.
[0109] The processor can also call the information and applications stored in the memory through the transmission device to perform the following steps: run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, and determine the node information, container information and middleware operation information to which the target middleware belongs; obtain the inspection results based on the node information, container information and middleware operation information.
[0110] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: execute the inspection script based on the extension kit to obtain the node information of the node, wherein the node information at least includes: the cluster to which the node belongs and the operating system of the node; obtain the running container list corresponding to the node, and traverse and query the business containers included in the running container list, wherein the running container list is used to store the container identifier of the running container in the node; for the target business container in the running container list, obtain the container information of the target business container, wherein the container information at least includes: container namespace, container name, container identifier, container image name and operating system information in the container, and the target business container is any business container in the running container list; query whether the target business container is running with the middleware in the preset list, wherein the preset list includes at least N middlewares, and the middleware process keywords, path information and version check instructions corresponding to the N middlewares, respectively, and N is an integer greater than or equal to 2; determine the queried middleware as the target middleware, and obtain the middleware running information of the target middleware, wherein the middleware running information at least includes the static version number, the dynamic running version number and the middleware running status.
[0111] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: execute the first instruction in the inspection script to obtain the container namespace, container name, container identifier and container image name of the target business container; execute the second instruction in the inspection script in the target business container to obtain the operating system information in the container of the target business container.
[0112] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: query whether the current middleware in the preset list is running in the target business container based on the middleware process keyword; when the current middleware is running in the target business container, use the current middleware as the queried middleware; when the current middleware is not running in the target business container, use the next middleware of the current middleware in the preset list as the new current middleware, and repeat the above operations until the last middleware in the preset list is reached.
[0113] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: based on the main directory acquisition instruction, obtain the main directory information corresponding to the target middleware; based on the main directory information and the static version number acquisition instruction, obtain the static version number corresponding to the target middleware; based on the main directory information and the binary file storage directory acquisition instruction, obtain the binary file storage directory information corresponding to the target middleware; based on the binary file storage directory information and the health status acquisition instruction, obtain the middleware running status corresponding to the target middleware; according to the running status version acquisition instruction, obtain the dynamic running version number corresponding to the target middleware.
[0114] The processor can also call the information and applications stored in the memory through the transmission device to perform the following steps: splicing the node information, container information and middleware operation information according to a predetermined format to obtain the inspection results; mounting the inspection results to the inspection result directory generated on the node.
[0115] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: configure the job template based on the extension kit, wherein the job template is used to specify the operation rules of the inspection container group, wherein the operation rules include at least one of the following: the inspection container group automatically terminates after completing the scheduled task, and the inspection container group works according to the preset scheduled task; run the inspection script based on the extension kit and the job template, determine the target middleware, inspect the target middleware, and obtain the inspection result.
[0116] By adopting the embodiment of the present application, a scheme for middleware inspection is provided. By deploying an extension kit in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the node is a physical server or a virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; by using the extension kit, the inspection container group is deployed to the target cluster, wherein the extension kit includes an inspection script; based on the inspection script running the extension kit, the target middleware running on the business container included in the node is determined, the target middleware is inspected, and the inspection result is obtained, thereby achieving the purpose of real-time, comprehensive and accurate version and status inspection of the middleware in the running business container, thereby solving the technical problem of low efficiency and accuracy of middleware inspection caused by manual or static statistics of middleware operation information in a private cloud cluster.
[0117] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations shown.
[0118] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0119] Example 4
[0120] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the middleware inspection method provided in the first embodiment.
[0121] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0122] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of the middleware inspection method.
[0123] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0124] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0127] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0128] If the integrated unit 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 technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0129] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A middleware inspection method, characterized in that: include: Deploy an extension kit in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the nodes are physical servers or virtual machines in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; Deploy the inspection container group to the target cluster through the extension kit, wherein the extension kit includes an inspection script; The inspection script is run based on the extension kit, a target middleware running on a business container included in the node is determined, and the target middleware is inspected to obtain an inspection result.
2. The method according to claim 1, characterized in that The step of running the inspection script based on the extension kit, determining the target middleware running on the business container included in the node, inspecting the target middleware, and obtaining the inspection result includes: Running the inspection script based on the extension kit determines the target middleware running on the business container included in the node, and determines the node information, container information and middleware running information to which the target middleware belongs; The inspection result is obtained based on the node information, the container information and the middleware operation information.
3. The method according to claim 2, characterized in that The step of running the inspection script based on the extension kit, determining the target middleware running on the business container included in the node, and determining the node information, container information, and middleware running information to which the target middleware belongs includes: Executing the inspection script based on the extension kit to obtain node information of the node, wherein the node information at least includes: a cluster to which the node belongs and an operating system of the node; Obtain a running container list corresponding to the node, and perform a traversal query on the business containers included in the running container list, wherein the running container list is used to store container identifiers of running containers in the node; For the target business container in the running container list, obtain container information of the target business container, wherein the container information at least includes: a container namespace, a container name, a container identifier, a container image name, and operating system information in the container, and the target business container is any business container in the running container list; Query whether middleware in a preset list is running in the target business container, wherein the preset list includes at least N middleware, and middleware process keywords, path information, and version check instructions corresponding to the N middleware, respectively, where N is an integer greater than or equal to 2; The queried middleware is determined as the target middleware, and the middleware running information of the target middleware is obtained, wherein the middleware running information at least includes a static version number, a dynamic running version number and a middleware running status.
4. The method according to claim 3, characterized in that The acquiring container information of the target service container includes: Execute the first instruction in the inspection script to obtain the container namespace, the container name, the container identifier, and the container image name of the target business container; The second instruction in the inspection script is executed in the target service container to obtain the operating system information in the container of the target service container.
5. The method according to claim 4, characterized in that The querying whether the target service container is running middleware in a preset list includes: Based on the middleware process keyword, query whether the current middleware in the preset list is running in the target service container; When the current middleware is running in the target service container, the current middleware is used as the queried middleware; When the current middleware is not running in the target service container, the next middleware of the current middleware in the preset list is used as the new current middleware, and the above operation is repeatedly performed until the last middleware in the preset list is reached.
6. The method according to claim 4, characterized in that In the case where the path information includes a main directory acquisition instruction and a binary file storage directory acquisition instruction, and the version check instruction includes a static version number acquisition instruction, a running version acquisition instruction, and a health status acquisition instruction, the acquiring of the middleware running information of the target middleware includes: Based on the main directory acquisition instruction, acquiring the main directory information corresponding to the target middleware; Based on the main directory information and the static version number acquisition instruction, acquiring the static version number corresponding to the target middleware; Based on the main directory information and the binary file storage directory acquisition instruction, acquiring the binary file storage directory information corresponding to the target middleware; Based on the binary file storage directory information and the health status acquisition instruction, acquiring the middleware running status corresponding to the target middleware; The dynamic running version number corresponding to the target middleware is obtained according to the running version obtaining instruction.
7. The method according to claim 2, characterized in that The obtaining the inspection result based on the node information, the container information and the middleware operation information includes: The node information, the container information and the middleware operation information are spliced according to a predetermined format to obtain the inspection result; The inspection results are mounted to the inspection result directory generated on the node.
8. The method according to any one of claims 1 to 7, characterized in that The step of running the inspection script based on the extension kit, determining the target middleware running on the business container included in the node, inspecting the target middleware, and obtaining the inspection result includes: Based on the extension kit, a job template is configured, wherein the job template is used to specify the operation rules of the inspection container group, wherein the operation rules include at least one of the following: the inspection container group automatically terminates after performing a predetermined task, and the inspection container group works according to a preset timed task; The inspection script is run based on the extension kit and the job template, the target middleware is determined, the target middleware is inspected, and the inspection result is obtained.
9. A middleware inspection device, characterized in that: include: An extension module, used to deploy an extension kit in a container orchestration platform, wherein the extension kit is used to periodically perform inspection tasks on nodes included in a target cluster, wherein the node is a physical server or a virtual machine in the target cluster, the target cluster is a cluster based on a private cloud, and N is an integer greater than or equal to 1; A deployment module is used to deploy the inspection container group to the target cluster through an extension kit, wherein the extension kit includes an inspection script; The inspection module is used to run the inspection script based on the extension kit, determine the target middleware running on the business container included in the node, inspect the target middleware, and obtain the inspection result.
10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 8 when running.