🚀 原文链接:https://airflow.apache.org/docs/apache-airflow/stable/executor/index.html
Executors are the mechanism by which task instances get run. They have a common API and are “pluggable”, meaning you can swap executors based on your installation needs.
Airflow has support for various executors. Current used is determined by the executor
option in the [core]
section of the configuration file.
Built-in executors are referred to by name, for example:
[core]
executor = KubernetesExecutor
You can also write your own custom executors, and refer to them by their full path:
[core]
executor = my_company.executors.MyCustomExecutor
:::tips
Note:
For more information on setting the configuration, see Setting Configuration Options.
:::
If you want to check which executor is currently set, you can use airflow config get-value core executor
command as in the example below.
$ airflow config get-value core executor
SequentialExecutor
1. Executor Types
There are two types of executor - those that run tasks locally (inside the scheduler
process), and those that run their tasks remotely (usually via a pool of workers). Airflow comes configured with the SequentialExecutor
by default, which is a local executor, and the safest option for execution, but we strongly recommend you change this to LocalExecutor
for small, single-machine installations, or one of the remote executors for a multi-machine/cloud installation.
1.1 Local Executors
Debug Executor
Local Executor
Sequential Executor