我对气流和芹菜不熟悉,现在我已经完成了绘画的工作,但是我想在同一子网中的两台计算机上运行任务,我想知道如何修改airflow.cfg。一些例子可能会更好。
I'm new to airflow and celery, and I have finished drawing dag by now, but I want to run task in two computers which are in the same subnet, I want to know how to modify the airflow.cfg. Some examples could be better. Thanks to any answers orz.
推荐答案气流文档很好地介绍了这一点:
The Airflow documentation covers this quite nicely:
首先,您需要一个芹菜后端。例如,这可以是Redis或RabbitMQ。然后,将airflow.cfg中的executor参数设置为 CeleryExecutor 。
First, you will need a celery backend. This can be for example Redis or RabbitMQ. Then, the executor parameter in your airflow.cfg should be set to CeleryExecutor.
然后,在airflow.cfg的芹菜部分中,设置 broker_url 指向您的celery后端(例如redis:// your_redis_host:your_redis_port / 1)。 将 celery_result_backend 指向sql数据库(您可以使用与主气流数据库相同的数据库)。
Then, in the celery section of the airflow.cfg, set the broker_url to point to your celery backend (e.g. redis://your_redis_host:your_redis_port/1). Point celery_result_backend to a sql database (you can use the same as your main airflow db).
然后,在工作人员机器上简单地启动气流工作人员,您的工作应在两台机器上开始。
Then, on your worker machines simply kick off airflow worker and your jobs should start on the two machines.
更多推荐
如何在Celery中使用气流
发布评论