supervisord

Supervisor & Docker: How to exit Supervisor if a service doesn't start?

為{幸葍}努か 提交于 2019-12-06 05:21:00
问题 I'm currently using Supervisor inside my Docker images to start and manage my services and I would like to configure Supervisor to exit if at least one of these services entered FATAL state. Doing that, I want to avoid to have Docker containers in running state when nothing except Supervisor has succeeded to start. 回答1: You can do this with a Supervisor event listener. Subscribe it to the event PROCESS_STATE_FATAL , and respond to the event by sending a SIGTERM to supervisord, which you are

使用supervisor管理lnmp

感情迁移 提交于 2019-12-06 04:48:28
一、supervisor简介    Supervisor是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统。它可以很方便的监听、启动、停止、重启一个或多个进程。用Supervisor管理的进程,当一个进程意外被杀死,supervisort监听到进程死后,会自动将它重新拉起,很方便的做到进程自动恢复的功能,不再需要自己写shell脚本来控制。   二、supervisor安装   1.安装python包管理工具: yum install python-setuptools   2.安装supervisor easy_install supervisor   3.配置supervisor 通过运行echo_supervisord_conf程序生成supervisor的初始化配置文件,如下所示: mkdir /etc/supervisor echo_supervisord_conf > /etc/supervisor/supervisord.conf 编辑supervisor配置文件,添加如下内容: ;[include] ;files = relative/directory/*.ini ;conf.d 为配置表目录的文件夹,需要手动创建 [include] files = conf.d/*.conf 三

Is chronological order of logging messages guaranteed?

房东的猫 提交于 2019-12-06 03:24:57
问题 I'm using the logging module to log messages from an application server. More specifically, I use a StreamHandler to log messages to stdout/stderr, and use Supervisord to log those messages to files (since the server process is monitored by Supervisord ). My main question is, does the order of messages in the log file always truthfully reflect the order of execution of the code? For example, if a message A: this is log msg A appears before message B: this is log msg B in a log file, then can

Why is Supervisor not recognizing code changes?

和自甴很熟 提交于 2019-12-06 03:15:15
问题 I'm using Supervisor to manage my node.js applicaton on an EC2 instance with git for deployment. Supervisor does a good job of making sure my application stays up, but whenever I push new server-side code to my remote server, it tends to not recognize those changes. I need to kill the supervisor process and restart it. Is there something I'm doing wrong, or is this standard behavior? 回答1: This is standard behaviour; supervisord does not detect changes in code. It only restarts processes if

Running supervisord from the host, celery from a virtualenv (Django app)

百般思念 提交于 2019-12-05 23:55:57
I'm trying to use celery and redis queue to perform a task for my Django app. Supervisord is installed on the host via apt-get , whereas celery resides in a specific virtualenv on my system, installed via `pip. As a result, I can't seem to get the celery command to run via supervisord. If I run it from inside the virtualenv, it works fine, outside of it, it doesn't. How do I get it to run under my current set up? Is the solution simply to install celery via apt-get, instead of inside the virtualenv? Please advise. My celery.conf inside /etc/supervisor/conf.d is: [program:celery] command=/home

supervisor

柔情痞子 提交于 2019-12-05 22:42:31
参考: 有空研究下原理 廖雪峰简单讲解: https://www.liaoxuefeng.com/article/895919885120064 源码解析: https://cloud.tencent.com/developer/article/1414914 安装supervisor: yum install -y epel-release yum install -y supervisor vim /etc/supervisord.conf 例子: kafka启动管理 cd /etc/supervisord.d vim jps.ini [program:kafka] directory=/data/kafka_2.11-2.3.1/ command=/data/kafka_2.11-2.3.1/bin/kafka-server-start.sh /data/kafka_2.11-2.3.1/config/server.properties autostart=true autorestart=true startsecs=10 stderr_logfile=/tmp/super_kafka_stderr.log stdout_logfile=/tmp/super_kafka_stdout.log user=root redirect_stderr=true stdout

Supervisord and ulimit to java app

蓝咒 提交于 2019-12-05 18:44:23
I am using supervisord to start my java app. The application is working OK, but my ulimit nofiles is not set. I could do it in one machine, using debian. but there is a problem on the second machine that this configuration is not working. Basically, I start my app with a script: #!/bin/sh iscsiJar="/mnt/cache/jscsi/udrive.jar" ulimit -SHn 32768 # função para iniciar a aplicação java -XX:MaxHeapFreeRatio=70 -Xmx2048M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -jar $iscsiJar But my command cat /proc/4171/limits keeps saying: Max open files 4096 4096 files Any hint? I already

Valid Architecture for a Message Queue & Worker System in PHP?

限于喜欢 提交于 2019-12-05 16:55:37
问题 I'm trying to wrap my head around the message queue model and jobs that I want to implement in a PHP app: My goal is to offload messages / data that needs to be sent to multiple third party APIs, so accessing them doesnt slow down the client. So sending the data to a message queue is ideal. I considered using just Gearman to hold the MQ/Jobs, but I wanted to use a Cloud Queue service like SQS or Rackspace Cloud Queues so i wouldnt have to manage the messages. Here's a diagram of what I think

how to define start order in group of processes using supervisord?

只愿长相守 提交于 2019-12-05 16:11:59
Does the program priority determine the start order? i.e. baz then bar ? If I have: [group:foo] programs=bar,baz And: [program:bar] command=/path/to/bar priority=200 As well as: [program:baz] command=/path/to/baz priority=150 Yes. Lower priorities indicate programs that start first and shut down last at startup and when aggregate commands are used in various clients (e.g. “start all”/”stop all”). Higher priorities indicate programs that start last and shut down first. 来源: https://stackoverflow.com/questions/23244954/how-to-define-start-order-in-group-of-processes-using-supervisord

supervisord always returns exit status 127 at WebFaction

半城伤御伤魂 提交于 2019-12-05 14:54:59
I keep getting the following errors from supervisord at webFaction when tailing the log: INFO exited: my_app (exit status 127; not expected) INFO gave up: my_app entered FATAL state, too many start retries too quickly Here's my supervisord.conf: [unix_http_server] file=/home/btaylordesign/tmp/supervisord.sock [rpcinterface:supervisor] supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///home/btaylordesign/tmp/supervisord.sock [supervisord] logfile=/home/btaylordesign/tmp/supervisord.log logfile_maxbytes=50MB logfile_backups=5 loglevel