I have defined a DAG in a file called tutorial_2.py
(actually a copy of the tutorial.py
provided in the airflow
tutorial, except with the dag_id
更改为 tutorial_2
)。
When I look inside my default, unmodified airflow.cfg
(located in ~/airflow
), I see that dags_folder
is set to /home/alex/airflow/dags
.
我做 cd /home/alex/airflow; mkdir dags; cd dags; cp [...]/tutorial_2.py tutorial_2.py
。现在我有一个 dags
文件夹匹配 airflow.cfg
中设置的路径,包含我之前创建的 tutorial_2.py
文件。
但是,当我运行 airflow list_dags
时,我只获得与默认教程 DAG 对应的名称。
我想让 tutorial_2
出现在我的 DAG 列表中,以便我可以开始与之交互。 python tutorial_2.py
和 airflow resetdb
都没有导致它出现在列表中。
我该如何补救?
原文由 Aleksey Bilogur 发布,翻译遵循 CC BY-SA 4.0 许可协议
我认为这是因为您还没有导出
AIRFLOW_HOME
。尝试做:AIRFLOW_HOME="/home/alex/airflow/dags" airflow list_dags
。如果这不起作用,则执行两个步骤export AIRFLOW_HOME="/home/alex/airflow/dags" airflow list_dags
我相信这应该可行。搏一搏?