Answer the question
In order to leave comments, you need to log in
How to properly set up a daemon for celery?
There is a server with Ubuntu 14.04 and django project 1.10. I follow this manual: tech.willandskill.se/using-celery-with-django-and-...
I
inserted this code into /etc/ini.d/celeryd: https://github.com/celery/celery/blob /3.1/extra/ge...
Project settings /home/user_name/djnago_test_celery/djnago_test_celery/settings.py
INSTALLED_APPS = [
...
'django.contrib.sitemaps',
'djcelery',
'kombu.transport.django',
]
CELERY_RESULT_BACKEND = "redis://localhost:6379/2"
BROKER_URL = 'redis://localhost:6379/2'
import djcelery
djcelery.setup_loader()
# Name of nodes to start, here we have a single node
CELERYD_NODES="worker1"
# Where to chdir at start.
CELERYD_CHDIR="/home/user_name/djnago_test_celery"
# How to call "manage.py celery worker"
CELERYD_MULTI="/home/user_name/Env/djnago_test_celery/bin/python3 $CELERYD_CHDIR/manage.py celery multi"
# Extra arguments to celeryd
CELERYD_OPTS="--time-limit=300 --concurrency=4 --settings=djnago_test_celery.settings"
# Name of the celery config module.
CELERY_CONFIG_MODULE="djnago_test_celery.settings"
# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/home/celery/logs/celery-%n.log"
CELERYD_PID_FILE="/home/celery/logs/celery-run-%n.log"
# Workers should run as an unprivileged user.
CELERYD_USER="user_name"
CELERYD_GROUP="user_name"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="djnago_test_celery.settings"
celery init v10.1.
Using config script: /etc/default/celeryd
celery multi v3.1.25 (Cipater)
> Starting nodes...
> [email protected]_name: OK
[2017-07-14 20:14:54,852: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
Trying again in 32.00 seconds...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question