代码之家  ›  专栏  ›  技术社区  ›  Anders Elton

气流-DAG未运行

  •  3
  • Anders Elton  · 技术社区  · 8 年前

    python:27

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

    我没有自己创建任何DAG,但尝试运行示例以了解其工作原理。

    我已更改配置以使用

    executor = LocalExecutor
    

    完成了

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

    Webserver以“airflow Webserver”的形式启动,在另一个shell中,我启动了“airflow scheduler”。

    我试着进入web ui,通过单击“DAGs”,然后单击“运行”按钮来统计任务。(此时会打开一个对话框,询问我是否要立即运行)

    我尝试启动的是“example\u bash\u操作符,example\u http\u操作符,example\u python\u操作符”,它们现在显示为正在运行。但情况并没有改变。我也点击了,所以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
    
    1 回复  |  直到 8 年前
        1
  •  1
  •   Shashank    8 年前

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

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