CN112911008A - Cloud computing container online and offline method and device - Google Patents

Cloud computing container online and offline method and device Download PDF

Info

Publication number
CN112911008A
CN112911008A CN202110153728.8A CN202110153728A CN112911008A CN 112911008 A CN112911008 A CN 112911008A CN 202110153728 A CN202110153728 A CN 202110153728A CN 112911008 A CN112911008 A CN 112911008A
Authority
CN
China
Prior art keywords
container
offline
online
cloud computing
port
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.)
Granted
Application number
CN202110153728.8A
Other languages
Chinese (zh)
Other versions
CN112911008B (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110153728.8A priority Critical patent/CN112911008B/en
Publication of CN112911008A publication Critical patent/CN112911008A/en
Application granted granted Critical
Publication of CN112911008B publication Critical patent/CN112911008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to the technical field of cloud computing, and provides a cloud computing container online and offline method and device, wherein the container online method comprises the following steps: responding to a container creating request issued by a user; detecting whether the container corresponding to the container creating request is normal or not; if the port of the container is normal, registering the port of the container to load balance; and if the registration is successful, starting the container. The container online method comprises the following steps: cutting off the access flow outside the container; judging whether the excision is successful; if the process is successful, judging whether the container has a waiting process; and if not, sending a down signal to the container so as to enable the container to be down. According to the online and offline method and device for the cloud computing container, continuity of important container business sensitive to transactions in cloud computing and uninterrupted service can be guaranteed.

Description

Cloud computing container online and offline method and device
Technical Field
The invention relates to the technical field of cloud computing, in particular to an online and offline method and device for a cloud computing container.
Background
With the popularization and application of cloud computing technology, more and more applications are deployed in public cloud, private cloud and other environments. Similarly, in the field of financial banks, various banks disputes embrace the native ecology of clouds, access public clouds, self-built private clouds and the like, core transactions relate to the contents of bank customer information, accounting, personal accounts, fast payment, internet finance and the like, and disputes are operated and deployed in cloud environments. These important transactions run online and are sensitive to the stability of the PAAS platform, transaction success rate, etc. At present, contents such as rolling upgrade, production deployment, container drifting, change operation and the like of an online container need to be avoided from normal trading days, and flexible change cannot be achieved. There is also a manual definition of the order in which the deployed vessels are designated to ensure success rate of access flow to the vessels. The two aspects bring operational complexity to operation and maintenance support and stable running of applications, and lack flexibility.
Disclosure of Invention
The invention belongs to the technical field of cloud computing, and provides an online and offline method and device for a cloud computing container, which can ensure continuity of important container business sensitive to transaction in cloud computing and uninterrupted service. The method mainly has the following advantages:
1. the application side gets rid of the problem of limitation of the time point of production and deployment, the success rate of offline and online service of container service is not reduced, and the continuity of the service is improved.
2. A configurable speech parameter system is provided for the online and offline of the container, and the delay time of health survival detection and offline can be flexibly configured according to business characteristics so as to ensure the sufficiency of the access flow and the offline flow of the container and the integrity of transaction processing.
3. The method is not only suitable for sensitive application containers, but also suitable for conventional application containers, and the containers can be flexibly configured, so that the online and offline of transactions can be lossless through a universal configuration method.
In order to achieve the above object, there is provided a cloud computing container online and offline method (online), including:
responding to a container creating request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
if the port of the container is normal, registering the port of the container to load balance;
and if the registration is successful, starting the container.
In one embodiment, the registering the port of the container to load balancing includes:
and registering the port to the load balance by utilizing a life cycle hook function of the container.
In one embodiment, a cloud computing container online and offline method (offline) includes:
cutting off the access flow outside the container;
judging whether the excision is successful;
if the process is successful, judging whether the container has a waiting process;
and if not, sending a down signal to the container so as to enable the container to be down.
In one embodiment, the cloud computing container online and offline method further includes:
when the time consumed in the container offline process exceeds the preset time, issuing a kill-9 signal to the container;
before the cut-off container is used for cutting off the external access flow, the method further comprises the following steps:
the KEY value that has started load balancing in the container is removed.
In a second aspect, the present invention further provides an online and offline device (online) for a cloud computing container, where the device includes:
the container detection unit is used for responding to a container creation request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
the port registration unit is used for registering the port of the container to the load balance if the port is normal;
and the container starting unit is used for starting the container if the registration is successful.
In an embodiment, the port registration unit is specifically configured to register the port to the load balancing by using a lifecycle hook function of the container.
In one embodiment, a cloud computing container online and offline device (offline) comprises:
the flow cutting unit is used for cutting off the external access flow of the container;
the flow removal judging unit is used for judging whether the removal is successful;
the process judging unit is used for judging whether the container has a waiting process or not if the container succeeds;
and the container offline unit is used for sending an offline signal to the container if the container is not in the offline state, so that the container is offline.
In one embodiment, the cloud computing container online and offline device further includes:
the forced offline unit is used for issuing a kill-9 signal to the container when the time consumed in the container offline process exceeds the preset time;
and the KEY value removing unit is used for removing the KEY value of load balancing in the started container.
In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of an online and offline method for a cloud computing container when executing the program.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a method for online and offline cloud computing containers.
As can be seen from the above description, in the container online and offline method and apparatus provided in the embodiments of the present invention, in the container online process, a container creation request issued by a user is responded first; then, the probe detects whether the container corresponding to the container creating request is normal; if the load balancing is normal, registering the port of the container to the load balancing; and if the registration is successful, starting the container. In contrast, in the process of off-line, firstly cutting off the access flow of the container to the outside; then, judging whether the excision is successful; if the process is successful, judging whether the container has a waiting process; if not, sending a down signal to the container to enable the container to be down. Aiming at the problem that the transaction success rate of a transaction sensitive container is reduced under the conditions of deployment of the container on a cloud computing line and self-healing of abnormal conditions, the invention provides a method for detecting the service of the container by automatically configuring a service activity detection URL in the online process of an application container, and if the service activity detection is successful, a load balancing platform is allowed to be registered and the service flow is accessed; and in the container offline process, a shutdown signal is sent through an offline service flow port, the service container is waited to respond and process the on-the-way transaction, and the transaction is ensured to be lossless. The success rate of transaction processing of the transaction sensitive container is ensured by the method of elegant online and elegant shutdown, and meanwhile, the scheme is also suitable for online common containers, so that the stability and continuity of business services are realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of an online and offline method for a cloud computing container (online) provided in an embodiment of the present invention;
fig. 2 is a first flowchart (offline) of an online and offline method for a cloud computing container according to an embodiment of the present invention;
fig. 3 is a schematic flow diagram of a second method for online and offline of a cloud computing container according to an embodiment of the present invention (offline);
FIG. 4 is a flowchart illustrating steps 200 of an online and offline method for a cloud computing container according to an embodiment of the present invention;
fig. 5 is a third flow chart (offline) of an online and offline method for a cloud computing container provided in an embodiment of the present invention;
fig. 6 is a fourth flow chart (offline) of an online and offline method for a cloud computing container provided in an embodiment of the present invention;
FIG. 7 is a flowchart illustrating an online/offline method for a cloud computing container in an exemplary embodiment of the present invention;
FIG. 8 is a block diagram of an online/offline device of a cloud computing container in an embodiment of the present invention (online);
FIG. 9 is a block diagram I of an online/offline device of a cloud computing container in an exemplary embodiment of the present invention;
FIG. 10 is a second block diagram (offline) of an online/offline device of a cloud computing container in an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
The embodiment of the invention provides a specific implementation mode of an online and offline method of a cloud computing container, and referring to fig. 1, the online method of the cloud computing container specifically comprises the following steps:
step 100: responding to a container creating request issued by a user; and detecting whether the container corresponding to the container creating request is normal.
In particular, the Kubernetes probe, which can detect the health (availability) of the container, can be used to detect whether the container corresponding to the create container request is normal, and it is understood that the survival probe and ready probe are referred to as a health check in the context of Kubernetes. These container probes are small processes that run periodically and the results returned by these probes (success, failure or unknown) reflect the status of the container in Kubernetes. Based on these results, kubernets will decide how to handle each container to ensure resiliency, high availability and longer uptime. Specifically, the method comprises the following steps:
liveness probe (survival probe): the method is mainly used for judging whether the Container is in a running state or not, for example, when a service crash or deadlock occurs, kubelet will kill the Container, and then perform corresponding operation according to the reset policy set by the kubelet (possibly restarting the Container on the local machine, or restarting on other machines distributed under the condition that the local machine has no resources because kubernets QoS is set).
Readness (ready probe) probe: the method is mainly used for judging whether the service works normally, if the service is not loaded completely or works abnormally, the IP address of the Pod where the service is located is removed from the Endpoints of the service, that is, when the service has no ready, the service is removed from the load balancer of the service, and any request is not accepted or responded.
The probe examination results were divided into 3 cases:
success (Success): the examination is passed.
Failure (Failure): the check fails.
Unknown (Unknown): the examination is unknown and manual intervention is required.
Step 200: and if the port is normal, registering the port of the container to the load balance.
Load Balance means that the Load Balance is shared by a plurality of operation units to be executed, such as a Web server, an FTP server, an enterprise key application server and other key task servers, so as to jointly complete work tasks. Load balancing builds on existing network architectures and provides an inexpensive, efficient, transparent way to extend the bandwidth of network devices and servers, increase throughput, enhance network data processing capabilities, and increase network flexibility and availability. Specifically, load balancing can be divided into software/hardware load balancing and local/global load balancing:
1. software/hardware load balancing
The software Load balancing solution means that one or more additional software is/are installed on an operating system corresponding to one or more servers to realize Load balancing, such as DNS Load Balance, CheckPoint Firewall-1ConnectControl and the like.
Software solutions have more defects, because the extra software installed on each server consumes an indefinite amount of resources of the system, and the more powerful modules consume the more, when the connection request is particularly large, the software itself becomes a key to the success or failure of the server; software scalability is not very good, limited by the operating system; security issues often arise due to the Bug of the operating system itself.
The hardware load balancing solution is that load balancing equipment is directly installed between a server and an external network, the equipment is generally called as a load balancer, the whole performance is greatly improved because special equipment completes special tasks and is independent of an operating system, and the optimal load balancing requirement can be met by adding diversified load balancing strategies and intelligent flow management.
Load balancers come in many forms, some are integrated in a switching device between a server and an Internet link, some integrate this function into a PC with two network adapters, one connected to the Internet and one connected to the internal network of a backend server farm, in addition to being a load balancer in an independent sense. In general, hardware load balancing is superior to software approaches in terms of functionality and performance, but is expensive.
2. Local/global load balancing
The Load balancing is divided into Local Load balancing (Local Load Balance) and Global Load balancing (Global Load Balance, also called as regional Load balancing) from the applied geographic structure, the Local Load balancing performs Load balancing for a server group in a Local range, and the Global Load balancing performs Load balancing for server groups in different geographic positions and different network structures.
The local load balancing does not need to spend high cost to purchase a high-performance server, only needs to utilize the existing equipment resources, can effectively avoid the loss of data flow caused by single-point failure of the server, and is usually used for solving the problems of overlarge data flow and overweight network load. Meanwhile, the system has a balance strategy with various forms to reasonably and uniformly distribute data flow to each server. If the existing server needs to be upgraded and expanded, the existing network structure is not required to be changed, the existing service is not required to be stopped, and only a new server needs to be simply added into the service group.
The global load balancing mainly solves the problem that a global user can access a server closest to the user by only one domain name or IP address to obtain the highest access speed, the global user has own server sites in multiple areas, and the global load balancing is also suitable for meeting the requirement of reasonable resource distribution of large-scale companies with wide website distribution of sub-companies through an Intranet (Intranet).
The global load balancing has the characteristics that:
1. the response speed of the server is improved, the problem of network congestion is solved, and the effect of high-quality network access is achieved.
2. Can provide complete transparent service for users in a long distance, and really realizes independence of geographical positions
3. The method can avoid various single-point failures, including single-point failures of a data center, a server and the like, and also including single-point failures caused by private line faults.
Step 300: and if the registration is successful, starting the container.
In the prior art, the container start-up process in step 300 has the following problems: when the application container is registered to external load balance and the service of the application container is not completely started successfully, the situation that the transaction fails when the online access flow exists.
Aiming at the problem, accessing the problems of external load balance and service access, the service is probed and alive by adding a health survival probing URL in a hook function, if the survival probing service is successful, the butt joint registration load balance is allowed, if the survival probing fails, the survival probing is continued at preset time intervals under the configurable retry times, if the survival probing fails after the maximum time of health check configuration, the success is triggered, if the survival probing succeeds, the service registration is considered to be successful, the service flow is allowed to be accessed, and the elegant online process is realized through the method.
The embodiment of the invention also provides a specific implementation manner of an online and offline method of a cloud computing container, and referring to fig. 2, the offline method of the cloud computing container specifically includes the following contents:
step 10: cutting off the access flow outside the container;
step 20: judging whether the excision is successful;
step 30: if the process is successful, judging whether the container has a waiting process;
step 40: and if not, sending a down signal to the container so as to enable the container to be down.
In steps 10 to 40, referring to fig. 3, when the container is taken off-line, the API is called to remove the KEY value in the load balancing, the external access flow is cut off, and then it is determined whether the cut-off of the access flow is successful (it can be determined according to the fact that there is flow with the outside world), and if the cut-off is not successful, the interface is continuously called to take off-line to the external access flow. And after the offline is successful, judging whether the process waiting time exists, if not, issuing a kill-15 signal (offline signal), and capturing the signal by the application side container program to perform graceful shutdown operation (offline).
It should be noted that both the kill-15 and kill-9 commands have the effect of killing the process in linux, but the execution processes of the two commands are greatly different, and when a kill (not-default kill-15) command is executed, the system sends a sigtherm signal to the corresponding program. When the program receives this signal, the following three things happen: first, the program stops immediately; the second is to stop when the program releases the corresponding resource; the third program may still continue to run.
Most programs will release their resources after receiving sigtherm signal and then stop. However, there are other things that a program might do after receiving a signal, i.e., SIGTERM is likely to be blocked. However, in the kill-9 command, the signal sent by the system to the corresponding program is SIGKILL, i.e., exit. The exit signal is not blocked by the system so kill-9 can kill the process smoothly. Therefore, before using kill-9, kill-15 should be used first, giving the target process an opportunity to clean up the good-back work. If not, some incomplete files or state may be left, thereby affecting the restart of the service.
As can be seen from the above description, in the online and offline method for a cloud computing container provided in the embodiment of the present invention, in the online process of the container, a request for creating the container issued by a user is responded first; then, detecting whether the container corresponding to the container creating request is normal or not by using a kubernets probe; if the load balancing is normal, registering the port of the container to the load balancing; and if the registration is successful, starting the container. In contrast, in the process of off-line, firstly cutting off the access flow of the container to the outside; then, judging whether the excision is successful; if the process is successful, judging whether the container has a waiting process; if not, a kill-15 signal is sent to the container to take the container offline. Aiming at the problem that the transaction success rate of a transaction sensitive container is reduced under the conditions of deployment of the container on a cloud computing line and self-healing of abnormal conditions, the invention provides a method for detecting the service of the container by automatically configuring a service activity detection URL in the online process of an application container, and if the service activity detection is successful, a load balancing platform is allowed to be registered and the service flow is accessed; and in the container offline process, a shutdown signal is sent through an offline service flow port, the service container is waited to respond and process the on-the-way transaction, and the transaction is ensured to be lossless. The success rate of transaction processing of the transaction sensitive container is ensured by the method of elegant online and elegant shutdown, and meanwhile, the scheme is also suitable for online common containers, so that the stability and continuity of business services are realized.
In one embodiment, referring to fig. 4, step 200 further comprises:
step 201: and registering the port to the load balance by utilizing a life cycle hook function of the container.
It is understood that the lifecycle hook function in step 201 refers to capturing an event at the system level when the event triggers, and then the system does some operation. Such as a program to process system messages. "hooks" are opportunities to give a certain processing at a certain stage. Common hook functions: the lifecycle functions of exact, vue, vue custom instructions, etc
When an event occurs, the application program may set a plurality of Hook procedures (HookProcedures) on the corresponding Hook, which constitute a list of pointers (Hook chain) associated with the hooks to the Hook functions. When the monitored message appears, the system firstly sends the monitored message to the first hook function pointed in the call chain table, the hook function monitors, modifies and controls the message according to the respective function, and transmits the message to the next hook function after the processing is finished until the end of the hook chain table is reached. After the hook function gives control, the intercepted message is finally returned to the window processing function. Although the hook function will slightly affect the operation efficiency of the system, in many cases, the hook function can filter messages to perform special functions that some other methods cannot perform.
And registering a port of the starting container to load balancing (SLB) of an external service by calling a life cycle hook function of the container to realize access service flow.
In an embodiment, referring to fig. 5, the cloud computing container offline method further includes:
step 50: and when the time consumed in the container offline process exceeds the preset time, issuing a kill-9 signal to the container.
Specifically, if the whole process takes more time than the default setting, a kill-9 signal is sent to perform the operation of forcibly deleting the container.
In one embodiment, referring to fig. 6, before step 10, the method further includes:
step 09: the KEY value that has started load balancing in the container is removed.
To further illustrate the scheme, the application provides a specific application example of the online and offline method of the cloud computing container.
Referring to fig. 7, when a user starts a container at the PAAS management platform, the method mainly includes the following steps:
step S1: and the user issues a container creating instruction (i).
Step S2: and the application container loads the program main process and starts the process II.
Step S3: this step corresponds to the third step in fig. 7, specifically, the application configures the health check interface, and if the kubernets native discovery interface passes, the process enters the fourth step if the kubernets native discovery interface does not pass, and the container is restarted. If pass, wait for result of (c).
In fig. 7, # is the lifecycle hook function of the container, and the access traffic is implemented by registering the port of the start container in the load balancing (SLB) of the outbound service. If the registration is successful, the container is successfully started under the condition that the registration and the health check are met simultaneously, and if the registration fails, the container is failed to be started.
In the conventional starting process, when the application container is registered to external load balance, and the service of the application container is not completely started successfully, the situation that the transaction fails in online access flow exists.
Aiming at the situation, the invention mainly solves the problems of external load balancing and service access of register access and access of a fifth register access in the figure 7, the URL of health activity detection is added in a hook function to detect the service, if the activity detection service is successful, the butt joint of the register load balancing is allowed, if the activity detection fails, the activity detection is continued every 5s under the configurable retry times, if the activity detection service is not successful after the maximum time of health check configuration, the failure is triggered, if the activity detection is successful, the service registration is successful, the service flow is allowed to be accessed, and the elegant online process is realized through the method.
As can be seen from the above description, in the online and offline method of the cloud computing container provided in the specific application example of the present invention, in the online process of the container, a request for creating the container issued by a user is responded first; then, detecting whether the container corresponding to the container creating request is normal or not by using a kubernets probe; if the load balancing is normal, registering the port of the container to the load balancing; and if the registration is successful, starting the container. In contrast, in the process of off-line, firstly cutting off the access flow of the container to the outside; then, judging whether the excision is successful; if the process is successful, judging whether the container has a waiting process; if not, a kill-15 signal is sent to the container to take the container offline. Aiming at the problem that the transaction success rate of a transaction sensitive container is reduced under the conditions of deployment of the container on a cloud computing line and self-healing of abnormal conditions, the invention provides a method for detecting the service of the container by automatically configuring a service activity detection URL in the online process of an application container, and if the service activity detection is successful, a load balancing platform is allowed to be registered and the service flow is accessed; and in the container offline process, a shutdown signal is sent through an offline service flow port, the service container is waited to respond and process the on-the-way transaction, and the transaction is ensured to be lossless. The success rate of transaction processing of the transaction sensitive container is ensured by the method of elegant online and elegant shutdown, and meanwhile, the scheme is also suitable for online common containers, so that the stability and continuity of business services are realized. Specifically, the method comprises the following steps:
the invention provides a method for ensuring the success rate of business transaction by starting and stopping a container elegantly, which is used for ensuring the continuity of important container business sensitive to transaction and the uninterrupted service. The method mainly has the following beneficial effects:
1. the application side gets rid of the problem of limitation of the time point of production and deployment, the success rate of offline and online service of container service is not reduced, and the continuity of the service is improved.
2. A configurable-call parameter system is provided for the online and offline of the container, and the delay time of health survival detection and offline can be flexibly configured according to business characteristics by application, so that the sufficiency of the access flow and the offline flow of the container and the integrity of transaction processing are guaranteed.
3. The method is not only suitable for sensitive application containers, but also suitable for conventional application containers, and the containers can be flexibly configured, so that the online and offline of transactions can be lossless through a universal configuration method.
The embodiment of the invention provides a specific implementation mode of an online and offline device of a cloud computing container, which can realize the online and offline method of the cloud computing container, and referring to fig. 8, the online and offline device (offline) of the cloud computing container specifically comprises the following contents:
a container detection unit 100, configured to respond to a container creation request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
a port registration unit 200, configured to register a port of the container to load balancing if the port is normal;
a container starting unit 300, configured to start the container if the registration is successful.
In an embodiment, the port registration unit 20 is specifically configured to register the port to the load balancing by using a lifecycle hook function of the container.
In one embodiment, referring to fig. 9, a cloud computing container online and offline device (offline) includes:
the flow cutting unit 10 is used for cutting off the access flow outside the container;
a flow rate cutting judgment unit 20, configured to judge whether cutting is successful;
a process determining unit 30, configured to determine whether the container has a waiting process if the container succeeds;
and the container offline unit 40 is used for sending an offline signal to the container if the container is not in the offline state so as to enable the container to be offline.
In an embodiment, referring to fig. 10, the cloud computing container online and offline device further includes:
the forced offline unit 50 is used for issuing a kill-9 signal to the container when the time consumed in the container offline process exceeds the preset time;
a KEY value removing unit 60 for removing the load balanced KEY values in the enabled containers.
As can be seen from the above description, in the online and offline device for a cloud computing container provided in the embodiment of the present invention, in the online process of the container, a request for creating the container issued by a user is first responded; then, detecting whether the container corresponding to the container creating request is normal or not by using a kubernets probe; if the load balancing is normal, registering the port of the container to the load balancing; and if the registration is successful, starting the container. In contrast, in the process of off-line, firstly cutting off the access flow of the container to the outside; then, judging whether the excision is successful; if the process is successful, judging whether the container has a waiting process; if not, a kill-15 signal is sent to the container to take the container offline. Aiming at the problem that the transaction success rate of a transaction sensitive container is reduced under the conditions of deployment of the container on a cloud computing line and self-healing of abnormal conditions, the invention provides a method for detecting the service of the container by automatically configuring a service activity detection URL in the online process of an application container, and if the service activity detection is successful, a load balancing platform is allowed to be registered and the service flow is accessed; and in the container offline process, a shutdown signal is sent through an offline service flow port, the service container is waited to respond and process the on-the-way transaction, and the transaction is ensured to be lossless. The success rate of transaction processing of the transaction sensitive container is ensured by the method of elegant online and elegant shutdown, and meanwhile, the scheme is also suitable for online common containers, so that the stability and continuity of business services are realized. An embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in an online and offline method of a cloud computing container in the foregoing embodiment, and referring to fig. 11, the electronic device specifically includes the following contents:
a processor (processor)1201, a memory (memory)1202, a communication Interface 1203, and a bus 1204;
the processor 1201, the memory 1202 and the communication interface 1203 complete communication with each other through the bus 1204; the communication interface 1203 is configured to implement information transmission between related devices, such as a server-side device, a power measurement device, and a client device.
The processor 1201 is configured to call the computer program in the memory 1202, and the processor executes the computer program to implement all the steps in the online and offline method of the cloud computing container in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
step 100: responding to a container creating request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
step 200: if the port of the container is normal, registering the port of the container to load balance;
step 300: and if the registration is successful, starting the container. And
step 10: cutting off the access flow outside the container;
step 20: judging whether the excision is successful;
step 30: if the process is successful, judging whether the container has a waiting process;
step 40: and if not, sending a down signal to the container so as to enable the container to be down.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the online and offline method of the cloud computing container in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements all the steps in the online and offline method of the cloud computing container in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
step 100: responding to a container creating request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
step 200: if the port of the container is normal, registering the port of the container to load balance;
step 300: and if the registration is successful, starting the container. And
step 10: cutting off the access flow outside the container;
step 20: judging whether the excision is successful;
step 30: if the process is successful, judging whether the container has a waiting process;
step 40: and if not, sending a down signal to the container so as to enable the container to be down.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the hardware + program class embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Although the present application provides method steps as in an embodiment or a flowchart, more or fewer steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. An online and offline method for a cloud computing container is characterized by comprising the following steps:
responding to a container creating request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
if the port of the container is normal, registering the port of the container to load balance;
and if the registration is successful, starting the container.
2. The cloud computing container online and offline method according to claim 1, wherein the registering a port of the container on load balancing comprises:
and registering the port to the load balance by utilizing a life cycle hook function of the container.
3. The cloud computing container online and offline method according to claim 1, further comprising:
cutting off the access flow outside the container;
judging whether the excision is successful;
if the process is successful, judging whether the container has a waiting process;
and if not, sending a down signal to the container so as to enable the container to be down.
4. The cloud computing container online and offline method according to claim 3, further comprising:
when the time consumed in the container offline process exceeds the preset time, issuing a kill-9 signal to the container;
before the cut-off container is used for cutting off the external access flow, the method further comprises the following steps:
the KEY value that has started load balancing in the container is removed.
5. The utility model provides a cloud computing container online, offline device which characterized in that includes:
the container detection unit is used for responding to a container creation request issued by a user; detecting whether the container corresponding to the container creating request is normal or not;
the port registration unit is used for registering the port of the container to the load balance if the port is normal;
and the container starting unit is used for starting the container if the registration is successful.
6. The cloud computing container online and offline device according to claim 5, wherein the port registration unit is specifically configured to register the port to the load balancing unit using a lifecycle hooking function of the container.
7. The cloud computing container online and offline device of claim 5, further comprising:
the flow cutting unit is used for cutting off the external access flow of the container;
the flow removal judging unit is used for judging whether the removal is successful;
the process judging unit is used for judging whether the container has a waiting process or not if the container succeeds;
and the container offline unit is used for sending an offline signal to the container if the container is not in the offline state, so that the container is offline.
8. The cloud computing container online and offline device of claim 7, further comprising:
the forced offline unit is used for issuing a kill-9 signal to the container when the time consumed in the container offline process exceeds the preset time;
and the KEY value removing unit is used for removing the KEY value of load balancing in the started container.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the steps of the method for online and offline of a cloud computing container according to any one of claims 1 to 4.
CN202110153728.8A 2021-02-04 2021-02-04 Cloud computing container online and offline method and device Active CN112911008B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110153728.8A CN112911008B (en) 2021-02-04 2021-02-04 Cloud computing container online and offline method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110153728.8A CN112911008B (en) 2021-02-04 2021-02-04 Cloud computing container online and offline method and device

Publications (2)

Publication Number Publication Date
CN112911008A true CN112911008A (en) 2021-06-04
CN112911008B CN112911008B (en) 2023-04-18

Family

ID=76122211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110153728.8A Active CN112911008B (en) 2021-02-04 2021-02-04 Cloud computing container online and offline method and device

Country Status (1)

Country Link
CN (1) CN112911008B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363170A (en) * 2021-12-29 2022-04-15 中国电信股份有限公司 Container service network configuration method and related product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120331113A1 (en) * 2011-06-27 2012-12-27 Microsoft Corporation Resource management for cloud computing platforms
CN105577779A (en) * 2015-12-21 2016-05-11 用友网络科技股份有限公司 Method and system for containerized deployment of large enterprise private cloud
CN108243055A (en) * 2016-12-27 2018-07-03 中国移动通信集团浙江有限公司 A kind of container cloud is found and Accreditation System and method automatically
CN109062660A (en) * 2018-07-06 2018-12-21 杭州涂鸦信息技术有限公司 A kind of method of the offline application service of Docker Environmental security
CN110297706A (en) * 2019-07-03 2019-10-01 北京首汽智行科技有限公司 A kind of inserting method based on Eureka-Server project
CN111010422A (en) * 2019-11-18 2020-04-14 北京禧云信息科技有限公司 System and method for graceful shutdown

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120331113A1 (en) * 2011-06-27 2012-12-27 Microsoft Corporation Resource management for cloud computing platforms
CN105577779A (en) * 2015-12-21 2016-05-11 用友网络科技股份有限公司 Method and system for containerized deployment of large enterprise private cloud
CN108243055A (en) * 2016-12-27 2018-07-03 中国移动通信集团浙江有限公司 A kind of container cloud is found and Accreditation System and method automatically
CN109062660A (en) * 2018-07-06 2018-12-21 杭州涂鸦信息技术有限公司 A kind of method of the offline application service of Docker Environmental security
CN110297706A (en) * 2019-07-03 2019-10-01 北京首汽智行科技有限公司 A kind of inserting method based on Eureka-Server project
CN111010422A (en) * 2019-11-18 2020-04-14 北京禧云信息科技有限公司 System and method for graceful shutdown

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
阿里云云栖号: "SpringCloud应用在Kubernetes上的最佳实践--线上发布(优雅上下线)", 《HTTPS://BLOG.CSDN.NET/YUNQIINSIGHT/ARTICLE/DETAILS/108052299》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363170A (en) * 2021-12-29 2022-04-15 中国电信股份有限公司 Container service network configuration method and related product

Also Published As

Publication number Publication date
CN112911008B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN110401696B (en) Decentralized processing method, communication agent, host and storage medium
US9740546B2 (en) Coordinating fault recovery in a distributed system
CN113169952B (en) Container cloud management system based on block chain technology
CN112000448A (en) Micro-service architecture-based application management method
CN108255497B (en) Application deployment method and device
EP1650653A2 (en) Remote enterprise management of high availability systems
EP3391215A1 (en) Using declarative configuration data to manage cloud lifecycle
CN108632057A (en) A kind of fault recovery method of cloud computing server, device and management system
WO2019210580A1 (en) Access request processing method, apparatus, computer device, and storage medium
CN104408071A (en) Distributive database high-availability method and system based on cluster manager
US10942831B2 (en) Automating and monitoring rolling cluster reboots
US20170329390A1 (en) System and method for selectively hibernating and restarting a node of an application instance
CN109245966A (en) The monitoring method and device of the service state of cloud platform
CN110895488B (en) Task scheduling method and device
WO2016169166A1 (en) Virtual machine scheduling method and device
JP2020115330A (en) System and method of monitoring software application process
CN108600316A (en) Data managing method, system and the equipment of cloud storage service
US11500763B1 (en) Distributed canary testing with test artifact caching
CN112911008B (en) Cloud computing container online and offline method and device
CN110895486A (en) Distributed task scheduling system
CA3023518C (en) Dynamic deactivation of cold database in database service
Smart The big picture
CN111522664A (en) Service resource management and control method and device based on distributed service
CN111092754A (en) Real-time access service system and implementation method thereof
CN114691304A (en) Method, device, equipment and medium for realizing high availability of cluster virtual machine

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