替代码头的supervisord

时间:2015-11-22 00:56:46

标签: docker supervisord

即使对于码头工人环境,Supervisord也是非常棒的工具。它对stderr重定向和信号转发有很大帮助。但它有几个缺点:

  1. 它不支持延迟启动。在主应用程序初始化之前,延迟某些代理启动可能很有用。优先事项无法解决此问题。
  2. 如果某个应用程序进入FATAL状态,则supervisord只记录它但继续工作。因此,在查看容器日志之前,您无法看到它。如果supervisord停止会更友好,因为在这种情况下你会看到docker ps -a
  3. 的问题

    那么对于supervisord来说,最好的替代方案是什么?

2 个答案:

答案 0 :(得分:4)

响应" PID1僵尸收获"问题,我之前建议(在" Use of Supervisor in docker")中使用runit instead of supervisord

  

Runit使用的内存少于Supervisord,因为Runit是用C编写的,而Supervisord是用Python编写的   在某些用例中,容器中的进程重新启动优于整个容器重新启动。

有关详情,请参阅phusion/baseimage-docker图片。

正如Torsten Bronger中的the comments所述:

  

Runit不能解决收割问题   相反,它支持多个流程。鼓励多个进程用于安全性(通过进程和用户隔离)。

自2015年起,您现在可以Specify an init process that should be used as the PID 1 in the containe, with docker run --init

  

使用的默认.viewer { text-align: left; display: flex; /* changed the display to flex */ width: 90%; height: 90%; position: relative; background-color: green; padding: 1em; min-height: 35.45em; } .leftpanel { width: 15em; /*Alter depending on how much space this takes*/ float: left; height: 100%; position: relative; background-color: yellow; align-items: stretch; /* Added the align-items property */ } 进程是Docker守护程序进程的系统路径中找到的第一个init可执行文件。
  默认安装中包含的此docker-init二进制文件由tini支持。

答案 1 :(得分:3)

任何新访客:

如果您是容器化的初学者,强烈建议对每个容器使用一个过程,这样会使每个人的生活变得轻松。

没有任何黑客手段,所有其他工具都将完美运行,同时也将改善可观察性。

不要像虚拟机那样对待容器。