redbeat
redbeat copied to clipboard
RedBeat product tasks normal, but worker not consume
HI, I'm use celery4.0 and redbeat.
celeryconfig.py
from datetime import timedelta from kombu import Queue
from main.const import ScheduleInterval
BROKER_URL = 'redis://192.168.1.166/0'
CELERY_RESULT_BACKEND = 'redis://192.168.1.166/0'
redbeat_redis_url = "redis://192.168.1.166/0"
CELERYBEAT_SCHEDULER = 'redbeat.RedBeatScheduler'
redbeat_lock_timeout = 300
CELERYBEAT_SCHEDULE = { 'publish': { 'task': 'main.tasks.cycle_publish', # notice that the complete name is needed # 'task': 'main.tasks.add', # notice that the complete name is needed 'schedule': timedelta(seconds=ScheduleInterval.PUBLISH), }, 'free_worker': { 'task': 'main.tasks.cycle_worker', 'schedule': timedelta(seconds=ScheduleInterval.SCAN_TASK) } }
CELERY_QUEUES = ( Queue('default', routing_key='task.#'), Queue('beater', routing_key='beater.#'), Queue('exe_free', routing_key='free.#'), Queue('exe_point', routing_key='point.#'), Queue('exe_auto', routing_key='auto.#'), Queue('publish', routing_key='auto.#'), )
I stared beat with below command:
celery -A main beat -S redbeat.RedBeatScheduler --config main.celeryconfig --loglevel=info
and everything look normal.
[2017-10-25 17:27:27,201: INFO/MainProcess] Scheduler: Sending due task publish (main.tasks.cycle_publish)
Then I try to start the worker to consume tasks with below command:
celery worker -A main -l info
But it look started normal, but never to consume task
[tasks] . main.tasks.auto_rotate . main.tasks.cycle_publish . main.tasks.cycle_worker . main.tasks.end_auto_worker . main.tasks.free_worker . main.tasks.start_auto_worker
[2017-10-25 17:08:12,568: INFO/MainProcess] Connected to redis://192.168.1.166:6379/0 [2017-10-25 17:08:12,584: INFO/MainProcess] mingle: searching for neighbors [2017-10-25 17:08:13,637: INFO/MainProcess] mingle: all alone [2017-10-25 17:08:13,750: INFO/MainProcess] [email protected] ready.
If you run beat without the -S redbeat.RedBeatScheduler
does it generate tasks you're worker can consume? If not then you have a general Celery configuration issue rather than a RedBeat issue.