0
0
Apache Airflowdevops~20 mins

Celery executor for distributed execution in Apache Airflow - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Celery Executor Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How Celery Executor manages task distribution

In Apache Airflow, the Celery Executor allows distributed task execution. Which statement best describes how the Celery Executor distributes tasks?

AIt runs all tasks sequentially on the scheduler machine without using workers.
BIt uses a local thread pool to execute tasks concurrently on the same machine.
CIt sends tasks to multiple worker nodes via a message broker, allowing parallel execution.
DIt stores tasks in a database and executes them only when manually triggered.
Attempts:
2 left
💡 Hint

Think about how tasks are sent to different machines to run at the same time.

💻 Command Output
intermediate
2:00remaining
Output of Celery worker startup command

What is the expected output when you start an Airflow Celery worker with the command airflow celery worker?

Apache Airflow
airflow celery worker
A
Starting Celery worker with hostname airflow@worker1
[INFO] Ready to accept tasks
BError: Unknown command 'celery worker'
CScheduler started successfully
DNo module named 'celery'
Attempts:
2 left
💡 Hint

Consider what a worker process does when it starts.

Configuration
advanced
2:30remaining
Correct Celery Executor configuration in airflow.cfg

Which airflow.cfg snippet correctly configures Airflow to use the Celery Executor with Redis as the broker?

A
[core]
executor = CeleryExecutor

[celery]
broker_url = redis://localhost:6379/0
result_backend = db+sqlite:///airflow.db
B
[core]
executor = LocalExecutor

[celery]
broker_url = redis://localhost:6379/0
result_backend = db+sqlite:///airflow.db
C
[core]
executor = CeleryExecutor

[celery]
broker_url = amqp://guest:guest@localhost:5672//
result_backend = db+sqlite:///airflow.db
D
[core]
executor = CeleryExecutor

[celery]
broker_url = redis://localhost:6379
result_backend = redis://localhost:6379/0
Attempts:
2 left
💡 Hint

Check the executor type and the broker URL format carefully.

Troubleshoot
advanced
2:00remaining
Diagnosing Celery worker connection failure

You start a Celery worker but it fails to connect to the message broker. Which log message indicates the cause?

ATask executed successfully
BConnection refused: unable to connect to redis://localhost:6379/0
CScheduler heartbeat missed
DDatabase locked error
Attempts:
2 left
💡 Hint

Look for connection or network errors in logs.

🔀 Workflow
expert
3:00remaining
Order of steps to set up Celery Executor in Airflow

Arrange the steps in the correct order to set up the Celery Executor for distributed task execution in Airflow.

A2,3,1,4
B2,1,4,3
C1,2,3,4
D1,2,4,3
Attempts:
2 left
💡 Hint

Think about what must be ready before starting workers and scheduler.