python-3.x - Apache Airflow scheduler not running workers on its own
问题描述
I am currently trying Apache Airflow on my system (Ubuntu 18) and I set it up with postgreSQL and RabbitMQ to use the CeleryExecutor.
I run airflow webserver
and airflow scheduler
on separate consoles, but the scheduler is only putting tasks as queued but no worker is actually running them.
I tried opening a different terminal and run airflow worker
on its own and that seemed to do the trick.
Now the scheduler puts tasks on a queue and the worker I ran manually actually executes them.
As I have read, that should not be the case. The scheduler should run the workers on its own right? What could I do to make this work?
I have checked the logs from the consoles and I don't see any errors.
解决方案
This is expected. If you look at the docs for airflow worker, it is specifically to bring up a Celery worker when you're using the CeleryExecutor
, while the other executors do not require a separate process for tasks to run.
LocalExecutor
: uses multiprocessing to run tasks within the scheduler.SequentialExecutor
: just runs one task at a time so that happens within the scheduler as well.CeleryExecutor
: scales out by having N workers, so having it as a separate command lets you run a worker on as many machines as you'd like.KubernetesExecutor
: I imagine talks to your Kubernetes cluster to tell it to run tasks.
推荐阅读
- c - 警告:从 C 中不兼容的指针类型传递“fread”的参数 4?
- excel - VBA Excel - 如何修复列表框表单上的过滤器代码
- python - 从字典中删除索引
- java - 如何使用打印一个条件而不是两个具有相同变量的条件
- java - 尝试在 Java 中获取日期格式 - 从单独的函数调用
- python - 如何使用 Django ORM 在 MySQL 数据库中存储缩进的 python 代码
- r - 您如何计算数据框中多个物种的平均值?参数不是数字或逻辑返回
- r - 使用R绘制市场图表条
- javascript - 解释这个 javascript 函数是如何工作的(在 Douglas Crockford 'How Javascript Works' 中找到)
- ansible - 如何阻止剧本进一步运行?