向气流添加额外的芹菜配置 [英] Adding extra celery configs to Airflow

查看:93
本文介绍了向气流添加额外的芹菜配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我可以在哪里向气流芹菜执行器添加额外的芹菜配置吗?例如,我要 http://docs.celeryproject。 org / zh-CN / latest / userguide / configuration.html#worker-pool-restarts 此属性,但是如何允许额外的芹菜属性。

Anyone know where I can add extra celery configs to airflow celery executor? For instance I want http://docs.celeryproject.org/en/latest/userguide/configuration.html#worker-pool-restarts this property but how do I allow extra celery properties..

推荐答案

使用刚刚发布的Airflow 1.9.0,现在可以对其进行配置。

Use the just-released Airflow 1.9.0 and this is now configurable.

airflow.cfg中有以下行:

In airflow.cfg there is this line:

# Import path for celery configuration options
celery_config_options = airflow.config_templates.default_celery.DEFAULT_CELERY_CONFIG

指向导入路径中的python文件。当前的默认版本可以是 https:// github .com / apache / incubator-airflow / blob / 1.9.0 / airflow / config_templates / default_celery.py

which points to a python file from the import path. The current default version can is https://github.com/apache/incubator-airflow/blob/1.9.0/airflow/config_templates/default_celery.py

如果您需要的设置不是可通过该文件进行调整,然后创建一个新模块,例如 my_celery_config.py:

If you need a setting that isn't tweakable via that file then create a new module, say 'my_celery_config.py':

CELERY_CONFIG = {
    # ....
}

并将其放在您的AIRFLOW_HOME dir中(即,在调试旁边) /文件夹),然后在配置中设置 celery_config_options = my_celery_config.CELERY_CONFIG

and put it in your AIRFLOW_HOME dir (i.e. along side the dags/ folder) and then set celery_config_options = my_celery_config.CELERY_CONFIG in the config.

这篇关于向气流添加额外的芹菜配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆