- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
文档指定instructions for the integration
我想要的是,每次调度程序停止工作时,它将自己重新启动。通常,我使用airflow scheduler -D
手动启动它,但有时在不可用时停止。
阅读文档时,我不确定配置。
GitHub包含以下文件:
airflow
airflow-scheduler.service
airflow.conf
home/ubuntu/airflow
etc/systemd
Copy (or link) them to /usr/lib/systemd/system
copy the airflow.conf to /etc/tmpfiles.d/
# AIRFLOW_CONFIG=
是什么? 最佳答案
将Airflow与systemd文件集成在一起可以轻松监视守护程序,因为systemd可以在失败时重新启动守护程序。这也可以在系统启动时自动启动 Airflow Web服务器和调度程序。
根据当前配置,从Airflow Github中的airflow
文件夹中编辑systemd
文件,以设置AIRFLOW_CONFIG
,AIRFLOW_HOME
和SCHEDULER
的环境变量。
将服务文件(扩展名为.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/
我是一名优秀的程序员,十分优秀!