无法让apache-airflow从systemd开始

时间:2018-08-15 11:34:15

标签: airflow systemd

系统规格:

Ubuntu 16.04 LTS
Apache-airflow 1.9.0
Supervisord 3.2.0

气流安装使用virtualenv /var/lib/airflow/venv

系统配置:airflow-webserver.service [无效]

[Install]
WantedBy=multi-user.target

[Service]
ExecStart=/var/lib/airflow/venv/bin/airflow webserver --pid /var/run/airflow/airflow-webserver.pid
Group=airflow
RestartSec=5s
Environment=PATH=/var/lib/airflow/venv/bin
Environment=HOME=/var/lib/airflow
Environment=AIRFLOW_HOME=/var/lib/airflow/airflow
Environment=AIRFLOW_CONFIG=/var/lib/airflow/airflow/airflow.cfg
User=airflow
PrivateTmp=true
Type=simple
Restart=on-failure

[Unit]
Wants=postgresql.service mysql.service redis.service rabbitmq-server.service
After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service
Description=Airflow webserver daemon

Supervisord配置:[Works]

[program:airflow]
command=/var/lib/airflow/venv/bin/airflow webserver
stopsignal=QUIT
stopasgroup=true
user=airflow
stdout_logfile=/mnt2/var/log/airflow/airflow-webserver.log
stderr_logfile=/mnt2/var/log/airflow/airflow-webserver.log
environment=HOME="/var/lib/airflow",AIRFLOW_HOME="/var/lib/airflow/airflow",AIRFLOW_CONFIG="/var/lib/airflow/airflow/airflow.cfg",PATH="/var/lib/airflow/venv/bin:%(ENV_PATH)s"

命令行执行:[Works]

sudo -H -u airflow bash -c "export PATH=/var/lib/airflow/venv/bin;export AIRFLOW_HOME=/var/lib/airflow/airflow;export AIRFLOW_CONFIG=/var/lib/airflow/airflow/airflow.cfg;/var/lib/airflow/venv/bin/airflow webserver --pid /var/run/airflow/airflow-webserver.pid"

受监管的配置和命令行执行都可以,但是systemd执行拒绝启动,不写任何日志。这就是我作为journalctl -u airflow-webserver

的输出所得到的
-- Logs begin at Tue 2018-08-14 12:32:43 UTC, end at Wed 2018-08-15 11:30:09 UTC. --
Aug 15 05:36:38 Server systemd[1]: Started LSB: Start airflow webserver.
Aug 15 05:46:36 Server systemd[1]: Started LSB: Start airflow webserver.
Aug 15 05:50:06 Server systemd[1]: Started LSB: Start airflow webserver.
Aug 15 05:50:17 Server systemd[1]: Started LSB: Start airflow webserver.
Aug 15 07:06:18 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 07:13:25 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 07:44:45 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 08:06:52 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 08:48:38 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 08:54:39 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 08:54:59 Server systemd[1]: Started Airflow webserver daemon.
Aug 15 08:56:49 Server systemd[1]: Started Airflow webserver daemon.

0 个答案:

没有答案