Prerequisites
Before executing any Airflow commands through the CLI, ensure that you have activated the appropriate Airflow environment.
Steps to Run Airflow Commands
- Access the Node: Log in to the server where the Apache Airflow Scheduler and Webserver are installed.
- Navigate to the Airflow Home Directory: Move to the directory configured as the Airflow home location.
- Activate the Virtual Environment: To ensure all package installations remain isolated and consistent, activate the virtual environment used by Airflow:
source <virtual_environment_path>_bin_activate- Set the Environment Variables: Export the Airflow Home and Airflow Configuration file paths to ensure the CLI commands use the correct configuration:
export AIRFLOW_HOME=_usr_odp_3.2.3.3-3_airflowexport AIRFLOW_CONFIG=_usr_odp_3.2.3.3-3_airflow_airflow.cfg- Run the Airflow CLI Commands: Once the environment variables are set, you can execute any Airflow CLI command. The configuration file located in the Airflow home directory will be used automatically.
Was this page helpful?