芹菜自动缩放未执行任务

2024-05-16 11:53:23 发布

您现在位置:Python中文网/ 问答频道 /正文

当Celery接收任务时,此任务永远不会执行,只是挂起: 这些任务随机到达,负载非常低。在

芹菜3.1.20

[2016-03-02 22:33:08,300: INFO/MainProcess] Received task: catalogue.cluster.deploy_cluster.imbue_cluster[A5C030C4E0]
[2016-03-02 22:33:08,303: INFO/MainProcess] Scaling up 1 processes.

在这之后,什么都没有发生。在

我用一个shell脚本和supervisord一起开始芹菜:

^{pr2}$

我的配置:

CELERYD_CHDIR=settings.filepath
CELERY_IGNORE_RESULT = False
CELERY_RESULT_BACKEND = "amqp"
CELERY_TASK_RESULT_EXPIRES = 360000
CELERY_RESULT_PERSISTENT = True
BROKER_URL=<rabbitmq>
CELERY_ENABLE_UTC=True
CELERY_TIMEZONE= "US/Eastern"
CELERY_IMPORTS=("catalogue.cluster.deploy_cluster",
                "tools.deploy_tools",)

我这样称呼我的任务:

celery = Celery()
celery.config_from_object('conf.celeryconfig')
celery.send_task("catalogue.cluster.deploy_cluster.imbue_cluster",
                             kwargs={'configuration': configuration,
                                     'job':           job_instance,
                                     'api_call':      True},
                             task_id=job_instance.reference)


@task(bind=True, default_retry_delay=300, max_retries=5)
def imbue_cluster(...)

类似问题:

http://comments.gmane.org/gmane.comp.python.amqp.celery.user/4990https://groups.google.com/forum/#!topic/cloudify-users/ANvSv7mV7h4


Tags: infotrueamqptaskjobresultdeploycelery