安排AirfFlow DAG作业 [英] Scheduling AirfFlow DAG job

查看:65
本文介绍了安排AirfFlow DAG作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个如下的Airflow DAG-

I have written a AirFlow DAG as below -

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2016, 7, 5),
    'email': ['airflow@airflow.com'],
    'email_on_failure': False,
    'email_on_retry': False,
    'retries': 1,
    'retry_delay': timedelta(seconds=30),
    # 'queue': 'bash_queue',
    # 'pool': 'backfill',
    # 'priority_weight': 10,
    # 'end_date': datetime(2016, 1, 1),
}

dag = DAG(
    'test-air', default_args=default_args, schedule_interval='*/2 * * * *')
.................
.................
{{Tasks}}

按照上述配置,Job应该每隔一分钟运行一次。而是在下面的输出中显示

As per above config, Job should run every even minute. But instead it shows below output

airflow scheduler -d test-air
[2016-07-05 15:24:02,168] {jobs.py:574} INFO - Prioritizing 0 queued jobs
[2016-07-05 15:24:02,177] {jobs.py:726} INFO - Starting 0 scheduler jobs
[2016-07-05 15:24:02,177] {jobs.py:741} INFO - Done queuing tasks, calling the executor's heartbeat
[2016-07-05 15:24:02,177] {jobs.py:744} INFO - Loop took: 0.012636 seconds
[2016-07-05 15:24:02,256] {models.py:305} INFO - Finding 'running' jobs without a recent heartbeat
[2016-07-05 15:24:02,256] {models.py:311} INFO - Failing jobs without heartbeat after 2016-07-05 15:21:47.256816
[2016-07-05 15:24:07,177] {jobs.py:574} INFO - Prioritizing 0 queued jobs
[2016-07-05 15:24:07,182] {jobs.py:726} INFO - Starting 0 scheduler jobs
[2016-07-05 15:24:07,182] {jobs.py:741} INFO - Done queuing tasks, calling the executor's heartbeat
[2016-07-05 15:24:07,182] {jobs.py:744} INFO - Loop took: 0.007725 seconds
[2016-07-05 15:24:07,249] {models.py:305} INFO - Finding 'running' jobs without a recent heartbeat
[2016-07-05 15:24:07,249] {models.py:311} INFO - Failing jobs without heartbeat after 2016-07-05 15:21:52.249706

有人可以在这里引导我吗?

Can somebody guide me over here?

感谢
Pari

Thanks Pari

推荐答案

默认情况下,创建的每个dag均处于暂停模式。这在 airflow.cfg文件中定义。
您可以通过以下方式取消暂停:

By default every dag that is created is at "pause" mode. This is defined in your "airflow.cfg" file. You can unpause your dag by

$ airflow unpause test-air

,然后使用调度程序重试。

and retry again with the scheduler.

您还可以从Airflow webUI开启/关闭dag(默认情况下处于关闭状态)

You can also toggle your dag on/off from the Airflow webUI (by default it is off)

这篇关于安排AirfFlow DAG作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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