gpt4 book ai didi

airflow - 如何在Systemd中使用Airflow Scheduler?

转载 作者:行者123 更新时间:2023-12-04 07:22:26 28 4
gpt4 key购买 nike

文档指定instructions for the integration

我想要的是,每次调度程序停止工作时,它将自己重新启动。通常,我使用airflow scheduler -D手动启动它,但有时在不可用时停止。

阅读文档时,我不确定配置。

GitHub包含以下文件:

airflow
airflow-scheduler.service
airflow.conf

我正在运行Ubuntu 16.04

Airflow 安装在:
home/ubuntu/airflow

我有以下路径:
etc/systemd

该文档说:

Copy (or link) them to /usr/lib/systemd/system


  • 复制哪个文件?

  • copy the airflow.conf to /etc/tmpfiles.d/


  • 什么是tmpfiles.d?
  • Airflow 文件中的# AIRFLOW_CONFIG=是什么?

  • 或者换句话说...关于如何做到这一点的更多“脚踏实地”指南?

    最佳答案

    将Airflow与systemd文件集成在一起可以轻松监视守护程序,因为systemd可以在失败时重新启动守护程序。这也可以在系统启动时自动启动 Airflow Web服务器和调度程序。

    根据当前配置,从Airflow Github中的airflow文件夹中编辑systemd文件,以设置AIRFLOW_CONFIGAIRFLOW_HOMESCHEDULER的环境变量。

    将服务文件(扩展名为.service的文件)复制到VM中的/usr/lib/systemd/system

    airflow.conf文件复制到/etc/tmpfiles.d/或/usr/lib/tmpfiles.d/。复制airflow.conf可确保使用正确的所有者和权限(/run/airflow)创建0755 airflow airflow。如果未创建具有这些权限的/run/airflow文件夹,请检查 Airflow 用户和 Airflow 组拥有的airflow:airflow是否存在/run/airflow

    如下所示,通过在命令行上发出systemctl enable <service>来启用此服务。

    sudo systemctl enable airflow-webserver
    sudo systemctl enable airflow-scheduler
    airflow-scheduler.service文件应如下所示:
    [Unit]
    Description=Airflow scheduler daemon
    After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service
    Wants=postgresql.service mysql.service redis.service rabbitmq-server.service

    [Service]
    EnvironmentFile=/etc/sysconfig/airflow
    User=airflow
    Group=airflow
    Type=simple
    ExecStart=/bin/airflow scheduler
    Restart=always
    RestartSec=5s

    [Install]
    WantedBy=multi-user.target

    关于airflow - 如何在Systemd中使用Airflow Scheduler?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52948855/

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