[go: up one dir, main page]

CN116910123B - Container task query method, device, equipment and storage medium - Google Patents

Container task query method, device, equipment and storage medium

Info

Publication number
CN116910123B
CN116910123B CN202310896929.6A CN202310896929A CN116910123B CN 116910123 B CN116910123 B CN 116910123B CN 202310896929 A CN202310896929 A CN 202310896929A CN 116910123 B CN116910123 B CN 116910123B
Authority
CN
China
Prior art keywords
container
task
node
container task
cloud platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310896929.6A
Other languages
Chinese (zh)
Other versions
CN116910123A (en
Inventor
朱清华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
Unicom Cloud Data Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
Unicom Cloud Data Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd, Unicom Digital Technology Co Ltd, Unicom Cloud Data Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202310896929.6A priority Critical patent/CN116910123B/en
Publication of CN116910123A publication Critical patent/CN116910123A/en
Application granted granted Critical
Publication of CN116910123B publication Critical patent/CN116910123B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a container task query method, device, equipment and storage medium, which are applied to the technical field of cloud platforms and are used for querying a tube-removing container task of a plurality of nodes in the cloud platform. The method comprises the steps of issuing a query script to a plurality of nodes of a cloud platform to enable each node to execute the query script to determine a tube-removing container task, and outputting indication information for indicating the tube-removing container task of each node, wherein the query script is used for determining the container task operated by the node through a container daemon of an access node, determining the container task operated by the node through an agent program of the access node, and comparing the container task determined by the container daemon with the container task determined by the agent program to determine the tube-removing container task. The method can determine the task of the pipe-out container of each node, and is beneficial to improving the reliability of the cloud platform.

Description

Container task query method, device, equipment and storage medium
Technical Field
The present application relates to the field of cloud platform technologies, and in particular, to a method, an apparatus, a device, and a storage medium for querying a container task.
Background
The development of cloud platform technology has important significance for modern transformation, digital transformation and informatization construction. With the development of container technology, a cloud platform based on the container technology is also widely applied.
When the cloud platform breaks away from platform management due to some reasons, the container task which breaks away from platform management may still serve as an application instance of the service, which may affect the normal operation of the whole application, thereby resulting in lower reliability of the cloud platform.
Disclosure of Invention
The application provides a container task query method, device, equipment and storage medium, which are used for solving the technical problem that the reliability of a cloud platform is lower because the container task which is separated from the platform management can still serve as an application instance of service to provide service to the outside and the normal operation of the whole application can be influenced.
In a first aspect, the present application provides a container task query method, for querying out-of-pipe container tasks of a plurality of nodes in a cloud platform, including:
Issuing a query script to a plurality of nodes in the cloud platform so that each node executes the query script and determines a task of taking off the container;
Outputting indication information, wherein the indication information is used for indicating the task of taking off the pipe container of each node;
Wherein the query script is for:
Determining a container task operated by the node through a container daemon of the access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
The method comprises the steps of determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
the container tasks determined by the container daemon are compared with the container tasks determined by the agent to determine out-of-pipe container tasks.
Optionally, according to the method, each node is deployed with an application instance corresponding to a preset application, and the versions of the application instances of the plurality of nodes are synchronously updated, the application instance runs in a container, and the method comprises the steps of:
If the versions of the plurality of application instances corresponding to the same application are inconsistent, and/or the application instances cannot run due to the fact that the port resources of the node where the application instance is located are occupied, a query script is issued to each node in the cloud platform.
Optionally, the method as described above, issuing the query script to the plurality of nodes in the cloud platform includes:
If the resources used by the container task operated by the node are more than the resources used by the container task fed back to the main program by the agent program, a query script is issued to each node in the cloud platform.
Optionally, the method includes the steps that the downstream equipment uploads the produced message to a message queue, the node obtains the message from the message queue to process the message, and the method comprises the steps of:
and if the message consumption in the message queue is abnormal, issuing a query script to each node in the cloud platform.
Optionally, the method as described above, comparing the container task determined by the container daemon with the container task determined by the agent program, and determining the out-of-pipe container task, includes:
the container task that exists in the container task determined from the container daemon and does not exist in the container task determined by the agent is taken as the unmanaged container task.
Optionally, the method as described above, outputting the indication information includes:
And acquiring tenant information corresponding to the task of the tube removal container, classifying and summarizing the task of the tube removal container according to the tenant information, and outputting the classified and summarized task of the tube removal container.
In a second aspect, the present application provides a container task query method, applied to a node in a cloud platform, the method comprising:
Determining a container task operated by the node through a container daemon of the access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
The method comprises the steps of determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
the container tasks determined by the container daemon are compared with the container tasks determined by the agent to determine out-of-pipe container tasks.
In a third aspect, the present application provides a container task query device, configured to query out-of-pipe container tasks of a plurality of nodes in a cloud platform, including:
The issuing module is used for issuing a query script to a plurality of nodes in the cloud platform so that each node executes the query script and determines a task of taking off the container;
the output module is used for outputting indication information, wherein the indication information is used for indicating the task of taking off the pipe container of each node;
Wherein the query script is for:
Determining a container task operated by the node through a container daemon of the access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
The method comprises the steps of determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
the container tasks determined by the container daemon are compared with the container tasks determined by the agent to determine out-of-pipe container tasks.
In a fourth aspect, the present application provides a container task query device, applied to a node in a cloud platform, including:
The system comprises a determining module, a determining module and a processing module, wherein the determining module is used for determining a container task operated by a node through a container daemon of an access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
the system comprises a determining module, a determining module and a processing module, wherein the determining module is also used for determining a container task operated by a node through an agent program of an access node, and the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
And the comparison module is used for comparing the container task determined by the container daemon with the container task determined by the agent program to determine the out-of-pipe container task.
In a fifth aspect, the present application provides an electronic device comprising a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the method as in any of the first aspects.
In a sixth aspect, the application provides a computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any of the first aspects.
The method is used for inquiring the out-of-pipe container tasks of a plurality of nodes in the cloud platform, and by issuing inquiry scripts to the plurality of nodes in the cloud platform, each node executes the inquiry scripts, determines the out-of-pipe container tasks, and outputs indication information for indicating the out-of-pipe container tasks of each node. The query script is specifically used for determining a container task operated by a node through a container daemon of the access node, determining the container task operated by the node through an agent program of the access node, and comparing the container task determined by the container daemon with the container task determined by the agent program to determine the unmanaged container task. According to the method and the device for inquiring the out-of-pipe container tasks of the cloud platform in batches, the out-of-pipe container tasks of all nodes of the cloud platform can be timely processed, the fact that the application instance corresponding to the out-of-pipe container tasks affects the normal operation of the whole application is avoided, the reliability of the application is improved, and the reliability of the cloud platform is further improved. Meanwhile, the task of taking off the management container is prevented from consuming resources of the cloud platform, and the utilization rate of the platform resources is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic view of a scenario of a container task query provided by an embodiment of the present application;
FIG. 2 is a flowchart of a method for querying tasks of a container according to an embodiment of the present application;
FIG. 3 is a flow chart II of a method for querying tasks of a container according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a task query device for a container according to an embodiment of the present application;
FIG. 5 is a second schematic diagram of a task query device for a container according to an embodiment of the present application;
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with related laws and regulations and standards, and provide corresponding operation entries for the user to select authorization or rejection.
The development of cloud platform technology has important significance for modern transformation, digital transformation and informatization construction. The cloud platform has the advantages that the cost is low, the reliability is high, and the cloud platform can enable a user to reduce the cost, improve the efficiency, improve the service continuity, the safety and the like, so as to adapt to the change of data transformation and the market.
The cloud platform can manage through a resource management framework, and the resource management framework can uniformly plan, allocate and manage hardware resources based on the angle of a data center. The hardware resource may be a CPU (Central Processing Unit ) of a server deploying the resource management framework, a memory, a hard disk resource, and the like.
When a container running on the resource management framework is in a certain condition, such as that a container main process becomes a bot process, a host machine is rammed, and the like, and cannot respond to an exit instruction sent by the resource management framework, the resource management framework considers that the container tasks do not exist, marks the container tasks as a non-running state, deletes container task information after a period of time, and the container tasks are out-of-management container tasks.
Because the out-of-pipe container task may still serve as an instance of the service, such uncontrolled application instances may affect the normal operation of the entire application, thereby affecting the reliability of the application, resulting in lower reliability of the cloud platform. Meanwhile, as the task of the container which is out of the pipe still consumes cloud platform resources in the background, the utilization rate of the platform resources is reduced.
The application provides a container task query method, which comprises the steps that container task query equipment issues query scripts to a plurality of nodes in a cloud platform in batches, each node can obtain a container task which is actually operated by the node at present through accessing a container daemon after receiving the query scripts, and the container task operated by the node is determined through accessing an agent program. The container task obtained according to the container daemon is the container task actually operated by the current node and comprises the out-of-pipe container task and the non-out-of-pipe container task, and the container task obtained according to the agent program is the container task managed by the main program, namely the non-out-of-pipe container task, so that the container task obtained by the container daemon is not used as the out-of-pipe container task, the out-of-pipe container task is inquired, the out-of-pipe container task is processed in time, the reliability of the application and the reliability of the cloud platform are improved, and the resource utilization rate of the cloud platform is also improved.
Fig. 1 is a schematic view of a scenario of a container task query provided in an embodiment of the present application, where, as shown in fig. 1, a container task query device may issue a query script to N nodes in batches, and after each node receives the query script, may execute the query script, determine a task of taking out of a container, and return the task of taking out of the container to the container task query device.
The container task query device can be deployed with an automatic operation and maintenance tool, which can be also called an automatic IT tool, and can automatically configure, deploy and arrange application programs and system services through a plurality of computers on a remote management node, so that query scripts can be distributed to a plurality of nodes in batches.
Each node is a server deploying an agent, and each node may run multiple containers that may be used to develop, deliver, and run applications.
The application provides a container task query method, which aims to solve the technical problems in the prior art.
The following describes the technical scheme of the present application and how the technical scheme of the present application solves the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a method for querying a task of a container according to an embodiment of the present application. The method of the embodiment is used for querying the unmanaged container tasks of the plurality of nodes in the cloud platform, can be executed by container task querying equipment, and can be realized by hardware, software or a combination of hardware and software. As shown in fig. 2, the method may include:
And S201, issuing a query script to a plurality of nodes in the cloud platform so that each node executes the query script and determines the task of taking off the container.
Wherein the query script is for:
Determining a container task operated by the node through a container daemon of the access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
The method comprises the steps of determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
the container tasks determined by the container daemon are compared with the container tasks determined by the agent to determine out-of-pipe container tasks.
In some embodiments, the cloud platform may be managed through a resource management framework, which may include agents, host programs, and the like. The agent program and the main program can be deployed on different servers, and the agent program is responsible for managing the tasks of the container running on the corresponding node and reporting the use condition of related resources to the main program. The node may be a server with an agent deployed with a resource management framework, on which the container tasks are run.
In some embodiments, when the query script is issued to the plurality of nodes of the cloud platform, the query script may be issued to the plurality of nodes periodically, and the period duration may be determined according to an actual situation, for example, may be one day. In another implementation scenario, when an application instance of the cloud platform fails, a query script may be issued to a plurality of nodes to determine whether the application instance cannot operate normally due to a task of taking out of a container. Out-of-pipe container tasks are container tasks that fail or are abnormal during operation, resulting in container tasks that are not normally managed and monitored by the resource management framework.
In some embodiments, the container daemon of the access node determines the container task that the node is running, and may access the API (Application Programming Interface ) interface of the container daemon. When the agent program of the access node determines the container task operated by the node, the API interface corresponding to the agent program can be accessed.
In some embodiments, the container tasks determined by the container daemon are container tasks that the current node actually runs, including out-of-pipe container tasks and non-out-of-pipe container tasks. The container task determined by the agent is the container task that the current node is running and is managed by the host program, i.e., the container task that is not unmanaged. Thus, when determining an out-of-pipe container task, a container task that exists in the container task determined from the container daemon and that does not exist in the container task determined by the agent may be taken as an out-of-pipe container task.
For example, if the container tasks determined by the container daemon include task 1, task 2, task 3, task 4, and task 5. The container tasks determined by the agent program comprise task 1, task 3 and task 4, and at this time, task 2 and task 5 can be taken as out-of-pipe container tasks.
And S202, outputting indication information, wherein the indication information is used for indicating the task of the out-of-pipe container of each node.
In some embodiments, the indication information may be output and displayed in the form of a graph, including, but not limited to, identification information of the nodes, identification information of out-of-pipe container tasks present within each node, and the like. The identification information of the node may include information such as an ID and an IP address of the node, and the identification information of the task of taking out of management container may include information such as a name of the container and a name of the task of taking out of management container.
In some embodiments, since the task of taking off the pipe container may be notified to the corresponding tenant after the task of taking off the pipe container is obtained in normal circumstances, when the instruction information is output, tenant information corresponding to the task of taking off the pipe container may be obtained, and the task of taking off the pipe container may be classified and summarized according to the tenant information and output.
The embodiment of the application provides a container task query method, which is used for issuing a query script to a plurality of nodes of a cloud platform so as to enable each node to determine a tube-removing container task and output the tube-removing container task for indicating each node. The query script is used for determining the actual container task currently operated by the node through the container daemon of the access node, and determining the container task currently managed by the host program through the agent program of the access node. The container tasks determined by the container daemon are compared with the container tasks determined by the agent to determine out-of-pipe container tasks. The method can issue inquiry scripts to a plurality of nodes of the cloud platform in batches, further can rapidly acquire the task of the tube-removing container of the plurality of nodes, and can timely process the task of the tube-removing container, so that the application instance corresponding to the task of the tube-removing container is prevented from affecting the normal operation of the whole application, the reliability of the application is improved, and the reliability of the cloud platform is further improved. Meanwhile, the task of taking off the management container is prevented from consuming resources of the cloud platform, and the utilization rate of the platform resources is improved.
In one or more embodiments of the present application, each node is deployed with an application instance corresponding to a preset application, and versions of the application instances of a plurality of nodes are updated synchronously, the application instance runs in a container:
If the versions of the plurality of application instances corresponding to the same application are inconsistent, and/or the application instances cannot run due to the fact that the port resources of the node where the application instance is located are occupied, a query script is issued to each node in the cloud platform.
Typically, an application may contain multiple application instances, running in different nodes. A node may contain multiple containers within which an application instance is running.
In an implementation scenario, if an application instance corresponding to a certain application that is out of the pipe exists, when version update is performed on the application instance of each node, the application instance that is not out of the pipe can achieve version update, but the application instance that is out of the pipe cannot perform version update, so that versions corresponding to different application instances of the same application are inconsistent, and the possibility that the application cannot operate normally exists. Therefore, when the versions of a plurality of application instances corresponding to the same application are inconsistent, a query script can be issued to each node of the cloud platform to acquire a task of taking off the management container, the task of taking off the management container is further cleaned, and the application instance of the new version is deployed on the node to ensure the normal operation of the application.
In an implementation scenario, multiple application instances corresponding to the same application occupy the same port of the node, if an application instance in a running state, which is out of the tube, exists on a certain node, but because the application instance is still occupying port resources, a new application instance cannot be started to run on the node because the port resources are occupied. Therefore, when the application instance cannot run due to the occupation of the port resources of the nodes, a query script can be issued to each node of the cloud platform to acquire the task of the out-of-control container, and the task of the out-of-control container is further cleaned, so that the port resources are prevented from being occupied, and a new application instance can use the port resources to run normally, so that the normal running of the application is ensured.
In summary, when the versions of multiple application instances corresponding to the same application are inconsistent and/or the application instance cannot run due to the occupation of the port resources of the node where the application instance is located, a query script is issued to each node in the cloud platform to query the task of the unmanaged container, and the task of the unmanaged container is further cleaned, so that the problem that the versions of the multiple application instances corresponding to the same application are inconsistent or the problem that the application cannot run due to the occupation of the port resources of the node where the application instance is located is avoided, normal running of the application is guaranteed, and the reliability of the application is improved.
In one or more embodiments of the present application, issuing a query script to a plurality of nodes in a cloud platform includes:
If the resources used by the container task operated by the node are more than the resources used by the container task fed back to the main program by the agent program, a query script is issued to each node in the cloud platform.
In an implementation scenario, the resources actually used by the container tasks operated by the nodes are more than the resources used by the container tasks fed back to the main program by the agent program, which indicates that other container tasks exist to operate and consume resources besides the container tasks fed back to the main program by the agent program, namely, the out-of-pipe container tasks exist, so that a query script can be issued to each node of the cloud platform to query the out-of-pipe container tasks, the out-of-pipe container tasks are further cleaned, the out-of-pipe container tasks are prevented from consuming cloud platform resources, and the resource utilization rate is improved.
In an implementation scenario, if there are out-of-pipe container tasks, the number of container tasks operated by the node and the number of container tasks actually operated are different, and besides resources are consumed, the cloud platform is caused to make a decision according to the number of wrong container tasks, so that the reliability of the cloud platform is affected. The number of container tasks may also be referred to as the number of application instances, or the number of copies.
In summary, when the resources used by the container task operated by the node are more than the resources used by the container task fed back to the main program by the agent program, a query script is issued to each node of the cloud platform, the out-of-pipe container task is queried in time, the out-of-pipe container task is cleaned, the out-of-pipe container task is prevented from continuously consuming the resources of the cloud platform, and the resource utilization rate is improved.
In one or more embodiments of the application, a downstream device uploads a message produced to a message queue, a node obtains the message from the message queue to process the message, and issues a query script to a plurality of nodes in a cloud platform, including:
and if the message consumption in the message queue is abnormal, issuing a query script to each node in the cloud platform.
In some embodiments, the multiple application instances configure the addresses of the same message queue, i.e. share the same message queue, at which time the multiple application instances obtain corresponding messages from the message queue for processing.
In one implementation scenario, after the out-of-pipe container task acquires a message in the message queue, the out-of-pipe container task cannot acquire the message, which results in that the message cannot be processed normally, i.e. consumption is abnormal.
For example, in a cloud platform scenario for storage, the downstream device may upload data to be stored as a message to the message queue, and if the task of taking out of the pipe container acquires the data to be stored, the data to be stored may not be stored, and the data to be stored is considered to be lost. Wherein the downstream device may be a terminal device of the user.
For example, in the cloud platform scenario for e-commerce services, a user may generate a purchase instruction by clicking on a "purchase" link on a terminal device, and send the purchase instruction to a message queue, so that a node processes the purchase instruction to implement a purchase operation. If the instruction is acquired by the task of taking off the container, the purchasing operation cannot be realized at this time, and the method can be specifically shown that after the user clicks "purchasing", the page of the terminal equipment does not respond, and the updating cannot be realized.
Therefore, when the message consumption in the message queue is abnormal, a query script can be issued to each node in the cloud platform to acquire the task of taking off the management container, the task of taking off the management container is processed, and the task of taking off the management container is prevented from acquiring the message in the message queue, so that the problem of abnormal message consumption is avoided, and the reliability of service processing is ensured.
In conclusion, when the message consumption in the message queue is abnormal, a query script is issued to each node of the cloud platform, the task of taking off the management container is queried in time, the task of taking off the management container is cleaned, and the task of taking off the management container is prevented from acquiring the message in the message queue, so that the problem of abnormal message consumption is avoided, and the reliability of service processing is guaranteed.
Fig. 3 is a flow chart two of a container task query method provided by an embodiment of the present application, which is applied to a node in a cloud platform, as shown in fig. 3, and the method includes:
And S301, determining a container task operated by the node through a container daemon of the access node, wherein the container daemon is used for monitoring the container task actually operated by the node.
In some embodiments, the node may be a server with an agent deployed with a resource management framework, on which the container tasks are run.
In some embodiments, container tasks run by the node may be obtained through an API interface accessing a container daemon, the container tasks comprising out-of-pipe container tasks and non-out-of-pipe container tasks.
And S302, determining a container task operated by the node through an agent program accessing the node, wherein the agent program is used for monitoring the container task operated by the node and feeding back to the main program so that the main program manages the container task.
In some embodiments, the host program managed container tasks, i.e., the unmanaged container tasks, run by the node may be determined through the API interface of the access agent.
S303, comparing the container task determined by the container daemon with the container task determined by the agent program to determine the out-of-pipe container task.
In some embodiments, container tasks that exist in container tasks determined from the container daemon and that do not exist in container tasks determined by the agent may be treated as out-of-pipe container tasks.
In the embodiment of the present application, the specific implementation process and principle of each step may refer to the above embodiment, and will not be described herein.
Fig. 4 is a schematic diagram of a container task query device according to an embodiment of the present application. As shown in fig. 4, an embodiment of the present application provides a container task query device 400, which is configured to query out-of-pipe container tasks of a plurality of nodes in a cloud platform, and may include a issuing module 401 and an output module 402.
The issuing module 401 is configured to issue a query script to a plurality of nodes in the cloud platform, so that each node executes the query script and determines a task of taking off the container;
the output module 402 is configured to output indication information, where the indication information is used to indicate a task of taking out of a pipe container of each node;
Wherein the query script is for:
Determining a container task operated by the node through a container daemon of the access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
The method comprises the steps of determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
the container tasks determined by the container daemon are compared with the container tasks determined by the agent to determine out-of-pipe container tasks.
The apparatus of this embodiment may be used to perform the method embodiment shown in fig. 2, and its implementation principle and technical effects are similar, and will not be described herein again.
Fig. 5 is a schematic diagram two of a container task query device according to an embodiment of the present application. As shown in fig. 5, an embodiment of the present application provides a container task query device 500, which is applied to a node in a cloud platform, and may include a determining module 501 and a comparing module 502.
A determining module 501, configured to determine, by means of a container daemon of an access node, a container task that the node operates, where the container daemon is configured to monitor the container task that the node actually operates;
The determining module 501 is further configured to determine a container task operated by the node through an agent program accessing the node, where the agent program is configured to monitor the container task operated by the node and feed back the container task to the main program, so that the main program manages the container task;
And the comparison module 502 is used for comparing the container task determined by the container daemon with the container task determined by the agent program to determine the out-of-pipe container task.
The apparatus of this embodiment may be used to execute the method embodiment shown in fig. 3, and its implementation principle and technical effects are similar, and will not be described herein again.
Fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present application. As shown in fig. 6, an embodiment of the present application provides an electronic device 600 including a processor 601, and a memory 602 communicatively connected to the processor 601;
The memory 602 stores computer-executable instructions and the processor 601 executes the computer-executable instructions stored in the memory 602 to perform the method of the above-described method embodiments.
The specific implementation process of the processor 601 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 6, it should be understood that the Processor 601 may be a central processing unit (english: central Processing Unit, abbreviated as CPU), other general purpose processors, digital signal Processor (english: DIGITAL SIGNAL Processor, abbreviated as DSP), application-specific integrated Circuit (english: application SPECIFIC INTEGRATED Circuit, abbreviated as ASIC), and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory 602 may include high-speed RAM memory or may also include nonvolatile storage NVM, such as at least one disk memory.
The processor 601 and the memory 602 are connected by a bus 603, and the bus 603 may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus 603 may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the bus 603 in the present figures is not limited to only one bus or to one type of bus.
The embodiment of the application provides a computer readable storage medium, wherein computer executing instructions are stored in the computer readable storage medium, and the computer executing instructions are used for realizing the method of the method embodiment when being executed by a processor.
The computer readable storage medium described above may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an Application SPECIFIC INTEGRATED Circuits (ASIC). The processor and the readable storage medium may reside as discrete components in a device.
An embodiment of the present application provides a computer program product, including a computer program, where the computer program when executed by a processor implements a method provided by any of the embodiments of the present application.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are alternative embodiments, and that the acts and modules referred to are not necessarily required for the present application.
It should be further noted that, although the steps in the flowchart are sequentially shown as indicated by arrows, the steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in the flowcharts may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order in which the sub-steps or stages are performed is not necessarily sequential, and may be performed in turn or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
It will be appreciated that the device embodiments described above are merely illustrative and that the device of the application may be implemented in other ways. For example, the division of the units/modules in the above embodiments is merely a logic function division, and there may be another division manner in actual implementation. For example, multiple units, modules, or components may be combined, or may be integrated into another system, or some features may be omitted or not performed.
In addition, each functional unit/module in each embodiment of the present application may be integrated into one unit/module, or each unit/module may exist alone physically, or two or more units/modules may be integrated together, unless otherwise specified. The integrated units/modules described above may be implemented either in hardware or in software program modules.
The integrated units/modules, if implemented in hardware, may be digital circuits, analog circuits, etc. Physical implementations of hardware structures include, but are not limited to, transistors, memristors, and the like. The processor may be any suitable hardware processor, such as CPU, GPU, FPGA, DSP and an ASIC, etc., unless otherwise specified. Unless otherwise indicated, the storage elements may be any suitable magnetic or magneto-optical storage medium, such as resistive Random Access Memory RRAM (Resistive Random Access Memory), dynamic Random Access Memory DRAM (Dynamic Random Access Memory), static Random Access Memory SRAM (Static Random-Access Memory), enhanced dynamic Random Access Memory EDRAM (ENHANCED DYNAMIC Random Access Memory), high-Bandwidth Memory HBM (High-Bandwidth Memory), hybrid storage cube HMC (Hybrid Memory Cube), etc.
The integrated units/modules may be stored in a computer readable memory if implemented in the form of software program modules and sold or used as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in whole or in part in the form of a software product stored in a memory, comprising several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method of the various embodiments of the present application. The Memory includes a U disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, etc. which can store the program codes.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments. The technical features of the above embodiments may be combined in any way, and for brevity, all of the possible combinations of the technical features of the above embodiments are not described, but should be considered as the scope of the description
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. The container task query method is characterized by being used for querying out-of-pipe container tasks of a plurality of nodes in a cloud platform, and comprises the following steps:
Issuing a query script to a plurality of nodes in the cloud platform so that each node executes the query script to determine a task of taking off a container;
outputting indication information, wherein the indication information is used for indicating the task of the out-of-pipe container of each node;
wherein the query script is configured to:
determining a container task operated by a node through a container daemon of an access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
and comparing the container task determined from the container daemon with the container task determined by the agent program to determine an out-of-pipe container task.
2. The method of claim 1, wherein each node is deployed with an application instance corresponding to a preset application, and versions of the application instances of the plurality of nodes are synchronously updated, the application instances running in a container, and wherein the issuing a query script to the plurality of nodes in the cloud platform comprises:
If the versions of a plurality of application instances corresponding to the same application are inconsistent, and/or the application instances cannot run due to the fact that the port resources of the node where the application instance is located are occupied, a query script is issued to each node in the cloud platform.
3. The method of claim 1, wherein the issuing a query script to a plurality of nodes in the cloud platform comprises:
and if the resources used by the container tasks operated by the nodes are more than the resources used by the container tasks fed back to the main program by the agent program, issuing a query script to each node in the cloud platform.
4. The method of claim 1, wherein the downstream device uploads the generated message to a message queue, and wherein a node obtains the message from the message queue to process the message, and wherein the issuing the query script to the plurality of nodes in the cloud platform comprises:
And if the message consumption in the message queue is abnormal, issuing a query script to each node in the cloud platform.
5. The method of any of claims 1-4, wherein the comparing the container tasks determined from the container daemon with the container tasks determined by the agent to determine out-of-pipe container tasks comprises:
The container task that exists in the container task determined from the container daemon and that does not exist in the container task determined by the agent is taken as an out-of-pipe container task.
6. The method of claim 5, wherein the outputting the indication information comprises:
And acquiring tenant information corresponding to the pipe-out container task, classifying and summarizing the pipe-out container task according to the tenant information, and outputting the classified and summarized pipe-out container task.
7. A container task query method, applied to a node in a cloud platform, the method comprising:
determining a container task operated by a node through a container daemon of an access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
and comparing the container task determined from the container daemon with the container task determined by the agent program to determine an out-of-pipe container task.
8. The container task query device is characterized by being used for querying out-of-pipe container tasks of a plurality of nodes in a cloud platform, and comprises the following components:
the issuing module is used for issuing a query script to a plurality of nodes in the cloud platform so that each node executes the query script and determines a task of taking off a container;
The output module is used for outputting indication information, wherein the indication information is used for indicating the task of the out-of-pipe container of each node;
wherein the query script is configured to:
determining a container task operated by a node through a container daemon of an access node, wherein the container daemon is used for monitoring the container task actually operated by the node;
determining a container task operated by a node through an agent program of an access node, wherein the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
and comparing the container task determined from the container daemon with the container task determined by the agent program to determine an out-of-pipe container task.
9. A container task querying device, applied to a node in a cloud platform, comprising:
The system comprises a determining module, a determining module and a processing module, wherein the determining module is used for determining a container task operated by a node through a container daemon of an access node, and the container daemon is used for monitoring the container task actually operated by the node;
The system comprises a determining module, a determining module and a processing module, wherein the determining module is also used for determining a container task operated by a node through an agent program of an access node, and the agent program is used for monitoring the container task operated by the node and feeding back the container task to a main program so that the main program manages the container task;
And the comparison module is used for comparing the container task determined by the container daemon with the container task determined by the agent program to determine the out-of-pipe container task.
10. An electronic device comprising a processor and a memory communicatively coupled to the processor;
The memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1 to 7.
11. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1 to 7.
CN202310896929.6A 2023-07-20 2023-07-20 Container task query method, device, equipment and storage medium Active CN116910123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310896929.6A CN116910123B (en) 2023-07-20 2023-07-20 Container task query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310896929.6A CN116910123B (en) 2023-07-20 2023-07-20 Container task query method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116910123A CN116910123A (en) 2023-10-20
CN116910123B true CN116910123B (en) 2025-10-28

Family

ID=88352648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310896929.6A Active CN116910123B (en) 2023-07-20 2023-07-20 Container task query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116910123B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119484286A (en) * 2024-11-07 2025-02-18 中国建设银行股份有限公司 Node operation and maintenance method and device for container cloud platform

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813497A (en) * 2020-06-30 2020-10-23 绿盟科技集团股份有限公司 A method, device, medium and computer equipment for abnormal detection of container environment
CN114861168A (en) * 2022-05-20 2022-08-05 上海磐御网络科技有限公司 Anti-escape attack behavior deception honeypot construction method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776212B (en) * 2016-12-09 2020-02-25 中电科华云信息技术有限公司 Supervision system and method for container cluster deployment of multi-process application
US10248449B1 (en) * 2016-12-27 2019-04-02 Virtuozzo International Gmbh Application containers running inside virtual machine
CN110908859B (en) * 2019-10-17 2023-05-30 平安科技(深圳)有限公司 Application service processing method, device, terminal and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813497A (en) * 2020-06-30 2020-10-23 绿盟科技集团股份有限公司 A method, device, medium and computer equipment for abnormal detection of container environment
CN114861168A (en) * 2022-05-20 2022-08-05 上海磐御网络科技有限公司 Anti-escape attack behavior deception honeypot construction method

Also Published As

Publication number Publication date
CN116910123A (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN111988200B (en) Automatic regression testing method and device based on real flow
US10063644B1 (en) Managing operation of instances
CN110932933B (en) Network condition monitoring method, computing device and computer storage medium
CN113067875B (en) Access method, device and equipment based on dynamic flow control of micro-service gateway
US10642585B1 (en) Enhancing API service schemes
CN112199052B (en) File downloading method and device and computer equipment
US20210117263A1 (en) Using Real-Time Analytics To Manage Application Features
CN116910123B (en) Container task query method, device, equipment and storage medium
CN110069217B (en) Data storage method and device
CN114285903B (en) Request processing method, device, system and electronic device
CN113760458A (en) Node management method and device, electronic equipment and storage medium
CN110058866B (en) Cluster component installation method and equipment
CN109962941B (en) Communication method, device and server
CN119127625A (en) Database node status monitoring method and device, electronic device and storage medium
CN115484267B (en) Multi-cluster deployment processing method and device, electronic equipment and storage medium
US10496467B1 (en) Monitoring software computations of arbitrary length and duration
US11669140B2 (en) Techniques for monitoring power device alarms
CN116545835A (en) Fault alarm processing method and device, electronic equipment and storage medium
CN112235138B (en) Server access monitoring method and device, proxy server and storage medium
CN116257126A (en) Method, system, storage medium and equipment for clearing PSU errors
CN115665163A (en) A server detection method, device, computer equipment and readable storage medium
CN107632917B (en) Server system and temperature monitoring method thereof
CN118827550B (en) Flow control methods, devices, servers, storage media, and software products
CN119226320B (en) Data processing method, device, apparatus and program product
CN116204235A (en) BIOS degradation processing method, device, equipment and readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant