diff --git a/docs/_source/iaas_setup.rst b/docs/_source/iaas_setup.rst index fa90fcb31c47c1fc2a052451910aabc6b1be175a..5ed349bff649d42e48d339835c8155136989797e 100644 --- a/docs/_source/iaas_setup.rst +++ b/docs/_source/iaas_setup.rst @@ -626,4 +626,77 @@ can run as demons with the -D flag connect to the webserver http://<server_ip>:8090 +**set up airflow as a service** + +Once you have got airflow running from the command line, you will need to set it up as a service (which will run at startup and in the background) + +1: create a service file for airflow scheduler and webserver: + +sudo touch /etc/systemd/system/airflow-scheduler.service +sudo touch /etc/systemd/system/airflow-webserver.service + +edit the contents of both files to be: + +.. code-block:: bash + + [Unit] + Description=Airflow scheduler daemon + After=network.target mysql.service + Wants=mysql.service + [Service] + EnvironmentFile=/storage/airflow/airflow.cfg + User=ewsmanager + Group=ewsmanager + Type=simple + ExecStart=/usr/bin/bash -c 'export AIRFLOW_HOME=/storage/airflow ; source /storage/airflow/airflow-env/bin/activate ; airflow webserver' + Restart=no + RestartSec=5s + PrivateTmp=true + [Install] + WantedBy=multi-user.target + +.. code-block:: bash + + [Unit] + Description=Airflow scheduler daemon + After=network.target mysql.service + Wants=mysql.service + [Service] + EnvironmentFile=/storage/airflow/airflow.cfg + User=ewsmanager + Group=ewsmanager + Type=simple + ExecStart=/usr/bin/bash -c 'export AIRFLOW_HOME=/storage/airflow ; source /storage/airflow/airflow-env/bin/activate ; airflow scheduler' + Restart=no + RestartSec=5s + PrivateTmp=true + [Install] + WantedBy=multi-user.target + +2: reload the service daemon, enable and start the services + +sudo systemctl daemon-reload + +sudo systemctl enable airflow-scheduler.service +sudo systemctl enable airflow-webserver.service + +sudo systemctl start airflow-scheduler.service +sudo systemctl start airflow-webserver.service + +sudo systemctl restart airflow-scheduler.service +sudo systemctl restart airflow-webserver.service + +sudo systemctl stop airflow-scheduler.service +sudo systemctl stop airflow-webserver.service + +3: check the status of the services + +sudo systemctl status airflow-scheduler.service +sudo systemctl status airflow-webserver.service + +4: check the logs + +sudo journalctl -r -u airflow-scheduler.service +sudo journalctl -r -u airflow-webserver.service + diff --git a/docs/api.rst b/docs/api.rst index 92c6af18c4618c7a5de60e983a8304f22acc9f17..3d57073301b307ffbeb4f08da253caf2ac081c6f 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -6,7 +6,7 @@ API :template: custom-module-template.rst :recursive: - coordinator +.. coordinator plotting ews_postprocessing met_processing