Refreshing dags without web server restart apache airflow

怎甘沉沦 提交于 2019-12-22 02:03:26

问题


Is there any way to reload the jobs without having to restart the server?


回答1:


In your airflow.cfg, you've these two configurations to control this behavior:

# after how much time a new DAGs should be picked up from the filesystem
min_file_process_interval = 0
dag_dir_list_interval = 60

You might have to reload the web-server, scheduler and workers for your new configuration to take effect.




回答2:


Dags should be reloaded when you update the associated python file.

If they are not, first try to manually refresh them in UI by clicking the button that looks like a recycle symbol:

If that doesn't work, delete all the .pyc files in the dags folder.

Usually though, when I save the python file the dag gets updated within a few moments.




回答3:


I had the same question, and didn't see this answer yet. I was able to do it from the command line with the following:

python -c "from airflow.models import DagBag; d = DagBag();"

When the webserver is running, it refreshes dags every 30 seconds or so by default, but this will refresh them in between if necessary.



来源:https://stackoverflow.com/questions/43606311/refreshing-dags-without-web-server-restart-apache-airflow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!