gpt4 book ai didi

airflow - 调度 Airflow DAG 作业

转载 作者:行者123 更新时间:2023-12-02 12:28:23 27 4
gpt4 key购买 nike

我编写了一个 AirFlow DAG,如下 -

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}}

根据上面的配置,作业应该每偶数分钟运行一次。但它显示以下输出

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

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

谢谢帕里

最佳答案

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

$ airflow unpause test-air

然后使用调度程序重试。

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

关于airflow - 调度 Airflow DAG 作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38200493/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com