Browse Source

A more elaborate supervisord example. Thanks to Ian Schenck and Yashh

Ask Solem 15 years ago
parent
commit
d71e0990a3

+ 25 - 0
contrib/supervisord/celerybeat.conf

@@ -0,0 +1,25 @@
+; ============================
+;  celerybeat supervisor example
+; ============================
+
+; NOTE: If you're using Django, you shouldn't use this file.
+; Use django/celerybeat.conf instead!
+
+[program:celerybeat]
+command=celerybeat --schedule /var/lib/celery/celerybeat-schedule --loglevel=INFO
+
+; Set PYTHONPATH to the directory containing celeryconfig.py
+environment=PYTHONPATH=/path/to/project
+
+directory=/path/to/project
+user=nobody
+numprocs=1
+stdout_logfile=/var/log/celerybeat.log
+stderr_logfile=/var/log/celerybeat.log
+autostart=true
+autorestart=true
+startsecs=10
+
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=999

+ 25 - 0
contrib/supervisord/celeryd.conf

@@ -0,0 +1,25 @@
+; ============================
+;  celeryd supervisor example
+; ============================
+
+; NOTE: If you're using Django, you shouldn't use this file.
+; Use django/celeryd.conf instead!
+
+[program:celery]
+command=celeryd --loglevel=INFO
+
+; Set PYTHONPATH to the directory containing celeryconfig.py
+environment=PYTHONPATH=/path/to/project
+
+directory=/path/to/project
+user=nobody
+numprocs=1
+stdout_logfile=/var/log/celeryd.log
+stderr_logfile=/var/log/celeryd.log
+autostart=true
+autorestart=true
+startsecs=10
+
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=998

+ 18 - 0
contrib/supervisord/django/celerybeat.conf

@@ -0,0 +1,18 @@
+; ==========================================
+;  celerybeat supervisor example for Django
+; ==========================================
+
+[program:celerybeat]
+command=/path/to/project/manage.py celerybeat --schedule=/var/lib/celery/celerybeat-schedule --loglevel=INFO
+directory=/path/to/project
+user=nobody
+numprocs=1
+stdout_logfile=/var/log/celerybeat.log
+stderr_logfile=/var/log/celerybeat.log
+autostart=true
+autorestart=true
+startsecs=10
+
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=999

+ 18 - 0
contrib/supervisord/django/celeryd.conf

@@ -0,0 +1,18 @@
+; =======================================
+;  celeryd supervisor example for Django
+; =======================================
+
+[program:celery]
+command=/path/to/project/manage.py celeryd --loglevel=INFO
+directory=/path/to/project
+user=nobody
+numprocs=1
+stdout_logfile=/var/log/celeryd.log
+stderr_logfile=/var/log/celeryd.log
+autostart=true
+autorestart=true
+startsecs=10
+
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=998

+ 34 - 20
contrib/supervisord/supervisord.conf

@@ -1,20 +1,34 @@
-[program:celery]
-command=/path/to//python /path/to/manage.py celeryd
-numprocs=1
-user=nobody
-stdout_logfile=/var/log/celery.log
-stderr_logfile=/var/log/celery.log
-
-[program:celerybeat]
-command=/path/to//python /path/to/manage.py celerybeat
-numprocs=1
-user=nobody
-stdout_logfile=/var/log/celerybeat.log
-stderr_logfile=/var/log/celerybeat.log
-
-[program:celerymon]
-command=/path/to//python /path/to/manage.py celerymon
-numprocs=1
-user=nobody
-stdout_logfile=/var/log/celerymon.log
-stderr_logfile=/var/log/celerymon.log
+[unix_http_server]
+file=/tmp/supervisor.sock   ; path to your socket file
+
+[supervisord]
+logfile=/var/log/supervisord/supervisord.log ; supervisord log file
+logfile_maxbytes=50MB       ; maximum size of logfile before rotation
+logfile_backups=10          ; number of backed up logfiles
+loglevel=info               ; info, debug, warn, trace
+pidfile=/var/run/supervisord.pid ; pidfile location
+nodaemon=false              ; run supervisord as a daemon
+minfds=1024                 ; number of startup file descriptors
+minprocs=200                ; number of process descriptors
+user=root                   ; default user
+childlogdir=/var/log/supervisord/            ; where child log files will live
+
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisorctl]
+serverurl=unix:///tmp/supervisor.sock; use unix:// schem for a unix sockets.
+
+
+[include]
+
+# Uncomment this line for celeryd for Python
+;files=celeryd.conf
+
+# Uncomment this line for celeryd for Django.
+;files=django/celeryd.conf
+
+
+
+