Post-Upgrade Steps for Airflow
Complete the following steps after you upgrade Airflow with or without the Installer.
About this task
NOTE
Starting with DEP
10.1.0 (Data Fabric 8.1.0) , the Airflow CLI commands have been updated to align
with the official Apache Airflow naming conventions. The following changes apply:
airflow-admin→airflow— The previousairflow-admincommand is nowairflow. Use this command for Airflow server administration tasks.airflow→airflowctl— The previousairflowcommand has been renamed toairflowctl, reflecting that Airflow CTL is now distributed as a separate package (airflowctl).
These changes ensure that examples and instructions from the official Apache Airflow documentation can be used as-is, without modification.
Use these steps:
- Run
configure.sh -Rto update theairflow.cfgfile:/opt/mapr/server/configure.sh -R - Migrate any custom configuration settings (especially database-related settings)
into the
<airflow_home>/conf/directory. For example, if MySQL is used as the database, install themysqlclientby using the following steps:- Stop Airflow services.
- Run
. <airflow_home>/build/env/bin/activate. - Run
pip install mysqlclient mysql-connector-python aiomysql. - Run
deactivate.
- Update
sql_alchemy_connproperty at<airflow_home>/conf/airflow.cfg:sql_alchemy_conn = mysql+mysqldb://<user>:<password>@<hostname>:<port>/<db_name> - Copy the old value of the fernet_key property from the
airflow.cfgfile used before the upgrade and paste it intoairflow.cfgfile after the upgrade. - Initialize DB and
connections:
airflow db migrate airflow connections create-default-connections - For upgrades from an older version of Airflow to a newer version, run the
Airflow database upgrade tool:
- Use the following command to migrate the
database:
airflow db migrate - Create your default
connections:
airflow connections create-default-connections
- Use the following command to migrate the
database:
- Start the
airflow-schedulerandairflow-dag-processor, airflow-api-serverservices:maprcli node services -name airflow-dag-processor -action start -nodes <nodes list> maprcli node services -name airflow-api-server -action start -nodes <nodes list> maprcli node services -name airflow-scheduler -action start -nodes <nodes list> - Optional: If using the default SequentialExecutor, create a user. For
example:
airflow users create --username any_user --firstname any_user --lastname any_user -p any_user --role Admin --email admin@example.org
Related Links
For more information related to Fernet encryption, see these topics in the Airflow
documentation: