相关疑难解决方法(0)

由于 gunicorn,气流系统失败

我无法使用 systemd 启动气流网络服务器,即使它在 systemd 之外启动并正常运行,如下所示:

export AIRFLOW_HOME=/path/to/my/airflow/home ; airflow webserver -p 8080
Run Code Online (Sandbox Code Playgroud)

systemd 日志让我相信问题来自于 gunicorn,即使当我运行上述命令时,gunicorn 启动时没有问题(即它只是 systemd 中的一个问题)。我已经根据气流文档(运行 Ubuntu 16)配置了以下 systemd 文件。

/etc/default/airflow

AIRFLOW_HOME=/path/to/my/airflow/home
SCHEDULER_RUNS=5
Run Code Online (Sandbox Code Playgroud)

/lib/systemd/system/airflow-webserver.service

[Unit]
Description=Airflow webserver daemon   
After=network.target

[Service]
EnvironmentFile=/etc/default/airflow
User=ubuntu
Group=ubuntu
Type=simple
ExecStart=/bin/bash -c "export AIRFLOW_HOME=/path/to/my/airflow/home ; airflow webserver -p 8080 "

Restart=on-failure
RestartSec=5s
PrivateTmp=true

[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

/etc/tmpfiles.d/airflow.conf

D /run/airflow 0755 airflow airflow
Run Code Online (Sandbox Code Playgroud)

当我使用 systemctl 启动服务时,这会导致以下错误。

systemctl start airflow-webserver.service

Jul 15 22:41:27 ip-172-31-19-64 systemd[1]: Started Airflow webserver daemon.
Jul 15 22:41:27 ip-172-31-19-64 bash[31494]: [2018-07-15 22:41:27,555] {driver.py:120} …
Run Code Online (Sandbox Code Playgroud)

gunicorn systemd airflow

7
推荐指数
1
解决办法
4779
查看次数

标签 统计

airflow ×1

gunicorn ×1

systemd ×1