docker - 使用一个容器管理多个应用服务进程?还是每个服务进程创建一个容器?
伊谢尔伦
伊谢尔伦 2017-04-25 09:01:28
0
5
1192

使用一个容器管理多个应用服务进程?还是每个服务进程创建一个容器?

各区别是?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(5)
cloudmam

Recommended Server Management Tool Cloud Helper

哪儿

Recommend an artifact that should be able to help you. Cloud Helper is a powerful and comprehensive centralized management cloud host software. Not only is it compatible with Linux systems, Windows can also be used. In fact, the use of functions is quite good, because the functions are comprehensive and the installation is simple. Basically, it can be done with one click by a fool. If you add a cloud host in the middle, you need to add a probe for the first time, and then you can basically operate it on the panel. This is quite convenient. I have tried basically all the mainstream clouds and there are no problems, and there are no problems with the system. This is quite worry-free. I won’t say that there are any cloud providers or systems that cannot be used, and I have to find another software. The general functions are as follows:
1. Batch management of multiple cloud hosts;
2. Strong compatibility, compatible with basically all cloud business cloud hosts on the market, and compatible with operating systems;
3. Simple operation, visual interface preview Resources, one-click repair, one-click deployment;
4. You can remotely log in to the cloud host FTP desktop and process files on the cloud host;
5. Monitor and, resources also have alarm functions, which is quite good. No need to stare;
6. System repair function, this is very practical and necessary;
7. Free to use. Generally speaking, the functions are quite complete, and there is no need to find another software. A cloud helper software basically meets all needs.

習慣沉默

How to split the business in Docker and how detailed it is is actually a matter of opinion.

For example, the docker container of gogs starts the following things:

s6-svscan-+-s6-supervise 
          |-s6-supervise---gogs 
          |-s6-supervise---sshd 
          `-s6-supervise---syslogd 

Explain, generally the container starts the following things:

1. PID=1的init进程,一般用supervisord,有些人用s6,例如上文中提到的gogs。此进程主要用于进程保活,进程重启。 
2. agent,一般用于监控,某些agent还有可能会被用于执行命令等,例如有些公司会在java容器内安插一个agent,在异常的时候可以执行jmap等操作。 
3. 业务进程,一般附属于init进程。很少见到有直接把业务进程当做主进程(init进程)的情况。因为主进程(init进程)跪掉,docker就跪了。 
4. 其他附属进程,例如上文中提到的gogs,会附属启动一个sshd。有些还会附属启动其他服务,例如syslogd。 

For individuals:

举个栗子,gitlab 
对于个人,完全可以为了方便,把gitlab的所需要的所有服务,都放进同一个docker。 
包括: 
1. nginx 
2. sshd 
3. mysql 
4. gitlab(unicorn) 

But in fact, this cannot be done in a production environment.

At least, even if mysql cannot be hosted by DBA, do not put it in the same docker. At the end, you must make associated containers. Put mysql in one basket and gitlab in another basket.

From a business perspective, it is no longer the same thing.

In terms of stability, it is not recommended either.

This is the bottom line of ethics when using docker, and it cannot be lowered any lower.

How do others dismantle gitlab’s business

大家讲道理

Tools like Marathon that can schedule containerized services have the healthcheck function. If php-fpm hangs, healthcheck checks the php-fpm port. Marathon will kill the container and start a new instance.
If all processes are placed in a container, although multiple health can be established, the OR relationship between healthcheak, if nginx and php-fpm are both down, healthcheck will still pass.
You can also use a healthcheck to access a php page through nginx, so that both service processes are checked. But if one of them dies, restarting the container process will be very costly.

曾经蜡笔没有小新

For example, one should have a web application and a database component.
If the web is frequently updated, the two should be separated. If the version is stable, the ones that have not been updated for several years can be put together.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template