Есть сервер с
Ubuntu 14.04 и
django проект 1.10. Делаю по этому мануалу:
tech.willandskill.se/using-celery-with-django-and-...
В /etc/ini.d/celeryd вставил этот код:
https://github.com/celery/celery/blob/3.1/extra/ge...
Настройки проекта
/home/user_name/djnago_test_celery/djnago_test_celery/settings.pyINSTALLED_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()
Настройки
/etc/default/celeryd:
# 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"
Запускаю команду
sudo /etc/init.d/celeryd start:
celery init v10.1.
Using config script: /etc/default/celeryd
celery multi v3.1.25 (Cipater)
> Starting nodes...
> worker1@user_name: OK
Но таски не работают. Читаю логи по этому пути
/home/celery/logs/celery-worker1.log , затем смотрю там
/var/log/celery/celery.log и вижу:
[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...
Мои настройки
/etc/default/celeryd не видят настройки django проекта?