supervisord

docker-9 supervisord 参考docker从入门到实战

随声附和 提交于 2019-12-26 03:42:30
参考docker从入门到实战 使用 Supervisor 来管理进程 Docker 容器在启动的时候开启单个进程,比如,一个 ssh 或者 apache 的 daemon 服务。但我们经常需要在一个机器上开启多个服务,这可以有很多方法,最简单的就是把多个启动命令放到一个启动脚本里面,启动的时候直接启动这个脚本,另外就是安装进程管理工具。 本小节将使用进程管理工具 supervisor 来管理容器中的多个进程。使用 Supervisor 可以更好的控制、管理、重启我们希望运行的进程。在这里我们演示一下如何同时使用 ssh 和 apache 服务。 配置 首先创建一个 Dockerfile,内容和各部分的解释如下。 FROM ubuntu MAINTAINER examples@docker.com RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update RUN apt-get upgrade -y #安装 ssh、apache 和 supervisor RUN apt-get install -y --force-yes perl -base= 5.14 . 2 -6ubuntu2 RUN apt-get

Docker使用 Supervisor 来管理进程

纵然是瞬间 提交于 2019-12-26 03:42:13
Docker 容器在启动的时候开启单个进程,比如,一个 ssh 或者 apache 的 daemon 服务。但我们经常需要在一个机器上开启多个服务,这可以有很多方法,最简单的就是把多个启动命令放到一个启动脚本里面,启动的时候直接启动这个脚本,另外就是安装进程管理工具。 本小节将使用进程管理工具 supervisor 来管理容器中的多个进程。使用 Supervisor 可以更好的控制、管理、重启我们希望运行的进程。在这里我们演示一下如何同时使用 ssh 和 apache 服务。 配置 首先创建一个 Dockerfile,内容和各部分的解释如下。 FROM ubuntu:13.04 MAINTAINER examples@docker.com RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update RUN apt-get upgrade -y 安装 ssh、apache 和 supervisor RUN apt-get install -y openssh-server apache2 supervisor RUN mkdir -p /var/run/sshd RUN mkdir -p /var/log

Docker Container同时启动多服务 supervisor

天涯浪子 提交于 2019-12-26 03:41:32
Docker Container 同时启动多服务 转载请注明来自: http://blog.csdn.net/wsscy2004 昨天踩了个天坑,我有一个基本的镜像centos6.5+ssh,是通过Dockerfile build的,利用CMD命令启动ssh。 通过centos6.5+ssh镜像,我想build一个rabbitmq镜像,Dockerfile中CMD启动rabbitmq服务。虽然我知道Dockerfile中的CMD只能有一个,但没想到创建另一个image,也会继承FROM image的CMD. 利用docker的命令inspect可以看到,CMD已经被替换了。 "Cmd": [ /usr/bin/supervisord" ], 下面进入正题,如何同时启动多个服务,主要有如下方式 supervisor supervisor是linux下监控进程的工具,通过supervisor启动所有服务。 创建Dockerfile: # use this image to run multiple service # add service in supervisord.conf FROM centos6-ssh MAINTAINER edwardsbean@gmail.com RUN yum install -y supervisor RUN mkdir -p /var/run

Python logging with Supervisor

别等时光非礼了梦想. 提交于 2019-12-24 17:07:16
问题 I'm currently using supervisor to monit and daemonize some python scripts easily. However, it seems that supervisor won't log properly. The scripts I'm executing is as simple as this : #!/usr/bin/env python import pushybullet as pb import sys, time, logging # INIT LOGGING logging.basicConfig(format='%(asctime)s @%(name)s [%(levelname)s]: %(message)s', level = logging.DEBUG) if __name__ == '__main__': try: logging.info('Custom service started') while True: #here for the sake of example,

Nginx - sometimes throws 502 Bad Gateway

夙愿已清 提交于 2019-12-24 14:52:05
问题 I've got a project Django, gunicorn, nginx. It mostly works (most of the endpoints), but sometimes nginx throws 502 BAD GATEWAY. Error is upstream prematurely closed connection while reading response header from upstream Do you have any idea what's wrong with it? Thanks! 回答1: Sometimes it's happen when page render time more longer then expected Try to increase timeout (nginx has 60s default timeout) proxy_send_timeout 180s; proxy_read_timeout 180s; Read more here http://nginx.org/en/docs/http

How to stop supervisord when a specific program stopped normally

杀马特。学长 韩版系。学妹 提交于 2019-12-24 11:21:36
问题 I am using supervisord inside docker to run two processes: the main process and an ssh tunnel needed by the main process When the main process stops normally, the ssh tunnel process stays alive forever, preventing the docker from stopping. This is problematic as the container runs as a Kubernetes job, that needs to terminate when the main process finished. The question is, is it possible to kill the ssh tunnel when the main process stops or even better: stopping supervisord when the main

Load balanced Fiware Orion

笑着哭i 提交于 2019-12-24 03:30:01
问题 I just created a dockerized load balanced version of OCB using Nginx and supervisord running separate instances of Orion balanced by Nginx. Only for testing purposes. My question is if I use this approach, would I have some troubles with TIMEINTERVAL subscriptions? (I don't want 'n' notifications for each OCB process). Any help will be sure appreciated. 回答1: Current Orion version (0.23.0) works in the following way: at creation time, the ONTIMEINTERVAL subscribeContext is dispatched by the LB

PHPfpm and Nginx not working in Docker with Supervisord

拜拜、爱过 提交于 2019-12-24 01:10:03
问题 I am running 2 processes inside a docker container an Nginx server and PHP-FPM with supervisord but it just keep exiting with status 1 (unexpected) Here are the logs 2016-12-09 21:37:35,529 CRIT Supervisor running as root (no user in config file) 2016-12-09 21:37:35,596 INFO RPC interface 'supervisor' initialized 2016-12-09 21:37:35,598 INFO supervisord started with pid 1 2016-12-09 21:37:36,602 INFO spawned: 'nginx' with pid 7 2016-12-09 21:37:36,606 INFO spawned: 'php-fpm' with pid 8 2016

Set environment variables with supervisor for Flask

跟風遠走 提交于 2019-12-24 00:54:48
问题 My supervisor configuration file: [program:dashboard] command = /home/ubuntu/dashboard/bin/gunicorn manage:app -w 4 directory = /home/ubuntu/dashboard autostart=true autorestart=true user = ubuntu stdout_logfile = /home/ubuntu/dashboard/logs/gunicorn/gunicorn_stdout.log stderr_logfile = /home/ubuntu/dashboard/logs/gunicorn/gunicorn_stderr.log redirect_stderr = True environment=SECRET_KEY="a_key",FLASK_CONFIG="production",DB_HOST="a_host",DB_PASSWORD="a_password",DB_USERNAME="a_username" In my

libfaketime doesn't work with golang

≯℡__Kan透↙ 提交于 2019-12-24 00:41:41
问题 I would like my go program, which runs on ubuntu server (14.04), daemonized with supervisor, to use a fake server time. In my supervisor config, I use this as the executing command: "faketime 'last Friday 5 pm' /home/user/main" The program runs, but displays the current time. According to this article: Changing what time a process thinks it is with libfaketime libfaketime cannot be used with statically linked or setuid programs, because LD_PRELOAD is not available to such programs. Is there