Celery Executor Commands

Note

The CLI commands below are used from provider by Airflow 2.7.0+. Previously they were part of the core Airflow, so if you are using Airflow below 2.7.0 look at the core Airflow documentation for the list of CLI commands and parameters available.

Usage: airflow [-h] GROUP_OR_COMMAND ...

Positional Arguments

GROUP_OR_COMMAND

Possible choices: celery

Sub-commands

celery

Start celery components. Works only when using CeleryExecutor. For more information, see https://airflow.apache.org/docs/apache-airflow/stable/executor/celery.html

airflow celery [-h] COMMAND ...

Positional Arguments

COMMAND

Possible choices: flower, stop, worker

Sub-commands

flower

Start a Celery Flower

airflow celery flower [-h] [-A BASIC_AUTH] [-a BROKER_API] [-D]
                      [-c FLOWER_CONF] [-H HOSTNAME] [-l LOG_FILE]
                      [--pid [PID]] [-p PORT] [--stderr STDERR]
                      [--stdout STDOUT] [-u URL_PREFIX] [-v]
Named Arguments
-A, --basic-auth

Securing Flower with Basic Authentication. Accepts user:password pairs separated by a comma. Example: flower_basic_auth = user1:password1,user2:password2

Default: “”

-a, --broker-api

Broker API

-D, --daemon

Daemonize instead of running in the foreground

Default: False

-c, --flower-conf

Configuration file for flower

-H, --hostname

Set the hostname on which to run the server

Default: “0.0.0.0”

-l, --log-file

Location of the log file

--pid

PID file location

-p, --port

The port on which to run the server

Default: 5555

--stderr

Redirect stderr to this file

--stdout

Redirect stdout to this file

-u, --url-prefix

URL prefix for Flower

Default: “”

-v, --verbose

Make logging output more verbose

Default: False

stop

Stop the Celery worker gracefully

airflow celery stop [-h] [--pid [PID]] [-v]
Named Arguments
--pid

PID file location

-v, --verbose

Make logging output more verbose

Default: False

worker

Start a Celery worker node

airflow celery worker [-h] [-a AUTOSCALE] [-H CELERY_HOSTNAME]
                      [-c CONCURRENCY] [-D] [-l LOG_FILE] [--pid [PID]]
                      [-q QUEUES] [-s] [--stderr STDERR] [--stdout STDOUT]
                      [-u UMASK] [-v] [--without-gossip] [--without-mingle]
Named Arguments
-a, --autoscale

Minimum and Maximum number of worker to autoscale

-H, --celery-hostname

Set the hostname of celery worker if you have multiple workers on a single machine

-c, --concurrency

The number of worker processes

Default: 16

-D, --daemon

Daemonize instead of running in the foreground

Default: False

-l, --log-file

Location of the log file

--pid

PID file location

-q, --queues

Comma delimited list of queues to serve

Default: “default”

-s, --skip-serve-logs

Don’t start the serve logs process along with the workers

Default: False

--stderr

Redirect stderr to this file

--stdout

Redirect stdout to this file

-u, --umask

Set the umask of celery worker in daemon mode

-v, --verbose

Make logging output more verbose

Default: False

--without-gossip

Don’t subscribe to other workers events

Default: False

--without-mingle

Don’t synchronize with other workers at start-up

Default: False

Was this entry helpful?