【问题标题】:Airflow hide_paused_dags_by_default on airflow.cfg is not workingairflow.cfg 上的气流 hide_paused_dags_by_default 不起作用
【发布时间】:2018-11-30 02:36:39
【问题描述】:

我想在 UI 上隐藏所有已暂停的 DAG,但气流.cfg 上的配置似乎不起作用。

# By default, the webserver shows paused DAGs. Flip this to hide paused
# DAGs by default
hide_paused_dags_by_default = True #False by default

到目前为止我为使其工作所做的步骤:

  • 重新启动气流网络服务器、调度程序和工作人员
  • 删除airflow.cfg 并执行airflow initdb(拼命行动)

【问题讨论】:

  • 您只需要更改airflow.cfg 文件中的配置并重新启动网络服务器。你不需要删除airflow.cfg文件或做airflow initdb
  • 你是如何运行气流的?如果您使用的是 Docker,您可以使用 bash 和 printenv docker exec 进入 webserver/scheduler 容器,以查看该环境是否设置正确。气流网络 UI 的左下角还应该有一个超链接,可以切换 showPaused
  • @kaxil 正如您在我的代码 sn-p 中看到的那样,我确实更改了 airflow.cfg hide_paused_dags_by_default = True #False 默认情况下。我还提到我确实也重新启动了我的网络服务器。我只删除了我的airflow.cfg 和initb db,因为第一个解决方案不起作用。
  • @rob 我正在使用 systemd 运行气流,有什么解决方法吗?
  • 仍在寻找这个答案

标签: python etl airflow


【解决方案1】:

在使用systemd时,检查是否所有Airflow进程都被杀死

systemctl status airflow-webserver
systemctl status airflow-scheduler
systemctl status airflow-worker

# Stop them if they are "active" 
systemctl stop airflow-webserver
systemctl stop airflow-scheduler
systemctl stop airflow-worker

也可以使用ps aux | grep airflow进行验证

然后更改您的airflow.cfg 文件并重新运行所有气流服务

systemctl restart airflow-webserver
systemctl restart airflow-scheduler
systemctl restart airflow-worker

【讨论】:

  • 我试过这个@kaxil,不幸的是仍然没有用。我尝试更改airflow.cfg 上的其他配置,例如load_example = True,它在我重新启动airflow 网络服务器后工作。但是它不适用于 hide_paused_dags_by_default 我想知道这是否是气流末端的错误。
【解决方案2】:

对于使用 Google Cloud Composer 的用户,您可以通过将以下条目添加到 Airflow Configuration Overrides 来实现:

Section: webserver
    Key: hide_paused_dags_by_default
  Value: true

【讨论】:

    猜你喜欢
    • 2016-11-11
    • 2020-02-21
    • 1970-01-01
    • 2021-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多