CN108121595A - A kind of Docker containers multi-process management method and system - Google Patents
A kind of Docker containers multi-process management method and system Download PDFInfo
- Publication number
- CN108121595A CN108121595A CN201611090130.4A CN201611090130A CN108121595A CN 108121595 A CN108121595 A CN 108121595A CN 201611090130 A CN201611090130 A CN 201611090130A CN 108121595 A CN108121595 A CN 108121595A
- Authority
- CN
- China
- Prior art keywords
- information
- docker containers
- container
- module
- docker
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention provides a kind of Docker containers multi-process management method and system, the system includes:Process manager module, information of container acquisition module and maintenance of information module;Utilize Docker containers multi-process management method provided by the invention and system, parent process to respectively being applied in Docker containers is responsible for by the process manager module of setting and its related subprocess is managed, solves the multi-process problem of management in Docker containers, and pass through the cooperation of information of container acquisition module and maintenance of information module, each state of a process information in Docker containers can be monitored in real time, it receives and manages subprocess, to discharge in time and recovery system resource.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of Docker containers multi-process management method and system.
Background technology
In recent years, with the continuous development of computer technology, using Docker containers as the lightweight virtualization technology of representative
It is widely used in the fields such as cloud computing, safety, intelligent operating system.Docker is an application container engine increased income, purport
The automatically dispose solution of one application program is being provided.One can be created rapidly on the linux system of any prevalence
A container container (lightweight virtual machine), and dispose and operation application program, and pass through configuration file and can easily realize
Automation installation, deployment and the upgrading of application program.
Docker containers using linux kernel NameSpace namespace characteristic, can be formed it is multiple each other every
From be independent of each other containment system.Resource Manager Subsystem cgroups using linux kernel is the application distribution system in container
System resource, need not provide instruction explanation facility and other fully virtualized complexity structures.Each Docker containers possess
Oneself independent various NameSpace, the NameSpaces such as pid, net, ipc, mnt, uts are by the process of container, network, message, text
Part system and hostname are isolated.
Docker encourages the mode of " one process of a container (one process per container) ", this side
Formula is more suitble to the application of the micro services framework based on one process.However, some traditional applications are by several tightly coupled
Multiple processes are formed, these processes are difficult to be split in different containers, so needing to run multiple processes in single container.
When multi-process service is performed in Docker containers, the life cycle of container is protected with the process that pid in its pid NameSpace is 1
It holds unanimously, so, when parent process execution terminates, container is also accordingly terminated and exited.However, if parent process is not sent out to its subprocess
It makes arrangements for his funeral only process signals, such as SKIGKILL signals, its subprocess will continue to run with.The spy for passing through NameSpace due to Docker
Property realize container between process isolation, then the subprocess inside container can not effectively be managed and discharge, recycle it
Occupied resource.
It, can be more in monitoring of containers therefore, it is necessary to provide a kind of method and system of Docker containers multi-process management
A state of a process information receives and manages subprocess, reduces zombie process, timely release and recovery system resource.
The content of the invention
It is an object of the present invention to for the multi-process run in existing Docker containers is overcome not managed effectively
The technical issues of, a kind of Docker containers multi-process management method and system are provided, the pipe for solving Docker container multi-process
Reason and control problem, for the system of multiple docker containers of startup, can monitor the process status inside container in real time
Situation timely can receive and manage all subprocess, can effectively reduce zombie process, timely to discharge and to return
Receive system resource.
To achieve the above object, a kind of Docker containers multi-process management system provided by the invention, the system include:Into
Thread management module, information of container acquisition module and maintenance of information module;
The process manager module be responsible in Docker containers respectively applying comprising all processes life cycle management,
And all progress informations of acquisition are sent to information of container acquisition module;
The information of container acquisition module is used to obtain the attribute information of each Docker containers, and each by what is got
Docker container attributes information and corresponding progress information are sent to maintenance of information module;
Attribute information and corresponding progress information of the maintenance of information module according to each Docker containers received,
The process dendrogram of each Docker containers is established, and carries out periodic scan, updates corresponding progress information in process dendrogram.
As being further improved for above-mentioned technical proposal, the process manager module is that PID is 1 in each Docker containers
Process, the process remains operating status, is responsible for performing the parent process and its correlation respectively applied in Docker containers
The startup of subprocess is exited and reboot operation.
As being further improved for above-mentioned technical proposal, the progress information includes:Process number and process status information,
The attribute information of the Docker containers includes:Container Name and container ID number.
As being further improved for above-mentioned technical proposal, the process manager module uses shell scripts or process pipe
Science and engineering tool Supervisor is built.
System is managed based on above-mentioned Docker containers multi-process, the present invention also provides a kind of Docker containers multi-process pipes
Reason method, this method comprise the following steps:
Step 1) creates the required Docker containers of multi-process application operation in Docker systems;
Step 2) starting step 1) in create Docker containers;
Step 3) using process manager module obtain Docker containers in multi-process apply comprising all processes process
Information, and progress information is sent to information of container acquisition module;
Step 4) obtains the attribute information of each Docker containers using information of container acquisition module, and by each Docker containers
Attribute information and corresponding container in progress information be sent to maintenance of information module;
Step 5) utilizes attribute information of the maintenance of information module according to each Docker containers received and corresponding process
Information, establishes the process dendrogram of each Docker containers, and carries out periodic scan to update each process in process dendrogram
Information.
A kind of Docker containers multi-process management method and system advantage of the present invention is:
Using Docker containers multi-process management method provided by the invention and system, pass through the process manager module of setting
It is responsible for the parent process to respectively being applied in Docker containers and its related subprocess is managed, solves more in Docker containers
Management of process problem, and pass through the cooperation of information of container acquisition module and maintenance of information module, Docker appearances can be monitored in real time
Each state of a process information in device, receives and manages subprocess, to discharge in time and recovery system resource.
Description of the drawings
Fig. 1 is the structural diagram that a kind of Docker containers multi-process provided by the invention manages system.
Fig. 2 is a kind of flow chart of Docker containers multi-process management method provided by the invention.
Specific embodiment
With reference to the accompanying drawings and examples to a kind of Docker containers multi-process management method of the present invention and system
It is described in detail.
As shown in Figure 1, a kind of Docker containers multi-process management system provided by the invention, the system include:Process pipe
Manage module, information of container acquisition module and maintenance of information module.
The process manager module be responsible in Docker containers respectively applying comprising all processes life cycle management,
And all progress informations of acquisition are sent to information of container acquisition module;
The information of container acquisition module is used to obtain the attribute information of each Docker containers, and each by what is got
Docker container attributes information and corresponding progress information are sent to maintenance of information module;
Attribute information and corresponding progress information of the maintenance of information module according to each Docker containers received,
The process dendrogram of each Docker containers is established, and carries out periodic scan, updates corresponding progress information in process dendrogram.
The present invention is responsible for all processes in Docker containers by setting process manager module in Docker containers in advance
Life cycle management, and updated associated process message is sent in time.Information of container acquisition module in Docker engines obtains
Process message in extracting container information and container is sent to maintenance of information module, and maintenance of information module is established and maintenance process tree
Shape figure, by periodic scan with the abnormal conditions of the resource consumption situation of definite process and process in real time.When Docker containers
When abnormal conditions occurs in middle process, the parent process as multi-process is applied exits, and corresponding subprocess is still operationally, management of process
Module will take over all subprocess of parent process establishment, safeguard its subprocess dendrogram, and it is effectively managed, so as to
Effective management and the control problem for solving Docker container multi-process, reduces zombie process, timely discharges and recycles system
System resource.
Docker containers multi-process management system based on said structure, as shown in Fig. 2, the present invention also provides one kind
Docker container multi-process management methods, this method include:
Step 1) creates the required Docker containers of multi-process application operation in Docker systems, pre-sets just
Beginning process manager module.
The required Docker containers of multi-process application operation are created in Docker systems, the mirror image of container should select more
The required operating system of process application operation should configure the required running environment of multi-process application operation in a reservoir,
In, running environment includes other programs, library file and the configuration surroundings variable that application operation is relied on, so that multi-process application energy
Enough startups normal in a reservoir.
Due to the host process acceptable system signal that the PID of first startup in Docker containers is 1, and other subprocess
Can not reception system signal, therefore it is the process that PID is 1 in Docker containers that need to set process manager module, and the process is always
State is remained on, is responsible for the life cycle management of all processes in container.When receiving container and exiting command, management of process
Module all processes can send termination process signals into container, and after all processes is waited to terminate, process manager module exits.
Optionally, process manager module is built using shell scripts, shell scripts start in container successively needed for user
Each process of multi-process application;It obtains and sends the process number of all processes, and send updated process status letter in real time
Breath;Shell scripts are responsible for all process lifetime management in container.
Optionally, process manager module, the management of process instrument are built using management of process instrument Supervisor
Supervisor is using the general process supervisory program of Python exploitations, and the concrete operations for building process manager module are:
The configuration file init.conf of management of process instrument Supervisor is write, wherein, nodaemon parameters are set to ture, ensure
Management of process instrument Supervisor is led in front stage operation, each process applied using commond orders startup multi-process
The standard output file of stdout_logfile and stderr_logfile parameter setting orders and standard error output file are crossed,
For exporting and mistake debugging.Management of process instrument Supervisor is responsible for starting successively the parent process and its phase of multi-process application
Climax process, and it is responsible for the whole life cycle management of all processes, the startup including process is exited and restarted.Process pipe
Science and engineering tool Supervisor is obtained and is sent the process number and status information of updated all processes.
Step 2) starting step 1) in create Docker containers.
First, shell scripts or management of process instrument Supervisor etc. as No. pid in Docker for 1 process most
First start, then shell scripts or management of process instrument Supervisor start each of the multi-process application of required operation successively
A component obtains the process ID and relevant information of all subprocess.
Step 3) obtains the attribute information of Docker containers using process manager module and information of container acquisition module respectively
And in container multi-process apply comprising all progress informations.
It pre-sets Docker engines monitoring Docker and starts container processes, the automatic attribute letter for obtaining operation container at present
Breath, including Container Name and container ID number;Container parent process PID is obtained according to the ID number of container, and passes through this No. PID acquisition
Correlator progress information in container;And the process number of all processes is sent, by father and son by the process manager module in container
All progress informations in the attribute information and container of the subordinate relation structure Docker containers of process.
Step 4) forwarding step 3) in progress information in the attribute information of container that obtains and corresponding container.
Step 5) utilizes attribute information of the maintenance of information module according to each Docker containers received and corresponding process
Information, establishes the process dendrogram of each Docker containers, and carries out periodic scan, to update each process in process dendrogram
Information.Periodic scan operation detailed process be:If any process fresh information, process manager module, which then updates the process, to be believed
Breath is sent to information of container acquisition module, and the update request of maintenance of information module periodicity sending information obtains mould to information of container
Block, information of container acquisition module, which can be fed back, updates information to maintenance of information module, and safeguards dendrogram according to fresh information.
After container startup, receive above- mentioned information and start, according to the attribute information of container and container parent process number and son
Process number safeguards a process dendrogram, and the tree-shaped seal of the process has recorded relation map between parent process and subprocess and each
State of a process information.Periodic scan is carried out to this information, checks the variation of progress information in the container, if having subprocess
It destroys, if new subprocess is generated, according to the progress information in the container attribute information and container of reception, real-time update process
Dendrogram.By process dendrogram, all process status informations to outside in Docker information of container and container can be exported and set
It is standby, to determine the actual conditions of all processes in container, such as resource consumption situation, if generate zombie process etc..When mostly into
The parent process of Cheng Yingyong exits, and corresponding subprocess is still operationally, and process manager module will take over all of parent process establishment
Subprocess safeguards its subprocess dendrogram, and it is effectively managed, to discharge, recycle its occupied resource.
It should be noted last that the above embodiments are merely illustrative of the technical solutions of the present invention and it is unrestricted.Although ginseng
The present invention is described in detail according to embodiment, it will be understood by those of ordinary skill in the art that, to the technical side of the present invention
Case is modified or replaced equivalently, and without departure from the spirit and scope of technical solution of the present invention, should all be covered in the present invention
Right among.
Claims (5)
1. a kind of Docker containers multi-process manages system, which is characterized in that including:Process manager module, information of container obtain
Module and maintenance of information module;The process manager module be responsible in Docker containers respectively applying comprising all processes life
Cycle management is ordered, and all progress informations of acquisition are sent to information of container acquisition module;The information of container obtains mould
Block obtains the attribute information of each Docker containers, and the attribute information of each Docker containers and corresponding progress information are sent to
Maintenance of information module;Described information maintenance module is believed according to the attribute information of each Docker containers received and corresponding process
Breath, establishes the process dendrogram of each Docker containers, and carries out periodic scan to update the letter of each process in process dendrogram
Breath.
2. Docker containers multi-process according to claim 1 manages system, which is characterized in that the management of process mould
Block is the process that PID is 1 in each Docker containers, and the process remains operating status, is responsible for performing Docker containers
The startup of the parent process inside respectively applied and its related subprocess is exited and reboot operation.
3. Docker containers multi-process according to claim 1 or 2 manages system, which is characterized in that the process letter
Breath includes:Process number and process status information, the attribute information of the Docker containers include:Container Name and container ID number.
4. Docker containers multi-process according to claim 2 manages system, which is characterized in that the management of process mould
Block is built using shell scripts or management of process instrument Supervisor.
5. the Docker container multi-process management based on the Docker containers multi-process management system described in one of claim 1-4
Method, which is characterized in that including:
Step 1) creates the required Docker containers of multi-process application operation in Docker systems;
Step 2) starting step 1) in create Docker containers;
Step 3) using process manager module obtain Docker containers in multi-process apply comprising all processes progress information,
And progress information is sent to information of container acquisition module;
Step 4) obtains the attribute information of each Docker containers using information of container acquisition module, and by the category of each Docker containers
Property information and corresponding progress information are sent to maintenance of information module;
Step 5) using attribute information of the maintenance of information module according to each Docker containers received and corresponding progress information,
The process dendrogram of each Docker containers is established, and carries out periodic scan to update each progress information in process dendrogram.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611090130.4A CN108121595A (en) | 2016-11-28 | 2016-11-28 | A kind of Docker containers multi-process management method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611090130.4A CN108121595A (en) | 2016-11-28 | 2016-11-28 | A kind of Docker containers multi-process management method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108121595A true CN108121595A (en) | 2018-06-05 |
Family
ID=62226623
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611090130.4A Pending CN108121595A (en) | 2016-11-28 | 2016-11-28 | A kind of Docker containers multi-process management method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108121595A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684034A (en) * | 2018-12-12 | 2019-04-26 | 杭州数梦工场科技有限公司 | Start the method and device of container application |
CN110851824A (en) * | 2019-11-13 | 2020-02-28 | 哈尔滨工业大学 | Detection method for malicious container |
CN111324423A (en) * | 2020-03-03 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Method and device for monitoring processes in container, storage medium and computer equipment |
CN111984366A (en) * | 2020-07-24 | 2020-11-24 | 苏州浪潮智能科技有限公司 | Method and system for deploying disaster recovery mechanism in containerization manner |
CN112148420A (en) * | 2019-06-28 | 2020-12-29 | 杭州海康威视数字技术股份有限公司 | Abnormal task processing method based on container technology, server and cloud platform |
CN112527455A (en) * | 2020-12-10 | 2021-03-19 | 武汉联影医疗科技有限公司 | Service container deployment method, computer equipment and storage medium |
CN113296807A (en) * | 2021-05-12 | 2021-08-24 | 阿里巴巴新加坡控股有限公司 | Data updating method |
CN114610472A (en) * | 2022-05-09 | 2022-06-10 | 上海登临科技有限公司 | Multi-process management method in heterogeneous computing and computing equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104951360A (en) * | 2015-06-30 | 2015-09-30 | 北京奇虎科技有限公司 | Configuration management mode and device based on Docker |
CN105446805A (en) * | 2014-08-25 | 2016-03-30 | 中国科学院深圳先进技术研究院 | Shell script subprocess management method and system |
-
2016
- 2016-11-28 CN CN201611090130.4A patent/CN108121595A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105446805A (en) * | 2014-08-25 | 2016-03-30 | 中国科学院深圳先进技术研究院 | Shell script subprocess management method and system |
CN104951360A (en) * | 2015-06-30 | 2015-09-30 | 北京奇虎科技有限公司 | Configuration management mode and device based on Docker |
Non-Patent Citations (1)
Title |
---|
中国万网阿里云: "运行多进程Docker容器的方法介绍", 《HTTP://WWW.023DNS.COM/ALIYUNYINGYONG/4035.HTML》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684034A (en) * | 2018-12-12 | 2019-04-26 | 杭州数梦工场科技有限公司 | Start the method and device of container application |
CN112148420A (en) * | 2019-06-28 | 2020-12-29 | 杭州海康威视数字技术股份有限公司 | Abnormal task processing method based on container technology, server and cloud platform |
CN112148420B (en) * | 2019-06-28 | 2024-04-02 | 杭州海康威视数字技术股份有限公司 | Abnormal task processing method based on container technology, server and cloud platform |
CN110851824A (en) * | 2019-11-13 | 2020-02-28 | 哈尔滨工业大学 | Detection method for malicious container |
CN111324423A (en) * | 2020-03-03 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Method and device for monitoring processes in container, storage medium and computer equipment |
CN111324423B (en) * | 2020-03-03 | 2022-03-04 | 腾讯科技(深圳)有限公司 | Method and device for monitoring processes in container, storage medium and computer equipment |
CN111984366A (en) * | 2020-07-24 | 2020-11-24 | 苏州浪潮智能科技有限公司 | Method and system for deploying disaster recovery mechanism in containerization manner |
CN111984366B (en) * | 2020-07-24 | 2023-01-06 | 苏州浪潮智能科技有限公司 | Method and system for containerized deployment of disaster recovery mechanism |
CN112527455A (en) * | 2020-12-10 | 2021-03-19 | 武汉联影医疗科技有限公司 | Service container deployment method, computer equipment and storage medium |
CN113296807A (en) * | 2021-05-12 | 2021-08-24 | 阿里巴巴新加坡控股有限公司 | Data updating method |
CN113296807B (en) * | 2021-05-12 | 2023-10-31 | 阿里巴巴新加坡控股有限公司 | Data updating method |
CN114610472A (en) * | 2022-05-09 | 2022-06-10 | 上海登临科技有限公司 | Multi-process management method in heterogeneous computing and computing equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108121595A (en) | A kind of Docker containers multi-process management method and system | |
EP3842948B1 (en) | Method and apparatus for testing edge computing, device, and readable storage medium | |
CN103037019B (en) | A kind of distributed data acquisition system and method based on cloud computing | |
CN102480749B (en) | Method, device and system for remotely collecting host process information | |
Böhm et al. | Profiling Lightweight Container Platforms: MicroK8s and K3s in Comparison to Kubernetes. | |
CN111767031B (en) | Nuclear power industry internet experiment bed based on emulation | |
CN107678946B (en) | Model-based airborne embedded software test environment construction method | |
CN104657150B (en) | Automatic operation and maintenance method in cluster environment | |
CN104951694A (en) | Isolation method and apparatus for management virtual machine | |
CN109684038B (en) | Docker service container log processing method and device and electronic equipment | |
CN111459763A (en) | Cross-kubernets cluster monitoring system and method | |
CN112269640A (en) | Method for realizing life cycle management of container cloud component | |
CN105245371A (en) | Automatic deployment system and method based on ansable | |
CN104391777B (en) | Cloud platform and its operation and monitoring method and device based on (SuSE) Linux OS | |
CN107168844B (en) | Performance monitoring method and device | |
CN106919485A (en) | A kind of system based on configuration hardware testing instrument on server | |
CN104268056A (en) | Complex event processing based real-time monitoring system and method for CPS (Cyber-Physical Systems) applications | |
CN112052607A (en) | Intelligent penetration testing method and device for power grid equipment and system | |
CN111612407A (en) | Three-dimensional visual comprehensive application platform design method based on cloud platform | |
CN101771563A (en) | Method for monitoring network service program | |
CN113050929A (en) | Intelligent contract development, operation and maintenance integrated platform based on HyperLegger Fabric | |
CN117215551A (en) | LLM-based low-code application development method and system | |
CN104967532A (en) | TOC technology operation and maintenance system and application method | |
CN102361355A (en) | Method for concentratedly acquiring data of city and county scheduling power equipment and monitoring operation | |
CN105446805B (en) | Shell script subprocess management method and system |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180605 |