CN116599826A - Container maintenance method, device and storage medium - Google Patents

Container maintenance method, device and storage medium Download PDF

Info

Publication number
CN116599826A
CN116599826A CN202310552091.9A CN202310552091A CN116599826A CN 116599826 A CN116599826 A CN 116599826A CN 202310552091 A CN202310552091 A CN 202310552091A CN 116599826 A CN116599826 A CN 116599826A
Authority
CN
China
Prior art keywords
container
message
controller
message queue
containers
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.)
Pending
Application number
CN202310552091.9A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology 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 Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310552091.9A priority Critical patent/CN116599826A/en
Publication of CN116599826A publication Critical patent/CN116599826A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a container maintenance method, a device and a storage medium, relates to the field of financial science and technology or other related fields, and can be used in the financial field or other fields. The method is applied to a server, a container controller and a message queue are operated on the server, and the container controller and the message queue are established based on node. Js technology, and the method comprises the following steps: when the container self-checks that the state is abnormal, a first message is sent to a message queue, wherein the first message carries the identification of the container; the message queue sends a second message to the container controller, wherein the second message carries the identification of the container with abnormal state; the container controller destroys the container in abnormal state in response to the second message. Based on the method, automatic container maintenance can be realized, so that the workload of operation and maintenance personnel is greatly reduced, the efficiency of maintaining the abnormal container is improved, the accuracy of maintaining the abnormal container can be improved, and the continuity of service is guaranteed.

Description

Container maintenance method, device and storage medium
Technical Field
The present application relates to the field of financial technology or other related fields, and in particular, to a method, an apparatus, and a storage medium for maintaining a container.
Background
In recent years, with the popularization of technologies such as micro-service, containerization and the like, more and more applications are split into a plurality of small services, and each service can simultaneously run a plurality of same service examples to disperse the pressure brought by a huge user quantity to one service, so that the stability of the service is improved, and the business risk is reduced; while a container may be understood as a stand-alone micro-operating system within which applications and service instances may run.
In the process of service instance operation, various reasons exist to cause that the container cannot be used normally, and the service instance operated in the container can be used normally only after the container is restarted. If the user uses a service instance running in a container that cannot be used normally, the user experience is reduced and even the risk of funds or information is brought to the user. There is therefore a need to discover and handle containers in abnormal states in a timely manner.
In the related art, after a container that cannot be used normally is found, the container may be manually maintained by an operation and maintenance person, specifically, the container is destroyed and a new container is started to run a service instance. However, in the case where a large number of containers are simultaneously serviced, the manual maintenance of the abnormal containers is inefficient and prone to errors.
Disclosure of Invention
The application provides a container maintenance method, a device and a storage medium, which are used for simplifying the work of operation and maintenance personnel and improving the operation and maintenance efficiency.
In a first aspect, the present application provides a method for maintaining a container, the method being applied to a server on which a container, a container controller and a message queue are running, the container controller and the message queue being established based on node. Js technology, the method comprising: when the container self-checks that the state is abnormal, a first message is sent to a message queue, wherein the first message carries the identification of the container; the message queue sends a second message to the container controller, wherein the second message carries the identification of the container with abnormal state; the container controller destroys the container in abnormal state in response to the second message.
Based on the method, automatic container maintenance can be realized, so that the workload of operation and maintenance personnel is greatly reduced, the efficiency of maintaining the abnormal container is improved, the accuracy of maintaining the abnormal container can be improved, and the continuity of service is guaranteed.
With reference to the first aspect, in certain possible implementations of the first aspect, the state exception includes: the memory occupancy is greater than a first predetermined threshold and/or the network delay is greater than a second predetermined threshold.
With reference to the first aspect, in certain possible implementation manners of the first aspect, the container performs a self-check every preset time period.
With reference to the first aspect, in certain possible implementation manners of the first aspect, a plurality of containers run in a server, and the method further includes: the message queue stores the first message in response to receiving the first message.
With reference to the first aspect, in certain possible implementations of the first aspect, the message queue sends the second message to the container controller, including: and the message queue sends a second message to the container controller under the condition that the number of the stored first messages reaches a preset threshold.
With reference to the first aspect, in certain possible implementations of the first aspect, after the container controller destroys the container, the method further includes: the container controller activates a corresponding number of new containers, the number of new containers being greater than or equal to the number of destruction containers.
With reference to the first aspect, in certain possible implementation manners of the first aspect, the method further includes: responding to the starting instruction of the container controller and the message queue, and starting the container controller and the message queue; the container controller starts the containers, wherein the number of the containers is determined according to the service requirement.
In a second aspect, the present application provides a container maintenance device, applied to a server, where the server is running a container, a container controller, and a message queue, where the container controller and the message queue are established based on node. Js technology, and the container is configured to send a first message to the message queue when a status abnormality is detected by itself, where the first message carries an identifier of the container; the message queue is used for sending a second message to the container controller, wherein the second message carries the identification of the container with abnormal state; and the container controller is used for responding to the second message and destroying the container with abnormal state.
With reference to the second aspect, in some possible implementations of the second aspect, the message queue is further configured to store the first message in response to receiving the first message.
With reference to the second aspect, in some possible implementations of the second aspect, the message queue may be configured to send the second message to the container controller if the number of stored first messages reaches a preset threshold.
With reference to the second aspect, in certain possible implementations of the second aspect, the container controller is further operable to initiate a corresponding number of new containers, the number of new containers being greater than or equal to the number of destruction containers.
With reference to the second aspect, in some possible implementations of the second aspect, the container controller and the message queue are further operable to initiate the container controller and the message queue in response to an initiation instruction of the container controller and the message queue; the container controller may also be used to activate containers, wherein the number of containers is determined based on the business requirements.
In a third aspect, the present application provides a container maintenance device comprising a memory and a processor, wherein the memory is for storing a computer program; the processor is configured to invoke and execute a computer program to implement the method of the first aspect and any of the possible implementations of the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium comprising a computer program which, when run on a computer, causes the computer to implement the method of the first aspect and any one of the possible implementations of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising: a computer program (which may also be referred to as code, or instructions) which, when executed, causes a computer to perform the method of the first aspect and any one of the possible implementations of the first aspect.
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 flow chart of a method for manually maintaining a container by an operation and maintenance person in the prior art according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method of maintaining a container provided by an embodiment of the present application;
FIG. 3 is another schematic flow chart of a method of maintaining a container provided by an embodiment of the present application;
FIG. 4 is a schematic block diagram of a server provided by an embodiment of the present application;
fig. 5 is another schematic block diagram of a server provided by 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.
The objects, technical solutions and advantages of the embodiments of the present application will be more apparent, and the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It will be apparent that the described embodiments are some, but not all, embodiments of the application.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In embodiments of the present application, the terms "first," "second," and the like are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the term "include" and any variations thereof are intended to cover a non-exclusive inclusion.
A container: the container is a view-isolation, resource-constrained, independent file system process collection. It isolates other resources of the system (including processes, file systems, network resources) with its own independent resource view. It is understood that a separate micro-operating system may internally run applications and services. This container, which contains the systems, applications and services, is compact and easy to quickly replicate the expansion.
Fig. 1 is a flow chart of a method for manually maintaining a container by an operation and maintenance person in the prior art. As shown in fig. 1, the flow of the method 100 of manually maintaining containers by an operation and maintenance person is as follows:
in step 110, a container is started and a service instance is run in response to an operation by an operator.
The operator can manually activate a container that can be used to run service instances and provide services on the outside.
In step 120, the operational status of the container is checked.
During the operation of the service instance by the container, the service personnel can manually check the working state of the container periodically or aperiodically in the process of providing service to the outside. Alternatively, the method of checking the container by the operation and maintenance personnel can also be to check the working state of the container in batches by running scripts or the like.
In addition, the working state of the current container can be monitored in real time by introducing a set of monitoring system, and if the working state of the container is abnormal, the monitoring system can inform operation and maintenance personnel in a mode of sending a system message and the like.
In step 130, in the event that the container is not in normal use, the container is destroyed in response to operation by the operation and maintenance personnel.
In either way, the working state of the container is checked, and after the operation staff finds the container with abnormal working state, the container is manually destroyed.
In step 140, in response to operation by the operator, a new container is started, running the service instance.
To ensure proper operation of the service instance, the service provider may initiate a new container to replace the previously destroyed container, which may continue to operate the service instance.
In the method, although the container with abnormal working state can be timely found by introducing the monitoring system and operation and maintenance personnel can be timely notified, the following problems still exist:
1. if the operation and maintenance personnel check the working state of the container in a purely manual mode, the operation and maintenance personnel have very high working pressure and low operability, and the operation and maintenance personnel need to continuously and manually check the container for 24 hours.
2. If the container with abnormal working state is found in time through the monitoring system, the timeliness of the operation and maintenance personnel receiving the system information can not be guaranteed, and the operation and maintenance personnel also need to stand by for 24 hours to process the container with abnormal working state.
3. The operation and maintenance personnel manually destroy the container with abnormal working state, and the workload of starting a new container is still relatively large.
4. When destroying the unusual container of operating condition, need accurate matching, manual operation is relatively easy maloperation. If the normal operating state of the container is destroyed when the operation and maintenance personnel manually maintain the container, new problems are likely to be caused.
In summary, the operation and maintenance personnel can more easily and manually maintain the containers under the condition of less containers. However, as the number of containers increases, the pressure of the containers maintained by operation and maintenance personnel is increased and the efficiency of manually maintaining abnormal containers is low and errors are prone to occur in the case where a large number of containers are simultaneously serviced.
In view of the above, the application provides a highly-automatic method for destroying and restarting containers and services, which can realize automatic container maintenance, thereby greatly reducing the workload of operation and maintenance personnel, improving the efficiency of maintaining abnormal containers, improving the accuracy of maintaining abnormal containers, and being beneficial to guaranteeing the continuity of services.
Fig. 2 is a schematic flow chart of a method for maintaining a container according to an embodiment of the present application, and the method 200 includes steps 210 to 230, and each step in the method 200 is described in detail below.
The method is applied to a server, and a container, a container controller and a message queue are operated on the server.
The container controller is mainly used for automatically starting and destroying the containers, and can be used for starting and destroying a single container or starting and destroying a plurality of containers in batches. The message queue functions to record which containers are abnormal and send messages to the container controller. Thus, the container controller can accurately control and process the abnormal container according to the message in the message queue.
In technical implementation, the container controller and the message queue are two independently running programs, and are developed and implemented through node. Js technology. The container controller subscribes to the content of the message queue, and once the content in the message queue changes, the container controller is actively notified, and can do corresponding logic operation.
In step 210, when the container self-checks for a state exception, a first message is sent to the message queue, where the first message carries an identification of the container.
In some embodiments, the operator may send a launch instruction for the container controller and the message queue to the server, which, in response to the launch instruction, launches the container controller and the message queue. After the container controller is started, the container may be started, and the service instance may be run in the container. The number of the starting containers can be determined according to the service requirements.
Wherein, the work of starting the container does not need manual operation of operation and maintenance personnel, and can be automatically executed by the container controller.
Optionally, a timing task may be provided in the container to perform self-checking, and the container checks its own working state once every a preset period of time. The preset time period may be, for example, 10 seconds, 30 seconds, 1 minute, or the like, and the setting of the preset time period is not limited in the present application.
Items of the container that are self-checking may include memory checking and network latency checking. The abnormal state of the container can be considered when the memory occupation of the container is greater than a first preset threshold, or when the network delay of the container is greater than a second preset threshold, or when both are satisfied.
The first predetermined threshold may be a predetermined memory value, for example, 2 Gigabytes (GB), 3GB, or 4GB, or a predetermined percentage of the total memory, for example, 80%, 90%, or 95%. The application is not limited in this regard.
When the container detects that the working state of the container is abnormal, a first message can be sent to the message queue, and the first message carries the identification of the container.
For example, the identification of the container is "container 1", and the first message may be "container 1". Or the specific kind of the state exception may be more specifically described in the first message, for example, the first message may be "container 1, memory exception", or "container 1, network delay exception", or "container 1, memory exception, network delay exception".
In step 220, the message queue sends a second message to the container controller, the second message carrying an identification of the container in the abnormal state.
The message queue, upon receiving the first message from the container, may send a second message to the container controller, the second message carrying an identification of the container in the abnormal state.
For example, if the identification of the container with the abnormal state is "container 1", the second message may be "container 1". Or the specific kind of the state exception may be more specifically described in the second message, for example, the second message may be "container 1, memory exception", or "container 1, network delay exception", or "container 1, memory exception, network delay exception".
Alternatively, multiple containers may be running in the server, and the message queue may store a first message from a container after receiving the first message.
Under the condition that the number of the first messages stored in the message queue reaches a preset threshold, the message queue can send a second message to the container controller, wherein the second message carries the identification of the container with abnormal state.
And a plurality of first messages are accumulated in the message queue and then the second messages are sent, so that compared with the case that the second messages are sent once when the message queue receives one first message, the method is beneficial to preventing the container controller from being frequently started, reducing the frequency of starting and destroying the container, and further beneficial to the normal operation of the server.
For example, if the preset threshold of the number of the first messages is 3, and the identifiers of the abnormal state containers are "container 1", "container 2" and "container 3", the second message may be "container 1; a container 2; a container 3". Or the specific type of the state exception can be more specifically described in the second message, for example, the second message can be "container 1, memory exception; a container 2, network delay anomaly; container 3, memory exception, network latency exception.
In step 230, the container controller destroys the container in the abnormal state in response to the second message.
The container controller can destroy the corresponding container according to the identification of the container with abnormal state carried in the second message.
As an example, the second message is "container 1; a container 2; container 3", the container controller may destroy container 1, container 2 and container 3 according to the identification of the container with abnormal status carried in the second message.
Based on the container maintenance method provided by the embodiment of the application, when the container self-checks that the state is abnormal, a first message is sent to a message queue, and the first message carries the identification of the container; the message queue sends a second message to the container controller, wherein the second message carries the identification of the container with abnormal state; the container controller responds to the second message to destroy the container with abnormal state, so that automatic container maintenance can be realized, the workload of operation and maintenance personnel is greatly reduced, the efficiency of maintaining the abnormal container is improved, the accuracy of maintaining the abnormal container is improved, and the continuity of service is guaranteed.
Optionally, after the container controller destroys the containers, the container controller may also activate new containers, the number of new containers being greater than or equal to the number of destroyed containers.
The new container can be used for replacing the container destroyed before so as to operate the service instance in the container destroyed before, thereby ensuring the normal operation of the whole business.
Fig. 3 is another schematic flow chart of a container maintenance method according to an embodiment of the present application, and the container maintenance method is described in detail below with reference to fig. 3.
In step 301, the operator sends a start instruction of the container controller and the message queue to the server, and the server starts the container controller and the message queue in response to the start instruction.
After the container controller and the message queue are started, a message channel can be established between the container controller and the message queue, and the container controller can subscribe to the content in the message queue and receive the message from the message channel.
After the container controller is started, the container may be started in step 302.
The number of the starting containers can be determined according to the service requirements. The operation of starting the container does not require manual operation by an operation and maintenance person.
In step 303, the container checks its own operating state every predetermined period of time.
Items of the container that are self-checking may include memory checking and network latency checking. The abnormal state of the container can be considered when the memory occupation of the container is greater than a first preset threshold, or when the network delay of the container is greater than a second preset threshold, or when both are satisfied.
In step 304, the container sends a first message to the message queue in case of checking its own operating state for anomalies.
The first message carries an identification of the container.
In step 305, the message queue stores the first message received from the container.
A plurality of containers may be run in the server and the message queue may store a first message from the containers after receiving the first message.
In step 306, a second message is sent to the container controller in case the number of first messages stored in the message queue reaches a preset threshold.
The second message carries the identification of the container with the abnormal state.
In step 307, the container controller destroys the container whose status is abnormal in response to the second message.
The container controller can destroy the corresponding container according to the identification of the container with abnormal state carried in the second message.
In step 308, the container controller initiates a new container.
Wherein the number of new containers is greater than or equal to the number of destruction containers. The new container can be used for replacing the container destroyed before so as to operate the service instance in the container destroyed before, thereby ensuring the normal operation of the whole business.
The container maintenance method provided by the application can be applied to the case of abnormal container working state caused by overlarge memory occupation, and can be extended to the case of abnormal container working state caused by various abnormal reasons, such as the problem of container network delay and the like. The container maintenance method provided by the application is a set of highly-automatic and efficient method and implementation, and has a large market popularization space.
Fig. 4 is a schematic block diagram of a container maintenance device provided by an embodiment of the present application. The container maintenance apparatus 400 is applied to a server on which a container 410, a message queue 420 and a container controller 430 are running, the message queue 420 and the container controller 430 being established based on node. Js technology.
The container 410 is configured to send a first message to the message queue when the self-checking detects that the status is abnormal, where the first message carries an identifier of the container; a message queue 420, configured to send a second message to the container controller, where the second message carries an identifier of the container with an abnormal state; and a container controller 430 for destroying the container having the abnormal state in response to the second message.
Optionally, the message queue 420 is further operable to store the first message in response to receiving the first message.
Alternatively, the message queue 420 may be configured to send a second message to the container controller if the number of stored first messages reaches a preset threshold.
Optionally, the container controller 430 may also be configured to activate a corresponding number of new containers, the number of new containers being greater than or equal to the number of destruction containers.
Optionally, the message queue 420 and the container controller 430 may be further configured to activate the container controller and the message queue in response to an activation instruction of the container controller and the message queue; the container controller 430 may also be used to activate containers, wherein the number of containers is determined based on the business requirements.
Fig. 5 is another schematic block diagram of a container maintenance device provided by an embodiment of the present application. As shown in fig. 5, the container maintenance device 500 may include at least one processor 510 for implementing the functions of the container maintenance device in the method provided by the present application. Reference is made specifically to the detailed description in the method examples, and details are not described here.
The container maintenance device 500 may also include a memory 520 for storing program instructions and/or data. Memory 520 is coupled to processor 510. The coupling in the present application is an indirect coupling or communication connection between devices, units or modules, which may be in electrical, mechanical or other form for the exchange of information between the devices, units or modules. Processor 510 may operate in conjunction with memory 520. Processor 510 may execute program instructions stored in memory 520. At least one of the at least one memory may be included in the processor.
The container maintenance device 500 may also include a communication interface 530 for communicating with other devices via a transmission medium, such that the devices used in the container maintenance device 500 may communicate with other devices. The communication interface 530 may be, for example, a transceiver, an interface, a bus, a circuit, or a device capable of implementing a transceiver function. Processor 510 may receive and transmit data and/or information using communication interface 530 and may be used to implement the container maintenance method described in the corresponding embodiments of fig. 2 or 3.
The specific connection medium between the processor 510, the memory 520, and the communication interface 530 is not limited in the present application. The present application is illustrated in fig. 5 as being coupled between processor 510, memory 520, and communication interface 530 via bus 540. The connection of the bus 540 to other components is shown by a bold line in fig. 5, and is merely illustrative and not limiting. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 5, but not only one bus or one type of bus.
In the embodiment of the present application, the processor may be a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps and logic blocks disclosed in the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
According to the method provided by the application, the application further provides a computer readable storage medium storing program code which when run on a computer causes the computer to perform the container maintenance method described in the corresponding embodiment of fig. 2 or fig. 3.
According to the method provided by the application, the application also provides a computer program product comprising: computer program code. The computer program code, when run on a computer, causes the computer to perform the container maintenance method described in the corresponding embodiment of fig. 2 or fig. 3.
The technical scheme provided by the application can be realized in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, a network device, a terminal device, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired, such as coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium such as digital video disc (digital video disc, DVD), or a semiconductor medium, etc.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A container maintenance method, applied to a server, on which a container, a container controller, and a message queue are running, the container controller and the message queue being established based on node. Js technology, the method comprising:
when the container self-checks that the state is abnormal, a first message is sent to the message queue, and the first message carries the identification of the container;
the message queue sends a second message to the container controller, wherein the second message carries the identification of the container with abnormal state;
and the container controller responds to the second message to destroy the container with abnormal state.
2. The method of claim 1, wherein the state exception comprises:
the memory occupancy is greater than a first predetermined threshold and/or the network delay is greater than a second predetermined threshold.
3. The method of claim 1, wherein the container is self-inspected every predetermined time period.
4. A method according to any one of claims 1 to 3, wherein a plurality of containers are run in the server, the method further comprising:
the message queue stores the first message in response to receiving the first message.
5. The method of claim 4, wherein the message queue sends a second message to the container controller, comprising:
and the message queue sends the second message to the container controller under the condition that the number of the stored first messages reaches a preset threshold.
6. The method of claim 4, wherein after the container controller destroys the container, the method further comprises:
the container controller initiates a corresponding number of new containers, the number of new containers being greater than or equal to the number of destruction containers.
7. A method according to any one of claims 1 to 3, further comprising:
responding to the starting instructions of the container controller and the message queue, and starting the container controller and the message queue;
the container controller starts the containers, wherein the number of the containers is determined according to service requirements.
8. The container maintenance device is characterized by being applied to a server, wherein a container, a container controller and a message queue are operated on the server, and the container controller and the message queue are established based on node. Js technology;
the container is used for sending a first message to the message queue when the state abnormality is detected by self, wherein the first message carries the identification of the container;
the message queue is used for sending a second message to the container controller, wherein the second message carries the identification of the container with abnormal state;
and the container controller is used for responding to the second message and destroying the container with abnormal state.
9. A container maintenance device is characterized by comprising a memory and a processor, wherein,
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the method of any one of claims 1 to 7.
10. A computer readable storage medium comprising a computer program which, when run on a computer, causes the computer to perform the method of any one of claims 1 to 7.
11. A computer program product comprising a computer program which, when run, causes a computer to perform the method of any one of claims 1 to 7.
CN202310552091.9A 2023-05-16 2023-05-16 Container maintenance method, device and storage medium Pending CN116599826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310552091.9A CN116599826A (en) 2023-05-16 2023-05-16 Container maintenance method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310552091.9A CN116599826A (en) 2023-05-16 2023-05-16 Container maintenance method, device and storage medium

Publications (1)

Publication Number Publication Date
CN116599826A true CN116599826A (en) 2023-08-15

Family

ID=87604058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310552091.9A Pending CN116599826A (en) 2023-05-16 2023-05-16 Container maintenance method, device and storage medium

Country Status (1)

Country Link
CN (1) CN116599826A (en)

Similar Documents

Publication Publication Date Title
US10152382B2 (en) Method and system for monitoring virtual machine cluster
US8910172B2 (en) Application resource switchover systems and methods
EP3575975B1 (en) Method and apparatus for operating smart network interface card
CN102708018B (en) Method and system for exception handling, proxy equipment and control device
CN103201724A (en) Providing application high availability in highly-available virtual machine environments
CN109299064B (en) Database monitoring method and terminal equipment
CN106993043B (en) Data communication system and method based on agency
CN108111566B (en) Cloud storage system capacity expansion method and device and cloud storage system
CN114302350B (en) Service provider failover method and device, electronic equipment and storage medium
EP3852363A1 (en) Device state monitoring method and apparatus
CN113595773B (en) Information processing method, device, electronic equipment and storage medium
CN114610567A (en) Container monitoring method, network device and storage medium
CN113742093B (en) Message processing method, device, equipment and storage medium
CN116599826A (en) Container maintenance method, device and storage medium
US10728323B2 (en) Method and apparatus for operating infrastructure layer in cloud computing architecture
CN115037653A (en) Service flow monitoring method and device, electronic equipment and storage medium
CN115190052A (en) Long connection management method, system and control unit
CN113965447B (en) Online cloud diagnosis method, device, system, equipment and storage medium
CN114816866A (en) Fault processing method and device, electronic equipment and storage medium
CN112214437A (en) Storage device, communication method and device and computer readable storage medium
CN114138551A (en) Monitoring method of distributed system, computer equipment and storage medium
CN101242201A (en) A master-slave system maintenance method, system and device
CN110896407B (en) NFVO component configuration management, request forwarding method and request processing device
CN117215826A (en) Data backup method, device and system
KR100462986B1 (en) Process State Management Method Using Peculiar Process Information

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