I'm trying to run apache-airflow
on a Ubuntu 16.04 file, using systemd. I roughly followed this tutorial and installed/setup the following:
- Miniconda 2, 64-bit
- Installed gcc (
sudo apt-get install gcc
) - Conda environment, using the
yml
file of the tutorial
Within the following conda environment:
- export AIRFLOW_HOME="/home/ubuntu/airflow"
When I test Airflow, everything works fine:
airflow webserver --port 8080
But whenever I try to launch airflow using a systemd file, it fails. The systemd file makes use of the conda environment, as far as I understand correctly. My systemd file looks as follows:
[Unit]
Description=Airflow webserver daemon
[Service]
User=ubuntu
Group=ubuntu
Type=simple
ExecStart=/home/ubuntu/miniconda2/envs/airflow-tutorial/bin/airflow webserver --port 8080
Restart=on-failure
RestartSec=5s
PrivateTmp=true
[Install]
WantedBy=multi-user.target
When I start/enable the systemd daemon, status returns the following error:
airflow-webserver.service - Airflow webserver daemon
Loaded: loaded (/etc/systemd/system/airflow-webserver.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2018-09-13 08:59:00 UTC; 1s ago
Process: 18410 ExecStart=/home/ubuntu/miniconda2/envs/airflow-tutorial/bin/airflow webserver --port 8080 (code=exited, status=1/FAILURE)
Main PID: 18410 (code=exited, status=1/FAILURE)
Sep 13 08:59:00 ip-172-31-46-255 systemd[1]: airflow-webserver.service: Main process exited, code=exited, status=1/FAILURE
Sep 13 08:59:00 ip-172-31-46-255 systemd[1]: airflow-webserver.service: Unit entered failed state.
Sep 13 08:59:00 ip-172-31-46-255 systemd[1]: airflow-webserver.service: Failed with result 'exit-code'.
Help is highly appreciated!