I run airflow scheduler
command, it is working. However, I am not able to set up airflow scheduler service.
Following is my airflow scheduler service code.
[Unit]
Description=Airflow scheduler daemon
After=network.target postgresql.service rabbitmq-server.service
Wants=postgresql.service rabbitmq-server.service
[Service]
EnvironmentFile=/home/ubuntu/airflow
User=ubuntu
Group=ubuntu
Type=simple
ExecStart=/bin/airflow scheduler -n ${SCHEDULER_RUNS}
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target
However, it is not running, when i start airflow-scheduler. I get following error:
May 25 21:11:37 ip-11-210-11-108 systemd[1]: airflow-scheduler.service: Service hold-off time over, scheduling restart.
May 25 21:11:37 ip-11-210-11-108 systemd[1]: Stopped Airflow scheduler daemon.
-- Subject: Unit airflow-scheduler.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit airflow-scheduler.service has finished shutting down.
May 25 21:11:37 ip-11-210-11-108 systemd[1]: airflow-scheduler.service: Failed to load environment files: No such file or directory
May 25 21:11:37 ip-11-210-11-108 systemd[1]: airflow-scheduler.service: Failed to run 'start' task: No such file or directory
May 25 21:11:37 ip-11-210-11-108 systemd[1]: Failed to start Airflow scheduler daemon.
-- Subject: Unit airflow-scheduler.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit airflow-scheduler.service has failed.
--
-- The result is failed.
May 25 21:11:37 ip-11-210-11-108 systemd[1]: airflow-scheduler.service: Unit entered failed state.
May 25 21:11:37 ip-11-210-11-108 systemd[1]: airflow-scheduler.service: Failed with result 'resources'.
I don't have any experience of systemd. What is SCHEDULER_RUNS? How to set it up ?