Post-Upgrade Steps for Airflow

Complete the following steps after you upgrade Airflow with or without the Installer.

About this task

Use these steps:

  1. Run configure.sh -R to update the airflow.cfg file:
    /opt/mapr/server/configure.sh -R
  2. 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 the mysqlclient by using the following steps:
    1. Stop Airflow services.
    2. Run .<airflow_home>/build/env/bin/activate.
    3. Run pip install mysqlclient mysql-connector-python aiomysql.
    4. Run deactivate.
  3. Update sql_alchemy_conn property at <airflow_home>/conf/airflow.cfg:
    sql_alchemy_conn = mysql+mysqldb://<user>:<password>@<hostname>:<port>/<db_name>
  4. Initialize DB and connections:
    airflow-admin db migrate
    airflow-admin connections create-default-connections
  5. For upgrades from an older version of Airflow to a newer version, run the Airflow database upgrade tool:
    1. Use the following command to migrate the database:
      airflow-admin db migrate
    2. Create your default connections:
      airflow-admin connections create-default-connections
    For more information about the upgrade tool, see Reference for Database Migrations in the Apache Airflow documentation.
  6. Start the airflow-scheduler and airflow-dag-processor, airflow-api-server services:
    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>
  7. 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