airflow systemd fails due to gunicorn

前端 未结 2 1239
灰色年华
灰色年华 2021-01-05 15:54

I am unable to start the airflow webserver using systemd even though it starts and functions properly outside of systemd like so:

export AIRFLOW_HOME=/path/t         


        
相关标签:
2条回答
  • 2021-01-05 16:10

    I had the same problem on Ubuntu 18.04 LTS and Apache Airflow version 1.10.1 installed in a virtual environment under /srv/airflow. After lots of trial and errors I ended up with this working solution.

    My airflow-webserver.service file:

    [Unit]
    Description=Airflow webserver daemon
    After=network.target
    
    [Service]
    Environment="PATH=/srv/airflow/bin"
    Environment="AIRFLOW_HOME=/srv/airflow"
    User=airflow
    Group=airflow
    Type=simple
    ExecStart=/srv/airflow/bin/airflow webserver --pid /srv/airflow/webserver.pid
    Restart=on-failure
    RestartSec=5s
    PrivateTmp=true
    
    [Install]
    WantedBy=multi-user.target
    

    I did this to install the service:

    sudo cp airflow-webserver.service /lib/systemd/system/
    sudo systemctl daemon-reload
    sudo systemctl enable airflow-webserver.service
    sudo systemctl start airflow-webserver.service
    
    0 讨论(0)
  • 2021-01-05 16:23

    In Ubuntu Bionic, I found that sudo apt-get install python3-gunicorn first and then sudo apt-get install gunicorn while in the root python environment resolves this problem.

    0 讨论(0)
提交回复
热议问题