Am having challanges starting flower using supervisor.
The following command in my development environment works on the console
celery --app=celery_conf.celeryapp flower --conf=flowerconfig
but moving to production to use supervisor am getting all sorts of errors
/supervisor/conf.d/flower.conf
[program:flower]
command=/opt/apps/venv/my_app/bin/celery flower --app=celery_conf.celeryapp --conf=flowerconfig
directory=/opt/apps/my_app
user=www-data
autostart=true
autorestart=false
redirect_stderr=true
stderr_logfile=/var/log/celery/flower.err.log
stdout_logfile=/var/log/celery/flower.out.log
With the above configuration, there is no error but all celery does is give me a help like output. Its like it doesn't acknowledge the variables passed.
Type 'celery <command> --help' for help using a specific command.
Usage: celery <command> [options]
Show help screen and exit.
Options:
-A APP, --app=APP app instance to use (e.g. module.attr_name)
-b BROKER, --broker=BROKER
url to broker. default is 'amqp://guest@localhost//'
--loader=LOADER name of custom loader class to use.
etc..
etc..
etc...
Supervisor on the other hand throws INFO exited: flower (exit status 64; not expected)
I have other supervisor initiated apps using celery_beat
and using the configuration file samples on github and they are working well with the same directory paths as above
The flowerconfig is as below:
flowerconfig.py
# Broker settings
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
# RabbitMQ management api
broker_api = 'http://guest:guest@localhost:15672/api/'
#Port
port = 5555
# Enable debug logging
logging = 'INFO'
Solution:
Well, not really a solution so I haven't put it as an answer. Turned out there was a problem with my virtual environment. So I removed flower and installed again using pip3.4 as am on python3.4
Something to note though is that for flower to use your flowerconfig
file, you need to add a director=/path/to/your/celery_config/folder/
entry in supervisor's /etc/supervisor/conf.d/flower.conf
file else flower will launch with default settings.
/etc/supervisor/conf.d/flower.conf
; ==================================
; Flower: For monitoring Celery
; ==================================
[program:flower]
command=/opt/apps/venv/my_app/bin/celery flower --app=celery_conf.celeryapp --conf=flowerconfig
directory=/opt/apps/my_app/celery_conf #this is key as my configuration file was in the `celery_conf` folder
user=www-data
autostart=true
autorestart=false
redirect_stderr=true
stderr_logfile=/var/log/celery/flower.err.log
stdout_logfile=/var/log/celery/flower.out.log
Thanks.
help like
output from celery with the new configuration. Note that I have two directoriesopt/apps/venv/my_app
which is the virtual environment for the application and also/opt/apps/my_app
which is where the application resides.. – Anthropolatry