0
votes

I'm trying to daemonize my tasks in celery, i've tested without daemonizing and it's working very well.

But i can't daemonize like the tutorial said (http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#daemonizing) I have my files:

solr_desa.py

from celery import Celery

celery = Celery('solrdesa')
celery.config_from_object('celeryconfig')

@celery.task(name = "doSomething")
def doSomething():
    return 6

celeryconfig.py

from celery.schedules import crontab

BROKER_URL = '127.0.0.1'
BROKER_PORT = 5673
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6969/0'
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'America/Santiago'
CELERY_IMPORTS = ('solr_desa', )
CELERYBEAT_SCHEDULE = {
    'solr_schedule': {
        'task': 'doSomething',
        'schedule': crontab(minute=9, hour=12)
    },
}

And also /etc/default/celeryd

CELERY_NODES="w1"

CELERYD_CHDIR="/opt/latam/script/solr"

CELERYD_OPTS="--time-limit=300 --concurrency=8"

CELERY_CONFIG_MODULE="celeryconfig"

CELERYD_LOG_FILE="/var/log/celery/%n.log"
CELERYD_PID_FILE="/var/run/celery/%n.pid"

I execute with the default celeryd in https://github.com/celery/celery/blob/3.0/extra/generic-init.d/celeryd, but the tasks are just enqueued but it looks like there are not workers :(

Where is my mistake in my configuration? :(

1

1 Answers

0
votes

your broker url is wrong it should be something like this

BROKER_URL : transport://userid:password@hostname:port/virtual_host
#example
BROKER_URL = "amqp://{username}:{password}@{host}:{port}//"

read here for more details