0
0
Apache Airflowdevops~10 mins

High availability configuration in Apache Airflow - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable the scheduler in Airflow's configuration for high availability.

Apache Airflow
[scheduler]
enabled = [1]
Drag options to blanks, or click blank then click option'
ATrue
BFalse
CNone
Dauto
Attempts:
3 left
💡 Hint
Common Mistakes
Setting enabled to False disables the scheduler.
Using 'None' or 'auto' are invalid values here.
2fill in blank
medium

Complete the command to start the Airflow scheduler in high availability mode.

Apache Airflow
airflow scheduler [1]
Drag options to blanks, or click blank then click option'
A--single-threaded
B--num_runs 0
C--daemon
D--high-availability
Attempts:
3 left
💡 Hint
Common Mistakes
Using --single-threaded limits scheduler concurrency.
The --num_runs 0 flag runs scheduler only once.
There is no --high-availability flag in airflow scheduler.
3fill in blank
hard

Fix the error in the Airflow configuration to enable the executor for high availability.

Apache Airflow
[core]
executor = [1]Executor
Drag options to blanks, or click blank then click option'
ASequential
BCelery
CLocal
DDebug
Attempts:
3 left
💡 Hint
Common Mistakes
SequentialExecutor runs tasks one at a time, not suitable for HA.
LocalExecutor runs tasks locally, limited for HA.
DebugExecutor is for debugging only.
4fill in blank
hard

Fill both blanks to configure the database connection string for Airflow high availability.

Apache Airflow
sql_alchemy_conn = [1]://[2]@localhost/airflow_db
Drag options to blanks, or click blank then click option'
Apostgresql+psycopg2
Buser:password
Cmysql+pymysql
Dadmin:admin123
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing MySQL dialect with PostgreSQL credentials.
Using incomplete or incorrect connection string format.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps worker names to their status if status is 'active' in Airflow high availability monitoring.

Apache Airflow
worker_status = { [1]: [2] for [3] in workers if [2] == 'active' }
Drag options to blanks, or click blank then click option'
Aworker.name
Bworker.status
Cworker
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variables like 'status' instead of 'worker.status'.
Swapping keys and values in the dictionary.