You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache Airflow 1.9.0 Celery Executor无结果后端配置致任务执行异常求助

解决Airflow 1.9.0 Celery Executor "No result backend configured" 错误

这是Celery Executor的核心配置问题——Airflow在使用Celery模式时必须指定结果后端来存储任务执行状态,否则调度器无法和Celery Worker同步,就会抛出你遇到的这个错误。

先还原你提供的错误日志:

[2018-05-08 12:09:06,737] {jobs.py:1077} INFO - No tasks to consider for execution.
[2018-05-08 12:09:06,738] {jobs.py:1662} INFO - Heartbeating the executor
[2018-05-08 12:09:06,738] {celery_executor.py:101} ERROR - Error syncing the celery executor, ignoring it:
[2018-05-08 12:09:06,738] {celery_executor.py:102} ERROR - No result backend configured. Please see...

具体解决步骤:

  1. 打开Airflow配置文件:找到你的airflow.cfg,默认路径是~/airflow/airflow.cfg,系统级部署可能在/etc/airflow/airflow.cfg。
  2. 配置Celery结果后端:定位到[celery]章节,修改result_backend参数,根据你使用的服务选择对应配置:
    • 用Redis作为结果后端:
      result_backend = redis://localhost:6379/0
      
    • 用PostgreSQL数据库:
      result_backend = db+postgresql://<用户名>:<密码>@<主机>:<端口>/<数据库名>
      
    • 用RabbitMQ(注意:该方案部分版本存在兼容性问题,更推荐Redis或数据库):
      result_backend = rpc://
      
  3. 确保依赖服务正常运行:比如选了Redis就确认Redis服务已启动且Airflow可访问;选数据库则要保证数据库服务正常,Airflow拥有读写权限。
  4. 重启Airflow相关服务:修改配置后,必须重启调度器和Celery Worker让配置生效:
    # 重启调度器
    airflow scheduler restart
    # 重启Celery Worker
    airflow worker restart
    
  5. 额外检查项:同时确认[celery]章节下的broker_url配置正确(这是Celery消息队列地址),比如Redis的配置示例:
    broker_url = redis://localhost:6379/0
    

完成以上配置后,再从UI触发任务,调度器就能正常和Celery Worker同步任务状态了。

内容的提问来源于stack exchange,提问作者Rafiul Sabbir

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:11:40