Running Apache Airflow Commands via CLI

Prerequisites

Before executing any Airflow commands through the CLI, ensure that you have activated the appropriate Airflow environment.

Steps to Run Airflow Commands

  1. Access the Node: Log in to the server where the Apache Airflow Scheduler and Webserver are installed.

  2. Navigate to the Airflow Home Directory: Move to the directory configured as the Airflow home location.

  3. 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
  1. 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-2/airflow export AIRFLOW_CONFIG=/usr/odp/3.2.3.3-2/airflow/airflow.cfg
  1. 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.


  Last updated