【问题标题】:Airflow - dags not beeing run气流 - dags 没有运行
【发布时间】:2017-11-20 13:51:42
【问题描述】:

蟒蛇:27

我刚刚在带有 mysql 后端的新 vm GCP 上安装了气流。 (sudo pip install apache-airflow 和 sudo pip install apache-airflow[mysql])

我没有自己创建任何 dags,但尝试运行示例以了解它是如何工作的。

我已更改配置以使用

executor = LocalExecutor

完成了

export AIRFLOW_HOME=`pwd`/airflow  (in both shells)
airflow initdb

Webserver 作为“airflow webserver”启动,在不同的 shell 中我启动了“airflow scheduler”。

我已尝试通过单击“DAG”,然后单击运行按钮进入 web ui 以统计任务。 (打开一个对话框询问我现在是否要运行)

我尝试启动的是“example_bash_operator、example_http_operator、example_python_operator”,它们现在显示为正在运行。但是状态没有改变。我也点击了,所以 3 个 DAG 显示为“on”。

当我浏览 -> 任务实例并查看应该启动的第一个实例时:

All dependencies are met but the task instance is not running. 
In most cases this just means that the task will probably be scheduled soon unless:
.......

我的服务器没有给出任何有意义的输出。我的调度器只是在输出

[2017-11-20 13:42:37,460] {jobs.py:1407} INFO - Heartbeating the process manager
[2017-11-20 13:42:37,460] {jobs.py:1443} INFO - Heartbeating the executor

【问题讨论】:

    标签: python gcp apache-airflow


    【解决方案1】:

    我知道这有点晚了,但我也遇到了同样的问题,所以我想为其他面临这个问题的人提供答案。

    所以问题是因为气流的调度程序在气流.cfg 中的变量dags_folder 指定的文件夹中查找要运行的 dag。示例 dag 存储在安装气流库的位置,这就是调度程序没有获取任何运行的原因。要修复它,只需将 airlfow.cfg 中 dags_folder 的值更改为指向包含示例 dags 的文件夹。要查找示例 dag 文件夹,请从根目录运行 find | grep 'example_bash_operator'

    【讨论】:

    • 只要确保指定的 dags 文件夹存在就足够了。里面不一定有任何东西。这些示例将开始工作。
    猜你喜欢
    • 2022-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-09
    • 2018-01-14
    • 1970-01-01
    • 1970-01-01
    • 2021-07-06
    相关资源
    最近更新 更多